public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Ezequiel Garcia <ezequiel@collabora.com>
Subject: [PATCH 2/2] v4l-helpers: Fix EXPBUF queue type
Date: Thu, 28 Jun 2018 16:25:57 -0300	[thread overview]
Message-ID: <20180628192557.22966-2-ezequiel@collabora.com> (raw)
In-Reply-To: <20180628192557.22966-1-ezequiel@collabora.com>

v4l_queue_export_bufs uses the v4l_fd type when calling
EXPBUF ioctl. However, this doesn't work on mem2mem
where there are one capture queue and one output queue
associated to the device.

The current code calls v4l_queue_export_bufs with the
wrong type, failing as:

fail: v4l2-test-buffers.cpp(544): q_.export_bufs(node)
test VIDIOC_EXPBUF: FAIL

Fix this by using the queue type instead.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 utils/common/v4l-helpers.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
index 83d8d7d9c073..d6866f04e23a 100644
--- a/utils/common/v4l-helpers.h
+++ b/utils/common/v4l-helpers.h
@@ -1633,7 +1633,7 @@ static inline int v4l_queue_export_bufs(struct v4l_fd *f, struct v4l_queue *q,
 	unsigned b, p;
 	int ret = 0;
 
-	expbuf.type = exp_type ? : f->type;
+	expbuf.type = exp_type ? : q->type;
 	expbuf.flags = O_RDWR;
 	memset(expbuf.reserved, 0, sizeof(expbuf.reserved));
 	for (b = 0; b < v4l_queue_g_buffers(q); b++) {
-- 
2.18.0.rc2

  reply	other threads:[~2018-06-28 19:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 19:25 [PATCH 1/2] v4l-helpers: Don't close the fd in {}_s_fd Ezequiel Garcia
2018-06-28 19:25 ` Ezequiel Garcia [this message]
2018-06-29  7:04   ` [PATCH 2/2] v4l-helpers: Fix EXPBUF queue type Hans Verkuil
2018-06-29  7:03 ` [PATCH 1/2] v4l-helpers: Don't close the fd in {}_s_fd Hans Verkuil
2018-06-29 17:49   ` Ezequiel Garcia
2018-06-29 18:07   ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180628192557.22966-2-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox