diff mbox series

[v2] Revert "media: videobuf2: Fix length check for single plane dmabuf queueing"

Message ID 20210106151657.16210-1-naush@raspberrypi.com (mailing list archive)
State New, archived
Headers show
Series [v2] Revert "media: videobuf2: Fix length check for single plane dmabuf queueing" | expand

Commit Message

Naushir Patuck Jan. 6, 2021, 3:16 p.m. UTC
The updated length check for dmabuf types broke existing usage in v4l2
userland clients.

Fixes: 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")
Cc: stable@vger.kernel.org
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Laurent Pinchart Jan. 6, 2021, 3:25 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

(CC'ing John Cox as the author of the commit being reverted, and Hans
Verkuil as he has merged it)

On Wed, Jan 06, 2021 at 03:16:57PM +0000, Naushir Patuck wrote:
> The updated length check for dmabuf types broke existing usage in v4l2
> userland clients.
> 
> Fixes: 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")
> Cc: stable@vger.kernel.org
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> index 96d3b2b2aa31..3f61f5863bf7 100644
> --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
> +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> @@ -118,8 +118,7 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>  				return -EINVAL;
>  		}
>  	} else {
> -		length = (b->memory == VB2_MEMORY_USERPTR ||
> -			  b->memory == VB2_MEMORY_DMABUF)
> +		length = (b->memory == VB2_MEMORY_USERPTR)
>  			? b->length : vb->planes[0].length;
>  
>  		if (b->bytesused > length)
diff mbox series

Patch

diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index 96d3b2b2aa31..3f61f5863bf7 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -118,8 +118,7 @@  static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b)
 				return -EINVAL;
 		}
 	} else {
-		length = (b->memory == VB2_MEMORY_USERPTR ||
-			  b->memory == VB2_MEMORY_DMABUF)
+		length = (b->memory == VB2_MEMORY_USERPTR)
 			? b->length : vb->planes[0].length;
 
 		if (b->bytesused > length)