 +	}
 +
 +	/* ...copy mesh data */
-+	if (copy_from_user(buf, (void __user *)(arg + sizeof(desc)), length)) {
++	if (copy_from_user(buf, (void __user *)desc->data, length)) {
 +		v4l2_err(&imr->v4l2_dev, "failed to read %u bytes of mapping specification\n", length);
 +		ret = -EFAULT;
 +		goto out;
 +	}
 +
++	type = desc->type;
++
 +	/* ...mesh item size calculation */
-+	item_size = (desc.type & IMR_MAP_LUCE ? 4 : 0) + (desc.type & IMR_MAP_CLCE ? 4 : 0);
++	item_size = (type & IMR_MAP_LUCE ? 4 : 0) + (type & IMR_MAP_CLCE ? 4 : 0);
 +
 +	/* ...calculate the length of a display list */
-+	if (desc.type & IMR_MAP_MESH) {
++	if (type & IMR_MAP_MESH) {
 +		/* ...assure we have proper mesh descriptor */
 +		if (length < sizeof(struct imr_mesh)) {
 +			v4l2_err(&imr->v4l2_dev, "invalid mesh specification size: %u\n", length);

+	.buf_prepare        = imr_buf_prepare,
+	.buf_queue          = imr_buf_queue,
+	.buf_finish         = imr_buf_finish,
+	.stop_streaming     = imr_stop_streaming,
+	.wait_prepare       = vb2_ops_wait_prepare,
+	.wait_finish        = vb2_ops_wait_finish,

+{
+	struct imr_ctx     *ctx = priv;
+	struct imr_device  *imr = ctx->imr;
+	struct imr_cfg     *cfg;
+	struct vb2_buffer  *src_buf, *dst_buf;
+	u32                 src_addr, dst_addr;
+	unsigned long       flags;
+
+	v4l2_dbg(3, debug, &imr->v4l2_dev, "run next job...\n");
+
+	/* ...protect access to internal device state */
+	spin_lock_irqsave(&imr->lock, flags);
+
+	/* ...retrieve input/output buffers */
+	src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
+	dst_buf = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
+
+	/* ...take configuration pointer associated with input buffer */
+	cfg = to_imr_buffer(to_vb2_v4l2_buffer(src_buf))->cfg;
+
+	/* ...cancel software reset state as needed */
+	iowrite32(0, imr->mmio + IMR_CR);
+
+	/* ...set cropping data with respect to destination sub-pixel mode */
+	iowrite32(ctx->crop[0] << cfg->dst_subpixel, imr->mmio + IMR_XMINR);
+	iowrite32(ctx->crop[1] << cfg->dst_subpixel, imr->mmio + IMR_XMAXR);
+	iowrite32(ctx->crop[2] << cfg->dst_subpixel, imr->mmio + IMR_YMINR);
+	iowrite32(ctx->crop[3] << cfg->dst_subpixel, imr->mmio + IMR_YMAXR);
+
+	/* ...adjust source/destination parameters of the program (interleaved / semiplanar) */
+	*cfg->src_pa_ptr[0] = src_addr = (u32)vb2_dma_contig_plane_dma_addr(src_buf, 0);
+	*cfg->dst_pa_ptr[0] = dst_addr = (u32)vb2_dma_contig_plane_dma_addr(dst_buf, 0);
+
+	/* ...adjust source/destination parameters of the UV-plane as needed */
+	if (cfg->src_pa_ptr[1] && cfg->dst_pa_ptr[1]) {
