Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/2] media: v4l: fwnode: Parse CSI-2 C-PHY line-orders like bus-type
Date: Wed, 15 Jan 2025 08:15:28 +0000	[thread overview]
Message-ID: <Z4duoOn2ywLseSyJ@kekkonen.localdomain> (raw)
In-Reply-To: <20250107095219.GF2766897@ragnatech.se>

Hejssan,

On Tue, Jan 07, 2025 at 10:52:19AM +0100, Niklas Söderlund wrote:
> Hi Sakari,
> 
> Tack för din feedback.
> 
> On 2025-01-07 08:36:31 +0000, Sakari Ailus wrote:
> > Hejssan Niklas,
> > 
> > Tack för dessa lappar!
> > 
> > On Sat, Jan 04, 2025 at 08:55:48PM +0100, Niklas Söderlund wrote:
> > > Provided a safe-guard from the raw values used in device tree sources
> > > and the in-kernel defines used to describe the different line orders.
> > > This mimics what have been done for the bus-type property to provide the
> > > same safe-guard.
> > > 
> > > The macros used in device tree sources are defined in video-interfaces.h
> > > (MEDIA_BUS_CSI2_CPHY_LINE_ORDER_*) and are only visible to DTS source
> > > files. These raw values map directly to the in-kernel names by fwnode
> > > defines in v4l2-fwnode.h (V4L2_FWNODE_CSI2_CPHY_LINE_ORDER_*). These
> > > fwnode defines are finally translated to defines which are exposed to
> > > drivers to act on (V4L2_MBUS_CSI2_CPHY_LINE_ORDER_*).
> > > 
> > > Previously the translation to values provided to drivers have exploited
> > > the fact that the numerical value for each setting are the same for the
> > > defines used in device tree sources. While this is unlikely to change
> > > this harmonises the bus-type and line-orders parsing to work using the
> > > same mechanics, while at the same time make the large CSI-2 parsing
> > > function a little more readable.
> > 
> > Do we in fact need the V4L2_MBUS_ definitions of the line orders at all?
> 
> I'm not sure :-)
> 
> Geert pointed out in [1] that in comparison to the V4L2_MBUS_ bus-type 
> definitions the line-order definitions did not have this intermediary 
> step as a safe guard between values used in DTS files and values used in 
> V4L2 drivers.
> 
> Looking at the original functionality,
> 
>     bus->line_orders[i] = array[i];
> 
> Seems a bit "hack" compared to what this patch do,
> 
> 
>     bus->line_orders[i] = v4l2_fwnode_line_order_to_mbus(array[i]);
> 
> But if it's worth the extra churn, and if it in reality provides us with 
> a safe-guard between DTS-files and V4L2-drivers I'm not sure. I'm on the 
> fence on this one, the one good thing is that it aligns how V4L2_MBUS_ 
> macros are parsed.
> 
> But if you don't like it and I'm on the fence I'm happy to drop this 
> series. This series don't add any extra functionality.

I wasn't asking dropping the series, but instead get rid of the V4L2_MBUS_
line order definitions altogether, by replacing them by V4L2_FWNODE_
equivalents.

> 
> 1. CAMuHMdXwqb7vhUeoMKDDJO5dp-V3LmnURZLSC1_ko=YL=cNyUA@mail.gmail.com
> 
> > 
> > The same could extend to the V4L2_MBUS_ bus type defitions, but that's out
> > of scope of this patch.
> 
> Out of scope indeed. If we drop this series do we want to try and remove 
> them for V4L2_MBUS_ bus-type in future?

I think that would be reasonable. I don't think we need two sets of
definitions that effectively are interchangeable. But that may well be out
of scope of this series.

-- 
Med vänliga hälsningar,

Sakari Ailus

      parent reply	other threads:[~2025-01-15  8:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-04 19:55 [PATCH 0/2] media: v4l: fwnode: Improve line-orders parsing Niklas Söderlund
2025-01-04 19:55 ` [PATCH 1/2] media: v4l: fwnode: Add definitions for CSI-2 C-PHY line-orders Niklas Söderlund
2025-01-04 19:55 ` [PATCH 2/2] media: v4l: fwnode: Parse CSI-2 C-PHY line-orders like bus-type Niklas Söderlund
2025-01-07  8:36   ` Sakari Ailus
2025-01-07  9:52     ` Niklas Söderlund
2025-01-07 10:09       ` Geert Uytterhoeven
2025-01-15  8:15       ` Sakari Ailus [this message]

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=Z4duoOn2ywLseSyJ@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox