All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "Linux regression tracking (Thorsten Leemhuis)"
	<regressions@leemhuis.info>,
	Linux regressions mailing list <regressions@lists.linux.dev>,
	Martijn Braam <martijn@brixit.nl>,
	jernej.skrabec@gmail.com, sakari.ailus@linux.intel.com,
	linux-media@vger.kernel.org, hverkuil@xs4all.nl,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sebastian Fricke <sebastian.fricke@collabora.com>
Subject: Re: [REGRESSION] breakage in sun6i-csi media api
Date: Wed, 12 Jul 2023 16:47:25 +0200	[thread overview]
Message-ID: <ZK68_SoDU6GQSbh2@aptenodytes> (raw)
In-Reply-To: <20230629000837.122abd21@sal.lan>

[-- Attachment #1: Type: text/plain, Size: 6328 bytes --]

Hi,

Sorry for the delayed reply here.

On Thu 29 Jun 23, 00:08, Mauro Carvalho Chehab wrote:
> Em Mon, 26 Jun 2023 14:23:50 +0200
> "Linux regression tracking (Thorsten Leemhuis)" <regressions@leemhuis.info> escreveu:
> 
> > Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting
> > for once, to make this easily accessible to everyone.
> > 
> > Paul, what happened to this? It looks like this fall through the cracks,
> > but maybe I'm missing something, that's why I ask.
> 
> On a quick look, checking the proposed app fix[1], it sounds to me that
> the application is not prepared to actually use the devices that are
> enumerated, as it is setting only the values that are known.

I totally agree with this, it seems to me that the application just had
hardcoded expectations about what is exposed and did not implement
dynamic enumeration as it should have (thus not following the uAPI).

Hopefully the fix to the application will make it future-proof and we can avoid
this kind of confusion in the future!

> See, the media controller has the MEDIA_IOC_G_TOPOLOGY ioctl [2], which
> enumerates the entire sub-device topology.
> 
> The current application was just expecting two sub-devices, failing
> if other devices are added on newer Kernels. This is not how this uAPI is
> supposed to work.
> 
> [1] https://gitlab.com/postmarketOS/megapixels/-/merge_requests/31/diffs?commit_id=38bbee084126b15d39c1bce5cb5d45e6efea64fa
> [2] https://gitlab.com/postmarketOS/megapixels/-/blob/master/src/device.c#L106
> 
> Now, I was told during yesterday, during the Media Summit that there are
> new apps since Kernel 6.2 that do require setting the bridge with different
> configurations. Paul/Sebastian: is this the case? If so, could you provide
> more details about it?

I am not aware of this, so also interested in details.

> If this is true, it seems too late to revert the changes, as this will
> break other existing applications.
> 
> IMO, the best here would be to modify the application to be smarter,
> using the topology actually reported by MEDIA_IOC_G_TOPOLOGY, instead
> on relying on some specific hard-coded types.

Absolutely!

Thanks,

Paul

> Regards,
> Mauro
> 
> > 
> > Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
> > --
> > Everything you wanna know about Linux kernel regression tracking:
> > https://linux-regtracking.leemhuis.info/about/#tldr
> > If I did something stupid, please tell me, as explained on that page.
> > 
> > #regzbot poke
> > 
> > On 02.06.23 12:03, Laurent Pinchart wrote:
> > > On Fri, Jun 02, 2023 at 11:39:54AM +0200, Paul Kocialkowski wrote:  
> > >> (Re-adding folks from the original email, adding Laurent and Hans.)
> > >> On Fri 02 Jun 23, 11:24, Martijn Braam wrote:  
> > >>>
> > >>> That's basically it yes. My software doesn't expect the bridge block,
> > >>> because it wasn't there. The pipeline always worked "automatically".
> > >>>
> > >>> This is the workaround that's been made now it run on newer kernels:
> > >>> https://gitlab.com/postmarketOS/megapixels/-/merge_requests/31
> > >>>
> > >>> I'm pretty sure format propagation would fix this issue.  
> > >>
> > >> Okay that's good to know.
> > >>
> > >> To be honest it's still not very clear to me if in-driver format propagation is
> > >> a "nice to have" feature or something that all media pipeline drivers are
> > >> supposed to implement.  
> > > 
> > > For MC-based drivers, in-kernel propagation *inside* subdevs is
> > > mandatory, in-kernel propagration *between* subdevs is not allowed. The
> > > latter is the responsibility of userspace.
> > > 
> > > For traditional (I'd say legacy, but I know not everybody likes that
> > > term :-)) drivers that only expose video device nodes and do not expose
> > > subdev nodes to userspace, the driver is responsible for configuring the
> > > full pipeline internally based on the S_FMT call on the video nodes
> > > only. This isn't applicable to the sun6i-csi driver, as it exposes
> > > subdev nodes to userspace.
> > >   
> > >> Anyway I feel like this is not really a regression but a result of the driver
> > >> being converted to a newer API.
> > >>
> > >> Also there's a V4L2_CAP_IO_MC flag which should indicate that the video device
> > >> must be controlled via the media controller API instead of being
> > >> video-device-centric, but I've seen comments asking not to set the flag even
> > >> when MC is used so I'm a bit confused here.  
> > > 
> > > Would you have pointers to those comments ?
> > >   
> > >> Perhaps the flag is only required when there is no automatic format
> > >> propagation?  
> > > 
> > > The flag is more or less required when you expose subdev nodes to
> > > userspace.
> > >   
> > >> If anyone has solid answers on these points I'd be happy to read some
> > >> clarification (and act accordingly).
> > >>  
> > >>> On 6/2/23 11:16, Paul Kocialkowski wrote:  
> > >>>> Hi Martijn,
> > >>>>
> > >>>> On Thu 01 Jun 23, 23:19, Martijn Braam wrote:  
> > >>>>> It seems like this commit:
> > >>>>>
> > >>>>> media: sun6i-csi: Add bridge v4l2 subdev with port management
> > >>>>>
> > >>>>> Has changed the way the media pipeline on a64 devices, in my case the PINE64
> > >>>>> PinePhone works. Since this is an API towards userspace and there's active
> > >>>>> applications that use it I think this counts as a regression.  
> > >>>> Do you have more details on what changed specifically?
> > >>>>
> > >>>> The commit added a bridge subdev in addition to the video node, which is
> > >>>> generally a better description of the CSI hardware and also a necessity
> > >>>> to support the ISP data flow.
> > >>>>
> > >>>> Maybe your userspace application is not configuring the bridge media block with
> > >>>> the right format, which results in a mismatch?
> > >>>>
> > >>>> Some work was started to achieve automatic format propagation, perhaps it
> > >>>> would be enough to solve your issue.
> > >>>>
> > >>>> Cheers,
> > >>>>
> > >>>> Paul
> > >>>>  
> > >>>>> #regzbot introduced: 0d2b746b1bef73de62d2d311e594a7ffed4ca43  
> > >   

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-07-12 14:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 21:19 [REGRESSION] breakage in sun6i-csi media api Martijn Braam
2023-06-02  9:16 ` Paul Kocialkowski
     [not found]   ` <e168d246-528d-b615-aa50-af8f17af4442@brixit.nl>
2023-06-02  9:39     ` Paul Kocialkowski
2023-06-02 10:03       ` Laurent Pinchart
2023-06-26 12:23         ` Linux regression tracking (Thorsten Leemhuis)
2023-06-28 22:08           ` Mauro Carvalho Chehab
2023-07-12 14:47             ` Paul Kocialkowski [this message]
2023-08-29 11:33               ` Linux regression tracking #update (Thorsten Leemhuis)
2023-07-12 14:55         ` Paul Kocialkowski
2023-07-12 17:00           ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZK68_SoDU6GQSbh2@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martijn@brixit.nl \
    --cc=mchehab@kernel.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sebastian.fricke@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.