From 205ce8f5462b2c032ddb10da0cec9469addc669d Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 8 Jun 2011 06:15:05 -0300 Subject: [PATCH] [media] Revert "[media] v4l2: vb2: one more fix for REQBUFS()" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit d516ea4a1e0ed364bce5b79580eadc5c21246885. Queue should be reinitialized on each REQBUFS() call even if the memory access method and buffer count have not been changed. The user might have changed the format and if we go the short path introduced in that commit, the memory buffer will not be reallocated to fit with new format. The previous patch was just over-engineered optimization, which just introduced a bug to videobuf2. Reported-by: Uwe Kleine-König Signed-off-by: Marek Szyprowski CC: Pawel Osciak Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/videobuf2-core.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 6ba1461d51ef9..6489aa26e7885 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c @@ -492,13 +492,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) return -EINVAL; } - /* - * 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 -- 2.39.5