From patchwork Mon May 21 16:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10415929 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 D307660545 for ; Mon, 21 May 2018 17:04:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C449128996 for ; Mon, 21 May 2018 17:04:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1F0E289B0; Mon, 21 May 2018 17:04:16 +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=unavailable 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 EDD33289D1 for ; Mon, 21 May 2018 17:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753391AbeEURCK (ORCPT ); Mon, 21 May 2018 13:02:10 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44392 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753376AbeEURCF (ORCPT ); Mon, 21 May 2018 13:02:05 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id EDD1128714B From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: kernel@collabora.com, Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , linux-kernel@vger.kernel.org, Gustavo Padovan , Ezequiel Garcia Subject: [PATCH v10 09/16] cobalt: add .is_unordered() for cobalt Date: Mon, 21 May 2018 13:59:39 -0300 Message-Id: <20180521165946.11778-10-ezequiel@collabora.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180521165946.11778-1-ezequiel@collabora.com> References: <20180521165946.11778-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 From: Gustavo Padovan The cobalt driver may reorder the capture buffers so we need to report it as such. v3: set formats as unordered v2: use vb2_ops_set_unordered() helper Signed-off-by: Gustavo Padovan Signed-off-by: Ezequiel Garcia --- drivers/media/pci/cobalt/cobalt-v4l2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index e2a4c705d353..ccca1a96df90 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -430,6 +430,7 @@ static const struct vb2_ops cobalt_qops = { .stop_streaming = cobalt_stop_streaming, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, + .is_unordered = vb2_ops_is_unordered, }; /* V4L2 ioctls */ @@ -695,14 +696,17 @@ static int cobalt_enum_fmt_vid_cap(struct file *file, void *priv_fh, case 0: strlcpy(f->description, "YUV 4:2:2", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_YUYV; + f->flags |= V4L2_FMT_FLAG_UNORDERED; break; case 1: strlcpy(f->description, "RGB24", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_RGB24; + f->flags |= V4L2_FMT_FLAG_UNORDERED; break; case 2: strlcpy(f->description, "RGB32", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_BGR32; + f->flags |= V4L2_FMT_FLAG_UNORDERED; break; default: return -EINVAL;