[PATCH v2 2/3] drm/rockchip: vop2: Skip UV plane setup for packed YUV formats
Chaoyi Chen
kernel at airkyi.com
Thu Oct 29 01:14:28 PDT 2026
From: Chaoyi Chen <chaoyi.chen at rock-chips.com>
Packed YUV formats store chroma interleaved with luma in the same plane,
so they have no plane 1 that the UV address registers could point at.
Restrict both the plane 1 offset calculation and the UV register writes
to formats with more than one plane.
Signed-off-by: Chaoyi Chen <chaoyi.chen at rock-chips.com>
---
(no changes since v1)
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index b38a32d623b5..06291a13320d 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1305,7 +1305,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
rk_obj = to_rockchip_obj(fb->obj[0]);
yrgb_mst = rk_obj->dma_addr + offset + fb->offsets[0];
- if (fb->format->is_yuv) {
+ if (fb->format->is_yuv && fb->format->num_planes > 1) {
int hsub = fb->format->hsub;
int vsub = fb->format->vsub;
@@ -1460,7 +1460,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
uv_swap = vop2_win_uv_swap(fb->format->format);
vop2_win_write(win, VOP2_WIN_UV_SWAP, uv_swap);
- if (fb->format->is_yuv) {
+ if (fb->format->is_yuv && fb->format->num_planes > 1) {
vop2_win_write(win, VOP2_WIN_UV_VIR, DIV_ROUND_UP(fb->pitches[1], 4));
vop2_win_write(win, VOP2_WIN_UV_MST, uv_mst);
}
--
2.53.0
More information about the linux-arm-kernel
mailing list