media: imx-jpeg: don't change byteused of queued buffer
authorMing Qian <ming.qian@nxp.com>
Mon, 11 Apr 2022 08:19:53 +0000 (09:19 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:50:55 +0000 (08:50 +0100)
Don't change the output buffer's bytesused set by user.
Drop allow_zero_bytesused, since it's deprecated.
This should also guarantee it's the application's responsibility
to set bytesused for the output buffer.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c

index 25b888bcaa674dd0c62e671f63198ccd8e404b6c..8b33a3bca867dda05469eff05359dcfd7a6f9686 100644 (file)
@@ -1422,7 +1422,6 @@ static int mxc_jpeg_buf_prepare(struct vb2_buffer *vb)
                                i, vb2_plane_size(vb, i), sizeimage);
                        return -EINVAL;
                }
-               vb2_set_plane_payload(vb, i, sizeimage);
        }
        return 0;
 }
@@ -1470,7 +1469,6 @@ static int mxc_jpeg_queue_init(void *priv, struct vb2_queue *src_vq,
        src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
        src_vq->lock = &ctx->mxc_jpeg->lock;
        src_vq->dev = ctx->mxc_jpeg->dev;
-       src_vq->allow_zero_bytesused = 1; /* keep old userspace apps working */
 
        ret = vb2_queue_init(src_vq);
        if (ret)