Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5675835rwb; Tue, 17 Jan 2023 17:25:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuI67u9YBfGfDbZt78v/o5/sVqgy5h/SWi4/fDVbXiOyyr9ncri4UeyYGimqEHY5CNEXmuv X-Received: by 2002:a17:906:3397:b0:86b:e50c:151b with SMTP id v23-20020a170906339700b0086be50c151bmr4565273eja.28.1674005101179; Tue, 17 Jan 2023 17:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674005101; cv=none; d=google.com; s=arc-20160816; b=w9FXcFF8mjCbW7Vh2gC7ng1KODFWTfhvnNTfH08jcOE3lErKFuUxzQMcTTZ/PtwlFp iSTIFM4XnY1TuTNKInkiTyJmxyjENBJPyjXUH6Yl/sBFpVRYFmPaTlryi1VHr/UUhPY0 x5s/mU92DClqLlKR4++ny1Hox3xve8QNEmKHAhC/pu+3Axr3Fo4PnCd3LcP8spkgA410 6nIGKhC2h1d9hGl1eW99WL8FS3z+BgKgposhE/MND6XYCnQj280phfc48sqjBWODNp2m zfJ03D8Id3s0bU9ET/ZByVJEYSSF8doCqKYBzjHyORhG0DtwmqrJ8VxIh3demlcPFH93 IU2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AQ3FuwDesUN7WVHOUjOglPfK59c4CiSEc26EgR8namY=; b=ymft0iLbFIYDOlGpAAh+QDr9rj6hvZxZvW7sp9nzlrwZ5SYfSfn9TqQyu4aPxBYPw3 H+NLmspmQ/PEASo7GMmLf9mL48hV9hnRQ8O8BkHNhCVmgZofUc1vzI8b9TrBau7gkqBH rTO8GbjtH1RzBAeB9DRlr1/msaOSpIZRBdzfWYYVDzA1cAeDX8ABgMzWdlKHs9Q02u9n pCg6vx0CeJlJXaPldt5kI3zROFMWhVFs6w8uLvV5vmN1RkFPQazdMTRqkwor0ccX3y2y XC+EkaVv9Pfq/Fl5VkS5viKPPfx2cMDcHg3XAo0kopauP8/h8elimiKr7LneJKfWdjsz ycQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=iEJF85dT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw9-20020a170906478900b0086d67a10566si13707212ejc.190.2023.01.17.17.24.49; Tue, 17 Jan 2023 17:25:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=iEJF85dT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjARBK3 (ORCPT + 46 others); Tue, 17 Jan 2023 20:10:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbjARBJu (ORCPT ); Tue, 17 Jan 2023 20:09:50 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51DD03E081; Tue, 17 Jan 2023 17:04:22 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3244010B; Wed, 18 Jan 2023 02:04:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674003860; bh=8dYvO7RCDj5YepsmKT3DATpCzMC+EsJ6lY6n3joXjiQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iEJF85dTwRd2SKEz/INYvREepJ+tbVFmoIACgIBCALIyeTE0k3msphA9l5MGxlt54 bqJC3z6fGU2OHGd2ga2j3dWCBhtoTXcpmFzTZRDOW3bgVjOxyhvOVjjyuk9aHFN0TX I5J7eP2KdsurHJZb8/MlvI9K8z2+FxyYNCyWKB/o= Date: Wed, 18 Jan 2023 03:04:20 +0200 From: Laurent Pinchart To: Hans Verkuil Cc: Yuji Ishikawa , Mauro Carvalho Chehab , Nobuhiro Iwamatsu , Rob Herring , Krzysztof Kozlowski , "Rafael J . Wysocki" , Mark Brown , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 3/6] media: platform: visconti: Add Toshiba Visconti Video Input Interface driver user interace Message-ID: References: <20230111022433.25950-1-yuji2.ishikawa@toshiba.co.jp> <20230111022433.25950-4-yuji2.ishikawa@toshiba.co.jp> <2b412539-2236-b41f-c777-bc9e9cf99d66@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2b412539-2236-b41f-c777-bc9e9cf99d66@xs4all.nl> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Jan 17, 2023 at 12:47:10PM +0100, Hans Verkuil wrote: > More comments below: > > On 11/01/2023 03:24, Yuji Ishikawa wrote: > > Add support to Video Input Interface on Toshiba Visconti ARM SoCs. > > The interface device includes CSI2 Receiver, > > frame grabber, video DMAC and image signal processor. > > This patch provides the user interface layer. > > > > A driver instance provides three /dev/videoX device files; > > one for RGB image capture, another one for optional RGB capture > > with different parameters and the last one for RAW capture. > > > > Through the device files, the driver provides streaming (DMA-BUF) interface. > > A userland application should feed DMA-BUF instances for capture buffers. > > > > The driver is based on media controller framework. > > Its operations are roughly mapped to two subdrivers; > > one for ISP and CSI2 receiver (yields 1 instance), > > the other for capture (yields 3 instances for each capture mode). > > > > Signed-off-by: Yuji Ishikawa > > --- > > Changelog v2: > > - Resend v1 because a patch exceeds size limit. > > > > Changelog v3: > > - Adapted to media control framework > > - Introduced ISP subdevice, capture device > > - Remove private IOCTLs and add vendor specific V4L2 controls > > - Change function name avoiding camelcase and uppercase letters > > > > Changelog v4: > > - Split patches because the v3 patch exceeds size limit > > - Stop using ID number to identify driver instance: > > - Use dynamically allocated structure to hold HW specific context, > > instead of static one. > > - Call HW layer functions with the context structure instead of ID number > > - Use pm_runtime to trigger initialization of HW > > along with open/close of device files. > > > > Changelog v5: > > - Fix coding style problems in viif.c > > --- > > drivers/media/platform/visconti/Makefile | 1 + > > drivers/media/platform/visconti/viif.c | 545 ++++++++ > > drivers/media/platform/visconti/viif.h | 203 +++ > > .../media/platform/visconti/viif_capture.c | 1201 +++++++++++++++++ > > drivers/media/platform/visconti/viif_isp.c | 846 ++++++++++++ > > 5 files changed, 2796 insertions(+) > > create mode 100644 drivers/media/platform/visconti/viif.c > > create mode 100644 drivers/media/platform/visconti/viif.h > > create mode 100644 drivers/media/platform/visconti/viif_capture.c > > create mode 100644 drivers/media/platform/visconti/viif_isp.c [snip] > > +static int viif_s_edid(struct file *file, void *fh, struct v4l2_edid *edid) > > +{ > > + struct viif_device *viif_dev = video_drvdata_to_capdev(file)->viif_dev; > > + struct viif_subdev *viif_sd = viif_dev->sd; > > + > > + return v4l2_subdev_call(viif_sd->v4l2_sd, pad, set_edid, edid); > > +} > > Has this driver been tested with an HDMI receiver? If not, then I would recommend > dropping support for it until you actually can test with such hardware. > > The DV_TIMINGS API is for HDMI/DVI/DisplayPort etc. interfaces, it's not meant > for CSI and similar interfaces. More than that, for MC-based drivers, the video node should *never* forward ioctls to a connected subdev. The *only* valid calls to v4l2_subdev_call() in this file are - to video.s_stream() in the start and stop streaming handler - to pad.g_fmt() when starting streaming to validate that the connected subdev outputs a format compatible with the format set on the video capture device That's it, nothing else, all other calls to v4l2_subdev_call() must be dropped from the implementation of the video_device. [snip] -- Regards, Laurent Pinchart