[PATCH v3 5/8] drm/rockchip: vop2: Only accept AFBC YTR for 8 bit RGB on RK3588
From: Arun Iyengar via B4 Relay
Date: Fri Nov 13 2026 - 18:43:08 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
According to the TRM, the AFBC decoder of the RK3588 Cluster windows
supports the lossless colour transform (YTR) only for the 8 bit RGB
formats. An RGB565 buffer with YTR gives a black picture and
POST_BUF_EMPTY, while the same buffer without YTR displays fine.
Don't accept YTR for any other format on RK3588.
Fixes: 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588")
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index e8ef83d6924b..de3da292b05a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -404,6 +404,11 @@ static bool rockchip_vop2_mod_supported(struct drm_plane *plane, u32 format,
if (vop2_convert_afbc_format(format) == VOP2_AFBC_FMT_INVALID)
return false;
+ if (vop2->version == VOP_VERSION_RK3588 && (modifier & AFBC_FORMAT_MOD_YTR) &&
+ vop2_convert_afbc_format(format) != VOP2_AFBC_FMT_ARGB8888 &&
+ vop2_convert_afbc_format(format) != VOP2_AFBC_FMT_RGB888)
+ return false;
+
/* Different windows have different format/modifier support */
for (i = 0; i < plane->modifier_count; i++) {
if (plane->modifiers[i] == modifier)
--
2.55.0