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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b930c6e5-1210-5b13-2e29-25ffaa99519d@ideasonboard.com>
Date:   Fri, 4 Jun 2021 11:04:29 +0300
From:   Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To:     Pratyush Yadav <p.yadav@...com>
Cc:     Maxime Ripard <mripard@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Kishon Vijay Abraham I <kishon@...com>,
        Vinod Koul <vkoul@...nel.org>,
        Peter Ujfalusi <peter.ujfalusi@...il.com>,
        Steve Longerbeam <slongerbeam@...il.com>,
        Benoit Parrot <bparrot@...com>, linux-media@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-phy@...ts.infradead.org, dmaengine@...r.kernel.org,
        Vignesh Raghavendra <vigneshr@...com>,
        Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH v2 13/18] media: ti: Add CSI2RX support for J721E

On 03/06/2021 15:49, Pratyush Yadav wrote:
> On 27/05/21 04:29PM, Tomi Valkeinen wrote:
>> Hi Pratyush,
>>
>> On 26/05/2021 18:23, Pratyush Yadav wrote:
>>> TI's J721E uses the Cadence CSI2RX and DPHY peripherals to facilitate
>>> capture over a CSI-2 bus.
>>>
>>> The Cadence CSI2RX IP acts as a bridge between the TI specific parts and
>>> the CSI-2 protocol parts. TI then has a wrapper on top of this bridge
>>> called the SHIM layer. It takes in data from stream 0, repacks it, and
>>> sends it to memory over PSI-L DMA.
>>>
>>> This driver acts as the "front end" to V4L2 client applications. It
>>> implements the required ioctls and buffer operations, passes the
>>> necessary calls on to the bridge, programs the SHIM layer, and performs
>>> DMA via the dmaengine API to finally return the data to a buffer
>>> supplied by the application.
>>>
>>> Signed-off-by: Pratyush Yadav <p.yadav@...com>
>>
>> I noticed that my test app didn't work at all with this, and I also wasn't
>> able to use v4l2-ctl to set the format.
> 
> I have not used v4l2-ctl, but I can see yavta works fine. What command
> did you use for setting format via v4l2-ctl?
> 
>>
>> At least for my test app the problem was that this driver doesn't initialize
>> the format at all. My app first calls VIDIOC_G_FMT with v4l2_format.type ==
>> V4L2_BUF_TYPE_VIDEO_CAPTURE, then after the call modifies the fields it
>> wants to change and calls VIDIOC_S_FMT. This failed, as G_FMT returned
>> uninitialized fmt, i.e. type was 0, which my app didn't set again.
>>
>> I believe the driver should have an initial format, something that it will
>> accept if an app calls G_FMT and then S_FMT.
> 
> Right. This is a bug. The question is what should the initial format be?
> It is more or less arbitrary since there is no configuration made yet
> and we don't know what the camera can or will send. So for example, what
> if I use UYVY 640x480? The camera might not support it at all. Is it
> still OK to have it as the default?

I think it doesn't really matter what the initial format is, as long as 
it's valid for the subdev itself. There are two separate things:

1) Subdev config, where the subdev is considered independently from the 
other subdevs. E.g. the formats in the input pads and output pads should 
be valid, taking into account the capabilities of the subdev. The subdev 
driver has to take care of these, i.e. if the user sets a format on a 
pad, the driver must adjust the other pads (if needed) to keep the 
subdev config valid.

2) pipeline validation, where all the subdevs in the pipeline are looked 
at and validated that the settings are compatible.

We're talking about 1) here, and it doesn't matter if the camera 
supports the csirx initial format or not.

  Tomi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ