Revert "media: videobuf2: Fix length check for single plane dmabuf queueing"
Subsystems (3)
PATCH 1/1 Revert "media: videobuf2: Fix length check for single plane dmabuf queueing"
The updated length check for dmabuf types broke existing usage in v4l2 userland clients.
--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
@@ -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)
Signature · 1 line
2.25.1
Hi Naush,
Quoted 2 lines · Naushir Patuck
The updated length check for dmabuf types broke existing usage in v4l2 userland clients.
Indeed, my tests have indeed been failing since 5.8 or such it seems.
Thank you for this - it fixes the tests again for me.
Quoted 21 lines
Fixes 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")Signed-off-by Naushir Patuck <[email protected]>--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/media/common/videobuf2/videobuf2-v4l2.c +1
-2@@ -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)
Quoted 6 lines · Kieran Bingham
Hi Naush,
Quoted 2 lines · Naushir Patuck
The updated length check for dmabuf types broke existing usage in v4l2 userland clients.
Quoted 6 lines
Indeed, my tests have indeed been failing since 5.8 or such it seems.
Thank you for this - it fixes the tests again for me.
Tested-by Kieran Bingham <[email protected]>Reviewed-by Kieran Bingham <[email protected]>
?
Quoted 20 lines
Quoted 20 lines
Fixes 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")Signed-off-by Naushir Patuck <[email protected]>--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/media/common/videobuf2/videobuf2-v4l2.c +1
-2@@ -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)
Signature · 3 lines
Regards, Laurent Pinchart
Hi Laurent,
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Kieran Bingham
Hi Naush,
Quoted 2 lines · Naushir Patuck
The updated length check for dmabuf types broke existing usage in v4l2 userland clients.
Quoted 8 lines
Quoted 6 lines
Indeed, my tests have indeed been failing since 5.8 or such it seems.
Thank you for this - it fixes the tests again for me.
Tested-by Kieran Bingham <[email protected]>Reviewed-by Kieran Bingham <[email protected]>
Is that still needed/used nowadays? I thought backports were picked up automatically by the Fixes: or by AI-Magic?
Though [0] does imply it's still a preferred option.
[0] https://www.kernel.org/doc/html/v5.10/process/stable-kernel-rules.html
--
Kieran
Quoted 24 lines
?
Quoted 20 lines
Quoted 20 lines
Fixes 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")Signed-off-by Naushir Patuck <[email protected]>--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/media/common/videobuf2/videobuf2-v4l2.c +1
-2@@ -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)
PATCH v2 1/1 Revert "media: videobuf2: Fix length check for single plane dmabuf queueing"
In reply to Naushir PatuckThe updated length check for dmabuf types broke existing usage in v4l2 userland clients.
--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
@@ -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)
Signature · 1 line
2.25.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)
Quoted 8 lines · Naushir Patuck
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")Signed-off-by Naushir Patuck <[email protected]>Tested-by Kieran Bingham <[email protected]>Reviewed-by Kieran Bingham <[email protected]>
Quoted 18 lines
--- drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/media/common/videobuf2/videobuf2-v4l2.c +1
-2@@ -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)
Signature · 3 lines
Regards, Laurent Pinchart