public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
@ 2026-03-23 13:07 Nicolas Chauvet
  2026-03-23 13:07 ` Nicolas Chauvet
  2026-03-24  7:05 ` Mikko Perttunen
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Chauvet @ 2026-03-23 13:07 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter; +Cc: linux-tegra, Nicolas Chauvet

The primary_format and overlay_format were picked from earlier tegra114
generation instead of using the previous tegra124 format leading to
missing format.

This patch is RFC because while it's unlikely that format availability
have skipped to earlier tegra210 soc generation I haven't confirmed
any runtime error nor experienced any regression by the lack of
availability of theses format.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
---
 drivers/gpu/drm/tegra/dc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 06370b7e0e56..d5896f12f25f 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = {
 	.has_powergate = true,
 	.coupled_pm = false,
 	.has_nvdisplay = false,
-	.num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
-	.primary_formats = tegra114_primary_formats,
-	.num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
-	.overlay_formats = tegra114_overlay_formats,
+	.num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
+	.primary_formats = tegra124_primary_formats,
+	.num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
+	.overlay_formats = tegra124_overlay_formats,
 	.modifiers = tegra124_modifiers,
 	.has_win_a_without_filters = false,
 	.has_win_b_vfilter_mem_client = false,
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
  2026-03-23 13:07 [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210 Nicolas Chauvet
@ 2026-03-23 13:07 ` Nicolas Chauvet
  2026-03-24  7:05 ` Mikko Perttunen
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Chauvet @ 2026-03-23 13:07 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter; +Cc: linux-tegra, Nicolas Chauvet

The primary_format and overlay_format were picked from earlier tegra114
generation instead of using the previous tegra124 format leading to
missing format.

This patch is RFC because while it's unlikely that format availability
have skipped to earlier tegra210 soc generation I haven't confirmed
any runtime error nor experienced any regression by the lack of
availability of theses format.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
---
 drivers/gpu/drm/tegra/dc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 06370b7e0e56..d5896f12f25f 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info tegra210_dc_soc_info = {
 	.has_powergate = true,
 	.coupled_pm = false,
 	.has_nvdisplay = false,
-	.num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
-	.primary_formats = tegra114_primary_formats,
-	.num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
-	.overlay_formats = tegra114_overlay_formats,
+	.num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
+	.primary_formats = tegra124_primary_formats,
+	.num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
+	.overlay_formats = tegra124_overlay_formats,
 	.modifiers = tegra124_modifiers,
 	.has_win_a_without_filters = false,
 	.has_win_b_vfilter_mem_client = false,
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
  2026-03-23 13:07 [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210 Nicolas Chauvet
  2026-03-23 13:07 ` Nicolas Chauvet
@ 2026-03-24  7:05 ` Mikko Perttunen
  2026-03-24 11:32   ` Nicolas Chauvet
  2026-03-24 11:42   ` Thierry Reding
  1 sibling, 2 replies; 6+ messages in thread
From: Mikko Perttunen @ 2026-03-24  7:05 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Nicolas Chauvet
  Cc: linux-tegra, Nicolas Chauvet

On Monday, March 23, 2026 10:07 PM Nicolas Chauvet wrote:
> The primary_format and overlay_format were picked from earlier tegra114
> generation instead of using the previous tegra124 format leading to
> missing format.
> 
> This patch is RFC because while it's unlikely that format availability
> have skipped to earlier tegra210 soc generation I haven't confirmed
> any runtime error nor experienced any regression by the lack of
> availability of theses format.
> 
> Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
> ---
>  drivers/gpu/drm/tegra/dc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 06370b7e0e56..d5896f12f25f 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info
> tegra210_dc_soc_info = { .has_powergate = true,
>  	.coupled_pm = false,
>  	.has_nvdisplay = false,
> -	.num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
> -	.primary_formats = tegra114_primary_formats,
> -	.num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
> -	.overlay_formats = tegra114_overlay_formats,
> +	.num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
> +	.primary_formats = tegra124_primary_formats,
> +	.num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
> +	.overlay_formats = tegra124_overlay_formats,
>  	.modifiers = tegra124_modifiers,
>  	.has_win_a_without_filters = false,
>  	.has_win_b_vfilter_mem_client = false,
> --
> 2.53.0

Looking at the TRMs, I think indeed Tegra210 also supports the 
DRM_FORMAT_RGBX8888/DRM_FORMAT_BGRX8888 formats, so this patch should be 
correct. Functionality-wise, the formats aren't handled currently in plane.c, 
so I don't think there's any change in functionality.

These formats require enabling byteswap -- so do RGBA8888/BGRA8888, but 
plane.c doesn't currently do that, so I wonder if these formats are just not 
working right now.

Thanks!
Mikko




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
  2026-03-24  7:05 ` Mikko Perttunen
@ 2026-03-24 11:32   ` Nicolas Chauvet
  2026-03-24 11:42   ` Thierry Reding
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Chauvet @ 2026-03-24 11:32 UTC (permalink / raw)
  To: Mikko Perttunen; +Cc: Thierry Reding, Jonathan Hunter, linux-tegra

Le mar. 24 mars 2026 à 08:05, Mikko Perttunen <mperttunen@nvidia.com> a écrit :
>
> On Monday, March 23, 2026 10:07 PM Nicolas Chauvet wrote:
> > The primary_format and overlay_format were picked from earlier tegra114
> > generation instead of using the previous tegra124 format leading to
> > missing format.
> >
> > This patch is RFC because while it's unlikely that format availability
> > have skipped to earlier tegra210 soc generation I haven't confirmed
> > any runtime error nor experienced any regression by the lack of
> > availability of theses format.
> >
> > Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
> > ---
> >  drivers/gpu/drm/tegra/dc.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> > index 06370b7e0e56..d5896f12f25f 100644
> > --- a/drivers/gpu/drm/tegra/dc.c
> > +++ b/drivers/gpu/drm/tegra/dc.c
> > @@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info
> > tegra210_dc_soc_info = { .has_powergate = true,
> >       .coupled_pm = false,
> >       .has_nvdisplay = false,
> > -     .num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
> > -     .primary_formats = tegra114_primary_formats,
> > -     .num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
> > -     .overlay_formats = tegra114_overlay_formats,
> > +     .num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
> > +     .primary_formats = tegra124_primary_formats,
> > +     .num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
> > +     .overlay_formats = tegra124_overlay_formats,
> >       .modifiers = tegra124_modifiers,
> >       .has_win_a_without_filters = false,
> >       .has_win_b_vfilter_mem_client = false,
> > --
> > 2.53.0
>
> Looking at the TRMs, I think indeed Tegra210 also supports the
> DRM_FORMAT_RGBX8888/DRM_FORMAT_BGRX8888 formats, so this patch should be
> correct. Functionality-wise, the formats aren't handled currently in plane.c,
> so I don't think there's any change in functionality.
>
> These formats require enabling byteswap -- so do RGBA8888/BGRA8888, but
> plane.c doesn't currently do that, so I wonder if these formats are just not
> working right now.

Thanks for the review,

For info, I've spotted this when trying to understand a graphic
regression in mesa starting with mesa-25.2
https://gitlab.freedesktop.org/mesa/mesa/-/issues/14640

That was initially an issue with mutter been way less efficient than
weston for some reason (with earlier mesa-25.1)
https://gitlab.gnome.org/GNOME/mutter/-/issues/4501

I expect something related to how some formats are selected/advertised...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
  2026-03-24  7:05 ` Mikko Perttunen
  2026-03-24 11:32   ` Nicolas Chauvet
@ 2026-03-24 11:42   ` Thierry Reding
  2026-03-25  0:50     ` Mikko Perttunen
  1 sibling, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2026-03-24 11:42 UTC (permalink / raw)
  To: Mikko Perttunen
  Cc: Thierry Reding, Jonathan Hunter, Nicolas Chauvet, linux-tegra

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

On Tue, Mar 24, 2026 at 04:05:19PM +0900, Mikko Perttunen wrote:
> On Monday, March 23, 2026 10:07 PM Nicolas Chauvet wrote:
> > The primary_format and overlay_format were picked from earlier tegra114
> > generation instead of using the previous tegra124 format leading to
> > missing format.
> > 
> > This patch is RFC because while it's unlikely that format availability
> > have skipped to earlier tegra210 soc generation I haven't confirmed
> > any runtime error nor experienced any regression by the lack of
> > availability of theses format.
> > 
> > Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
> > ---
> >  drivers/gpu/drm/tegra/dc.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> > index 06370b7e0e56..d5896f12f25f 100644
> > --- a/drivers/gpu/drm/tegra/dc.c
> > +++ b/drivers/gpu/drm/tegra/dc.c
> > @@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info
> > tegra210_dc_soc_info = { .has_powergate = true,
> >  	.coupled_pm = false,
> >  	.has_nvdisplay = false,
> > -	.num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
> > -	.primary_formats = tegra114_primary_formats,
> > -	.num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
> > -	.overlay_formats = tegra114_overlay_formats,
> > +	.num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
> > +	.primary_formats = tegra124_primary_formats,
> > +	.num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
> > +	.overlay_formats = tegra124_overlay_formats,
> >  	.modifiers = tegra124_modifiers,
> >  	.has_win_a_without_filters = false,
> >  	.has_win_b_vfilter_mem_client = false,
> > --
> > 2.53.0
> 
> Looking at the TRMs, I think indeed Tegra210 also supports the 
> DRM_FORMAT_RGBX8888/DRM_FORMAT_BGRX8888 formats, so this patch should be 
> correct. Functionality-wise, the formats aren't handled currently in plane.c, 
> so I don't think there's any change in functionality.
> 
> These formats require enabling byteswap -- so do RGBA8888/BGRA8888, but 
> plane.c doesn't currently do that, so I wonder if these formats are just not 
> working right now.

It's been a really long time that I've looked at this, but if I recall
correctly at least on pre-Tegra186 we properly program the byteswap
registers (see DC_WIN_BYTE_SWAP in dc.c's tegra_dc_setup_window()). It
is possible that I never implemented this for Tegra186 and later, where
all the plane programming happens in hub.c with the shared planes.

I suspect that for Tegra210 we could add a bunch more formats, and I
have a vague recollection that I had prototypes a few more a long time
ago (notable some more YUV variants) but may never have submitted those
patches because I couldn't find a good way to test them.

Thierry

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210
  2026-03-24 11:42   ` Thierry Reding
@ 2026-03-25  0:50     ` Mikko Perttunen
  0 siblings, 0 replies; 6+ messages in thread
From: Mikko Perttunen @ 2026-03-25  0:50 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Thierry Reding, Jonathan Hunter, Nicolas Chauvet, linux-tegra

On Tuesday, March 24, 2026 8:42 PM Thierry Reding wrote:
> On Tue, Mar 24, 2026 at 04:05:19PM +0900, Mikko Perttunen wrote:
> > On Monday, March 23, 2026 10:07 PM Nicolas Chauvet wrote:
> > > The primary_format and overlay_format were picked from earlier tegra114
> > > generation instead of using the previous tegra124 format leading to
> > > missing format.
> > > 
> > > This patch is RFC because while it's unlikely that format availability
> > > have skipped to earlier tegra210 soc generation I haven't confirmed
> > > any runtime error nor experienced any regression by the lack of
> > > availability of theses format.
> > > 
> > > Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
> > > ---
> > > 
> > >  drivers/gpu/drm/tegra/dc.c | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> > > index 06370b7e0e56..d5896f12f25f 100644
> > > --- a/drivers/gpu/drm/tegra/dc.c
> > > +++ b/drivers/gpu/drm/tegra/dc.c
> > > @@ -2942,10 +2942,10 @@ static const struct tegra_dc_soc_info
> > > tegra210_dc_soc_info = { .has_powergate = true,
> > > 
> > >  	.coupled_pm = false,
> > >  	.has_nvdisplay = false,
> > > 
> > > -	.num_primary_formats = ARRAY_SIZE(tegra114_primary_formats),
> > > -	.primary_formats = tegra114_primary_formats,
> > > -	.num_overlay_formats = ARRAY_SIZE(tegra114_overlay_formats),
> > > -	.overlay_formats = tegra114_overlay_formats,
> > > +	.num_primary_formats = ARRAY_SIZE(tegra124_primary_formats),
> > > +	.primary_formats = tegra124_primary_formats,
> > > +	.num_overlay_formats = ARRAY_SIZE(tegra124_overlay_formats),
> > > +	.overlay_formats = tegra124_overlay_formats,
> > > 
> > >  	.modifiers = tegra124_modifiers,
> > >  	.has_win_a_without_filters = false,
> > >  	.has_win_b_vfilter_mem_client = false,
> > > 
> > > --
> > > 2.53.0
> > 
> > Looking at the TRMs, I think indeed Tegra210 also supports the
> > DRM_FORMAT_RGBX8888/DRM_FORMAT_BGRX8888 formats, so this patch should be
> > correct. Functionality-wise, the formats aren't handled currently in
> > plane.c, so I don't think there's any change in functionality.
> > 
> > These formats require enabling byteswap -- so do RGBA8888/BGRA8888, but
> > plane.c doesn't currently do that, so I wonder if these formats are just
> > not working right now.
> 
> It's been a really long time that I've looked at this, but if I recall
> correctly at least on pre-Tegra186 we properly program the byteswap
> registers (see DC_WIN_BYTE_SWAP in dc.c's tegra_dc_setup_window()). It
> is possible that I never implemented this for Tegra186 and later, where
> all the plane programming happens in hub.c with the shared planes.
> 
> I suspect that for Tegra210 we could add a bunch more formats, and I
> have a vague recollection that I had prototypes a few more a long time
> ago (notable some more YUV variants) but may never have submitted those
> patches because I couldn't find a good way to test them.
> 
> Thierry

TBH I'm probably getting all the endiannesses of these format names mixed up 
in my head. FWIW, for pre-Tegra186, we are programming the swap register but 
plane.c always sets it to NOSWAP for the RGB-y formats.

Mikko




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-25  0:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 13:07 [PATCH] [RFC] drm/tegra: fixup primary/overlay format for tegra210 Nicolas Chauvet
2026-03-23 13:07 ` Nicolas Chauvet
2026-03-24  7:05 ` Mikko Perttunen
2026-03-24 11:32   ` Nicolas Chauvet
2026-03-24 11:42   ` Thierry Reding
2026-03-25  0:50     ` Mikko Perttunen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox