Query: Reqbufs returning without calling queue_setup.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

There is a check in __reqbufs in videobuf2-core.c in which if the count is
same then the function returns immediately. __reqbufs also calls
queue_setup callback into driver which updates the plane counts and sizes
of vb2 queue.  The count and size can be affected/changed by S_FMT and
G_FMT ioctl calls. This causes an issue with following call flow:

1. reqbufs.count = 8;
   ioctl(fd, VIDIOC_REQBUFS, &reqbufs);
2. ioctl(fd, VIDIOC_S_FMT, &format)  --> update format with differen
height/width etc which effect the sizeofimage
3. reqbufs.count = 8;
   ioctl(fd, VIDIOC_REQBUFS, &reqbufs); to update the vb2_queue num planes
and size of each plane. But this call never goes to the driver since
the count is same.

Shouldn't we query the driver for any change in plane count/size before
deciding to return from reqbufs? Following is the code. This is just a
temporary patch to point the issue.

diff --git a/drivers/media/v4l2-core/videobuf2-core.c
b/drivers/media/v4l2-core/videobuf2-core.c
index e42eb0d..57e18c2 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -590,13 +590,6 @@ static int __reqbufs(struct vb2_queue *q, struct
v4l2_requestbuffers *req)
                return -EBUSY;
        }

-       /*
-        * If the same number of buffers and memory access method is
requested
-        * then return immediately.
-        */
-       if (q->memory == req->memory && req->count == q->num_buffers)
-               return 0;
-
        if (req->count == 0 || q->num_buffers != 0 || q->memory !=
req->memory) {
                /*
                 * We already have buffers allocated, so first check if they

Thanks
Vinay

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux