From patchwork Thu Jun 28 19:25:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10494891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 587486022E for ; Thu, 28 Jun 2018 19:26:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C51B2A4A9 for ; Thu, 28 Jun 2018 19:26:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 506C72A4EC; Thu, 28 Jun 2018 19:26:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 059A32A4A9 for ; Thu, 28 Jun 2018 19:26:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932369AbeF1T0U (ORCPT ); Thu, 28 Jun 2018 15:26:20 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33470 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753642AbeF1T0T (ORCPT ); Thu, 28 Jun 2018 15:26:19 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 40FE927570C From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: Hans Verkuil , Ezequiel Garcia Subject: [PATCH 2/2] v4l-helpers: Fix EXPBUF queue type Date: Thu, 28 Jun 2018 16:25:57 -0300 Message-Id: <20180628192557.22966-2-ezequiel@collabora.com> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180628192557.22966-1-ezequiel@collabora.com> References: <20180628192557.22966-1-ezequiel@collabora.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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++) {