diff mbox series

media: imx-jpeg: don't change byteused of queued buffer

Message ID 20220411081953.9021-1-ming.qian@nxp.com
State Accepted
Commit 2394eaeebd90270aae88284ad0d3b5c94cb2846c
Headers show
Series media: imx-jpeg: don't change byteused of queued buffer | expand

Commit Message

Ming Qian April 11, 2022, 8:19 a.m. UTC
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>
---
 drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Mirela Rabulea OSS April 11, 2022, 8:54 a.m. UTC | #1
On 11.04.2022 11:19, Ming Qian wrote:
> 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>

> ---
>   drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
> index 8bee179c5cec..930cea05c40a 100644
> --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
> +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
> @@ -1470,7 +1470,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;
>   }
> @@ -1519,7 +1518,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)
diff mbox series

Patch

diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index 8bee179c5cec..930cea05c40a 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -1470,7 +1470,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;
 }
@@ -1519,7 +1518,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)