lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Jan 2023 10:20:27 +0000
From:   <yuji2.ishikawa@...hiba.co.jp>
To:     <laurent.pinchart@...asonboard.com>, <hverkuil@...all.nl>
CC:     <mchehab@...nel.org>, <nobuhiro1.iwamatsu@...hiba.co.jp>,
        <robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
        <rafael.j.wysocki@...el.com>, <broonie@...nel.org>,
        <linux-media@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: RE: [PATCH v5 3/6] media: platform: visconti: Add Toshiba Visconti
 Video Input Interface driver user interace

Hello,

> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Sent: Wednesday, January 18, 2023 10:04 AM
> To: Hans Verkuil <hverkuil@...all.nl>
> Cc: ishikawa yuji(石川 悠司 ○RDC□AITC○EA開)
> <yuji2.ishikawa@...hiba.co.jp>; Mauro Carvalho Chehab
> <mchehab@...nel.org>; iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
> <nobuhiro1.iwamatsu@...hiba.co.jp>; Rob Herring <robh+dt@...nel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>; Rafael J . Wysocki
> <rafael.j.wysocki@...el.com>; Mark Brown <broonie@...nel.org>;
> linux-media@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> linux-kernel@...r.kernel.org; devicetree@...r.kernel.org
> Subject: Re: [PATCH v5 3/6] media: platform: visconti: Add Toshiba Visconti
> Video Input Interface driver user interace
> 
> 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 <yuji2.ishikawa@...hiba.co.jp>
> > > ---
> > > 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.
> 

Thank you for your comment. I understand the restriction.
I'll remove following functions corresponding to ioctls.

* viif_enum_input
* viif_g_selection
* viif_s_selection
* viif_dv_timings_cap
* viif_enum_dv_timings
* viif_g_dv_timings
* viif_s_dv_timings
* viif_query_dv_timings
* viif_g_edid
* viif_s_edid
* viif_g_parm
* viif_s_parm
* viif_enum_framesizes
* viif_enum_frameintervals

I can call subdevices directly if I need. Is it a correct understanding?

As for viif_try_fmt_vid_cap and viif_s_fmt_vid_cap, 
I'll remove pad.g_fmt() call which is for checking pixel format.
The check will be moved to viif_capture_link_validate() validation routine triggered by a start streaming event.

> [snip]
> 
> --
> Regards,
> 
> Laurent Pinchart

Regards,
Yuji Ishikawa

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ