From af4ab4fb77dfc697c8ae068b18f27de1ee5d609f Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 11 Dec 2024 16:30:43 +0000 Subject: [PATCH] drm: vc4: txp: Do not allow 24bpp formats when transposing The hardware doesn't support transposing to 24bpp (RGB888/BGR888) formats. There's no way to advertise this through DRM, so block it from atomic_check instead. Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_txp.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -272,6 +272,13 @@ static int vc4_txp_connector_atomic_chec return -EINVAL; } + if (conn_state->rotation & DRM_MODE_TRANSPOSE && + (fb->format->format == DRM_FORMAT_RGB888 || + fb->format->format == DRM_FORMAT_BGR888)) { + DRM_DEBUG_KMS("24bpp formats not supported when transposing\n"); + return -EINVAL; + } + for (i = 0; i < ARRAY_SIZE(drm_fmts); i++) { if (fb->format->format == drm_fmts[i]) break;