Skip to contentSkip to conversation

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

PATCH Superseded Naushir Patuck 3 participants 6 messages Jan 6, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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
Tested-by Reviewed-by on v1 1/1
#1 lore raw

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")
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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)
#2 lore raw
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.

?

Quoted 20 lines
Quoted 20 lines
Fixes 961d3b27 ("media: videobuf2: Fix length check for single plane dmabuf queueing")
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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
#3 lore raw

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.

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")
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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)
#4 lore raw

PATCH v2 1/1 Revert "media: videobuf2: Fix length check for single plane dmabuf queueing"

In reply to 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")
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-v4l2.c +1 -2
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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
Reviewed-by on v2 1/1
#5 lore raw

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")
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
index 96d3b2b2aa31..3f61f5863bf7 100644
@@ -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