Re: [PATCH v3 2/2] drm/tegra: Support YVU formats

From: Aaron Kling

Date: Fri Oct 23 2026 - 13:10:43 EST


On Fri, Oct 23, 2026 at 7:10 AM Mikko Perttunen <mperttunen@xxxxxxxxxx> wrote:
>
> On Tuesday, October 20, 2026 5:10 PM Aaron Kling via B4 Relay wrote:
> > From: Aaron Kling <webgeek1234@xxxxxxxxx>
> >
> > YVU420 is used by AOSP for video playback among other things. YVU422 and
> > YVU444 can be trivially supported in the same manner, so add them as
> > well.
> >
> > Signed-off-by: Aaron Kling <webgeek1234@xxxxxxxxx>
> > ---
> > drivers/gpu/drm/tegra/dc.c | 7 +++++++
> > drivers/gpu/drm/tegra/hub.c | 2 ++
> > drivers/gpu/drm/tegra/plane.c | 24 ++++++++++++++++++++++++
> > 3 files changed, 33 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> > index 39c2e920d76a6..be913f2609077 100644
> > --- a/drivers/gpu/drm/tegra/dc.c
> > +++ b/drivers/gpu/drm/tegra/dc.c
> > @@ -1282,6 +1282,8 @@ static const u32 tegra20_overlay_formats[] = {
> > DRM_FORMAT_YUYV,
> > DRM_FORMAT_YUV420,
> > DRM_FORMAT_YUV422,
> > + DRM_FORMAT_YVU420,
> > + DRM_FORMAT_YVU422,
> > };
> >
> > static const u32 tegra114_overlay_formats[] = {
> > @@ -1309,6 +1311,8 @@ static const u32 tegra114_overlay_formats[] = {
> > DRM_FORMAT_YUYV,
> > DRM_FORMAT_YUV420,
> > DRM_FORMAT_YUV422,
> > + DRM_FORMAT_YVU420,
> > + DRM_FORMAT_YVU422,
> > /* semi-planar formats */
> > DRM_FORMAT_NV12,
> > DRM_FORMAT_NV21,
> > @@ -1349,6 +1353,9 @@ static const u32 tegra124_overlay_formats[] = {
> > DRM_FORMAT_YUV420, /* YU12 */
> > DRM_FORMAT_YUV422, /* YU16 */
> > DRM_FORMAT_YUV444, /* YU24 */
> > + DRM_FORMAT_YVU420, /* YV12 */
> > + DRM_FORMAT_YVU422, /* YV16 */
> > + DRM_FORMAT_YVU444, /* YV24 */
> > /* semi-planar formats */
> > DRM_FORMAT_NV12,
> > DRM_FORMAT_NV21,
> > diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
> > index 5a86f8260f136..ac4542e54d7dd 100644
> > --- a/drivers/gpu/drm/tegra/hub.c
> > +++ b/drivers/gpu/drm/tegra/hub.c
> > @@ -51,6 +51,8 @@ static const u32 tegra_shared_plane_formats[] = {
> > DRM_FORMAT_YUYV,
> > DRM_FORMAT_YUV420,
> > DRM_FORMAT_YUV422,
> > + DRM_FORMAT_YVU420,
> > + DRM_FORMAT_YVU422,
> > };
>
> Well, I just tested this and it looks like the nvdisplay/hub.c based
> display controllers don't support planar YUV422. So that's an existing
> bug in the driver but I think anyway we shouldn't advertise YVU422.. :)
>
> Could you respin one more time and drop YVU422 from hub.c? You can add a
> patch to drop YUV422 as well or I can follow up with one, either way is
> fine by me.

I can send a new revision, sure. Dropping yuv422 from nvdisplay seems
out of scope of the series, though. I'd think it would make more sense
to make that standalone with a fixes tag so it can move more quickly.

Aaron

> Thanks
> Mikko
>
> >
> > static const u64 tegra_shared_plane_modifiers[] = {
> > diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
> > index 757bc552809fe..79ef5fc1b3678 100644
> > --- a/drivers/gpu/drm/tegra/plane.c
> > +++ b/drivers/gpu/drm/tegra/plane.c
> > @@ -433,14 +433,38 @@ int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap, bool *swap_uv)
> > *format = WIN_COLOR_DEPTH_YCbCr420P;
> > break;
> >
> > + case DRM_FORMAT_YVU420:
> > + if (!swap_uv)
> > + return -EINVAL;
> > +
> > + *format = WIN_COLOR_DEPTH_YCbCr420P;
> > + *swap_uv = true;
> > + break;
> > +
> > case DRM_FORMAT_YUV422:
> > *format = WIN_COLOR_DEPTH_YCbCr422P;
> > break;
> >
> > + case DRM_FORMAT_YVU422:
> > + if (!swap_uv)
> > + return -EINVAL;
> > +
> > + *format = WIN_COLOR_DEPTH_YCbCr422P;
> > + *swap_uv = true;
> > + break;
> > +
> > case DRM_FORMAT_YUV444:
> > *format = WIN_COLOR_DEPTH_YCbCr444P;
> > break;
> >
> > + case DRM_FORMAT_YVU444:
> > + if (!swap_uv)
> > + return -EINVAL;
> > +
> > + *format = WIN_COLOR_DEPTH_YCbCr444P;
> > + *swap_uv = true;
> > + break;
> > +
> > case DRM_FORMAT_NV12:
> > *format = WIN_COLOR_DEPTH_YCbCr420SP;
> > break;
> >
> > --
> > 2.54.0
> >
> >
> >
>
>
>
>