From: Aaron Kling via B4 Relay <devnull+webgeek1234.gmail.com@kernel.org>
To: Thierry Reding <thierry.reding@kernel.org>,
Mikko Perttunen <mperttunen@nvidia.com>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org,
Aaron Kling <webgeek1234@gmail.com>
Subject: [PATCH v4 2/2] drm/tegra: Support YVU formats
Date: Sun, 25 Oct 2026 17:34:30 -0500 [thread overview]
Message-ID: <20261025-tegra-drm-yvu420-v4-2-30b3bb0d0752@gmail.com> (raw)
In-Reply-To: <20261025-tegra-drm-yvu420-v4-0-30b3bb0d0752@gmail.com>
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 where
supported as well.
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
drivers/gpu/drm/tegra/dc.c | 7 +++++++
drivers/gpu/drm/tegra/hub.c | 1 +
drivers/gpu/drm/tegra/plane.c | 24 ++++++++++++++++++++++++
3 files changed, 32 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..46756c749e674 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -51,6 +51,7 @@ static const u32 tegra_shared_plane_formats[] = {
DRM_FORMAT_YUYV,
DRM_FORMAT_YUV420,
DRM_FORMAT_YUV422,
+ DRM_FORMAT_YVU420,
};
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.56.0
next prev parent reply other threads:[~2026-10-25 22:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 22:34 [PATCH v4 0/2] " Aaron Kling via B4 Relay
2026-10-25 22:34 ` [PATCH v4 1/2] drm/tegra: Support swapping chroma planes Aaron Kling via B4 Relay
2026-10-25 22:34 ` Aaron Kling via B4 Relay [this message]
2026-10-28 1:52 ` [PATCH v4 0/2] drm/tegra: Support YVU formats Mikko Perttunen
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=20261025-tegra-drm-yvu420-v4-2-30b3bb0d0752@gmail.com \
--to=devnull+webgeek1234.gmail.com@kernel.org \
--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=mperttunen@nvidia.com \
--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®