Re: [PATCH v8 10/12] drm/tegra: rgb: Parameterize configuration based on bus flags
From: Svyatoslav Ryhel
Date: Sat Nov 28 2026 - 02:55:50 EST
пт, 27 лист. 2026 р. о 14:26 Mikko Perttunen <mperttunen@xxxxxxxxxx> пише:
>
> On Friday, November 27, 2026 6:41 PM Svyatoslav Ryhel wrote:
> > пт, 27 лист. 2026 р. о 11:21 Svyatoslav Ryhel <clamor95@xxxxxxxxx> пише:
> > >
> > > пт, 27 лист. 2026 р. о 08:22 Mikko Perttunen <mperttunen@xxxxxxxxxx> пише:
> > > >
> > > > On Sunday, November 22, 2026 5:18 PM Svyatoslav Ryhel wrote:
> > > > > Parameterize configuration based on bus flags passed from the bridge or
> > > > > panel. The list of supported flags includes now pixel clock polarity,
> > > > > display enable (DE) polarity, and data alignment.
> > > > >
> > > > > Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
> > > > > ---
> > ...
> > > > > + /* configure DATA order and alignment */
> > > > > + value = DISP_DATA_FORMAT_DF1P1C | DISP_ORDER_RED_BLUE;
> > > > > +
> > > > > + if (bus_flags & DRM_BUS_FLAG_DATA_LSB_TO_MSB)
> > > > > + value |= DISP_ALIGNMENT_LSB;
> > > > > + else
> > > > > + value &= ~DISP_ALIGNMENT_LSB;
> > > >
> > > > DRM_BUS_FLAG_DATA_LSB_TO_MSB does not seem the correct thing to check
> > > > here. According to the TRM, DISP_ALIGNMENT doesn't swap between LSB/MSB
> > > > bit ordering in a classical way, instead:
> > > >
> > > > // DISP_DATA_ALIGNMENT = 0 (MSB)
> > > > LD[23:0] = {R[1:0], G[1:0], B[1:0],
> > > > R[7:2], G[7:2], B[7:2]};
> > > >
> > > > // DISP_DATA_ALIGNMENT = 1 (LSB)
> > > > LD[23:0] = {R[7:0], G[7:0], B[7:0]};
> > > >
> > > > I suppose MSB is more natural for 18-bit panels and LSB for 24-bit
> > > > panels depending on the layout. So the correct value depends on how the
> > > > panel is wired to the SoC on the board. Hence, I think we should
> > > > describe this with a new property in device tree under rgb/dbi or
> > > > endpoint node. Something like 'nvidia,rgb888-wiring' for LSB? And
> > > > document that this means the above kind of wiring - not all RGB888
> > > > panels use it.
> > > >
> > >
> > > Ugh, why is this so confusing...
> > >
> >
> > Using 'nvidia,rgb888-wiring' may be confusing since as you mentioned
> > not all RGB888 panels use it. I can add 'nvidia,data-alignment' to rgb
> > properties and set 0 to msb (default) and 1 to lsb, or directly set
> > boolean `nvidia,data-alignment-lsb`. Let me know which is preferred.
>
> data-alignment is a very ambiguous name if one isn't deeply familiar
> with the hardware, hence I was thinking something a bit clearer would be
> better.
>
> I agree nvidia,rgb888-wiring isn't the best either, but I'm not sure
> what would be the best choice here, off-hand.
>
'nvidia,disp-data-alignment' to match exact field name it refers to?
'nvidia,rgb888-wiring' is too ambiguous as well.
> >
> > > > > +
> > > > > tegra_dc_writel(rgb->dc, value, DC_DISP_DISP_INTERFACE_CONTROL);
> > > > >
> > > > > tegra_dc_commit(rgb->dc);
> > > > > --
> > > > > 2.53.0
> > > > >
>
>
>
>