From patchwork Mon Feb 15 04:26:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 383116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53764C433E0 for ; Mon, 15 Feb 2021 04:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23A2A64E52 for ; Mon, 15 Feb 2021 04:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbhBOEeE (ORCPT ); Sun, 14 Feb 2021 23:34:04 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:45902 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbhBOEeC (ORCPT ); Sun, 14 Feb 2021 23:34:02 -0500 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EA1491934; Mon, 15 Feb 2021 05:28:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613363312; bh=+aHdLg8L6rJVSi90fEtONGGwDUElEHPHkSmAJIk0WlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CCPabTJDfTqCzCbcumBerQKodtDi4N6ofybpXGN1ROWzK4ugblZH9X7wMWnJcgkXY Kbx6E4ND8W8td/yfgxgTkY8IxPtgAoabXTo9wxcSuhSZ/zDvuoFDiWMNthrAiNZSLS x/wzOA7DHnEdCWkrvLGXpxE0Aqm+mMhjtTKZmvyE= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Ezequiel Garcia , Fabio Estevam Subject: [PATCH v2 28/77] media: imx: capture: Expose V4L2_CAP_IO_MC for the MC-centric API Date: Mon, 15 Feb 2021 06:26:52 +0200 Message-Id: <20210215042741.28850-29-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> References: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Report to userspace that the MC-centric API is MC-centric by exposing the V4L2_CAP_IO_MC. This requires adding support for mbus code filtering in format enumeration, as required by V4L2_CAP_IO_MC. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva --- drivers/staging/media/imx/imx-media-capture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 99133b7ffa5f..c4360866f7f6 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -96,7 +96,7 @@ static int capture_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) { return imx_media_enum_pixel_formats(&f->pixelformat, f->index, - PIXFMT_SEL_ANY, 0); + PIXFMT_SEL_ANY, f->mbus_code); } static int capture_enum_framesizes(struct file *file, void *fh, @@ -986,7 +986,8 @@ imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd, vfd->release = video_device_release; vfd->vfl_dir = VFL_DIR_RX; vfd->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM; - vfd->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; + vfd->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING + | (!legacy_api ? V4L2_CAP_IO_MC : 0); vfd->lock = &priv->mutex; vfd->queue = &priv->q;