From: Mikko Perttunen <mperttunen@nvidia.com>
To: Thierry Reding <thierry.reding@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-tegra@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, Aaron Kling <webgeek1234@gmail.com>,
webgeek1234@gmail.com
Subject: Re: [PATCH v3 2/2] drm/tegra: Support YVU formats
Date: Fri, 23 Oct 2026 21:10:12 +0900 [thread overview]
Message-ID: <T1504rPqStSSyO9jl0by8w@nvidia.com> (raw)
In-Reply-To: <20261020-tegra-drm-yvu420-v3-2-7f19a834ba98@gmail.com>
On Tuesday, October 20, 2026 5:10 PM Aaron Kling via B4 Relay wrote:
> From: Aaron Kling <webgeek1234@gmail.com>
>
> 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@gmail.com>
> ---
> 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.
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
>
>
>
next prev parent reply other threads:[~2026-10-23 12:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 8:10 [PATCH v3 0/2] " Aaron Kling via B4 Relay
2026-10-20 8:10 ` [PATCH v3 1/2] drm/tegra: Support swapping chroma planes Aaron Kling via B4 Relay
2026-10-20 8:10 ` [PATCH v3 2/2] drm/tegra: Support YVU formats Aaron Kling via B4 Relay
2026-10-23 12:10 ` Mikko Perttunen [this message]
2026-10-23 17:10 ` Aaron Kling
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=T1504rPqStSSyO9jl0by8w@nvidia.com \
--to=mperttunen@nvidia.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=thierry.reding@kernel.org \
--cc=webgeek1234@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®