From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F8FEC76196 for ; Sat, 25 Mar 2023 21:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1FtMXM5vjmPUsvIQWwqg879Oecpw5OEl9krb0XaKTjM=; b=CcLW+cb7udm1rW yBEw8dW+gZlsbEbvCUam1aDCCHFnLNg9nrza5AlfwHHxGOjg5r33jBhku+csqZHyA5VcT/K9wugFK /5TD6kpSe0+aZzjnznyF3Dy3Bjp6X4FiORStGTXyrW8/G/WjDIdVY/nbobddbR11sKXbOB0zmPs4y Do9SyVpe5Acp/0XvLdDkyT+EdBG16HLm/tIHlBV3kFmsYoRN4/rIqobQoG2fVEaf52CjHrLK4O3kL TKMXqhiHZ2x0mCE5rfYkbJrRc12BGI2BlR2bHWBQaGRm//mvQzxy5/39EjIuFsdef5l7G+ezF7S4f LMid4pZyC4PQU1pva0JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgBeN-007Ri4-2b; Sat, 25 Mar 2023 21:42:11 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgBeJ-007Rgn-2f for linux-arm-kernel@lists.infradead.org; Sat, 25 Mar 2023 21:42:09 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A02C98BE; Sat, 25 Mar 2023 22:42:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679780525; bh=CAS+ru0ajwIKIWzCOM/JwX8K8QgHCTE7GYFPL5L+3xo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H2MrBCNWiVjUgxcVGkWWQZNsLizT7wYScyi3l/Y6iGkdX8yP6MEzcOX9Eh9nc+UMw ohq5ygASUG6ikzJWztkAe8SVq4+U0Ljg0EXcxop0u1GDqS5POWL+I/zSB2MTnS3WQx 53lDQMMa1U0vCNF9Ot4nEzr/H8JmoxQ7ZsRCpSYI= Date: Sat, 25 Mar 2023 23:42:12 +0200 From: Laurent Pinchart To: Paul Kocialkowski Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Adam Pigg , Thomas Petazzoni Subject: Re: [PATCH 8/9] media: sun6i-isp: capture: Implement MC I/O with extended enum_fmt Message-ID: <20230325214212.GF22214@pendragon.ideasonboard.com> References: <20230324151228.2778112-1-paul.kocialkowski@bootlin.com> <20230324151228.2778112-9-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230324151228.2778112-9-paul.kocialkowski@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230325_144208_029854_07ED8C54 X-CRM114-Status: GOOD ( 22.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Paul, Thank you for the patch. On Fri, Mar 24, 2023 at 04:12:27PM +0100, Paul Kocialkowski wrote: > This driver needs the media-controller API to operate and should not be > considered as a video-device-centric implementation. > > Properly report the IO_MC device cap and extend the enum_fmt > implementation to support enumeration with an explicit mbus_code. > > Signed-off-by: Paul Kocialkowski > --- > .../staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > index 1595a9607775..5160b93b69ff 100644 > --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > @@ -439,6 +439,12 @@ static int sun6i_isp_capture_enum_fmt(struct file *file, void *private, > struct v4l2_fmtdesc *fmtdesc) > { > u32 index = fmtdesc->index; > + u32 mbus_code = fmtdesc->mbus_code; > + > + if (mbus_code && !sun6i_isp_proc_format_find(mbus_code)) > + return -EINVAL; > + This doesn't look right. As far as I understand, sun6i_isp_proc_format_find() looks up media bus codes for the ISP sink pad. Here you enuemrate pixel formats of the ISP output, so the media bus code given by userspace corresponds to the ISP source pad. I've had a look at sun6i_isp_proc_set_fmt() to see what media bus codes are used on the ISP output, and couldn't figure it out as it seems incorrectly implemented :-) The function doesn't check format->pad. > + /* Capture format is independent from proc format. */ > > if (index >= ARRAY_SIZE(sun6i_isp_capture_formats)) > return -EINVAL; > @@ -685,7 +691,8 @@ int sun6i_isp_capture_setup(struct sun6i_isp_device *isp_dev) > > strscpy(video_dev->name, SUN6I_ISP_CAPTURE_NAME, > sizeof(video_dev->name)); > - video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; > + video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | > + V4L2_CAP_IO_MC; > video_dev->vfl_dir = VFL_DIR_RX; > video_dev->release = video_device_release_empty; > video_dev->fops = &sun6i_isp_capture_fops; -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel