Skip to content

Commit

Permalink
drm: vc4: txp: Do not allow 24bpp formats when transposing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
6by9 committed Dec 11, 2024
1 parent 574ea34 commit c0b2307
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/vc4/vc4_txp.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,
return -EINVAL;
}

if (conn_state->rotation == (DRM_MODE_ROTATE_0 | DRM_MODE_TRANSPOSE) &&
(fb->format->format == DRM_FORMAT_RGB888 ||
fb->format->format == DRM_FORMAT_BGR888)) {
DRM_DEBUG_KMS("24bpp formats not supported when tranposing\n");
return -EINVAL;
}

for (i = 0; i < ARRAY_SIZE(drm_fmts); i++) {
if (fb->format->format == drm_fmts[i])
break;
Expand Down

0 comments on commit c0b2307

Please sign in to comment.