Skip to content

Commit a60ccad

Browse files
committed
drm/vmwgfx: Fix crtc's atomic check conditional
The conditional was supposed to prevent enabling of a crtc state without a set primary plane. Accidently it also prevented disabling crtc state with a set primary plane. Neither is correct. Fix the conditional and just driver-warn when a crtc state has been enabled without a primary plane which will help debug broken userspace. Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests. Signed-off-by: Zack Rusin <[email protected]> Fixes: 06ec419 ("drm/vmwgfx: Add and connect CRTC helper functions") Cc: Broadcom internal kernel review list <[email protected]> Cc: [email protected] Cc: <[email protected]> # v4.12+ Reviewed-by: Ian Forbes <[email protected]> Reviewed-by: Martin Krastev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b32233a commit a60ccad

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,16 +933,21 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane,
933933
int vmw_du_crtc_atomic_check(struct drm_crtc *crtc,
934934
struct drm_atomic_state *state)
935935
{
936+
struct vmw_private *vmw = vmw_priv(crtc->dev);
936937
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state,
937938
crtc);
938939
struct vmw_display_unit *du = vmw_crtc_to_du(new_state->crtc);
939940
int connector_mask = drm_connector_mask(&du->connector);
940941
bool has_primary = new_state->plane_mask &
941942
drm_plane_mask(crtc->primary);
942943

943-
/* We always want to have an active plane with an active CRTC */
944-
if (has_primary != new_state->enable)
945-
return -EINVAL;
944+
/*
945+
* This is fine in general, but broken userspace might expect
946+
* some actual rendering so give a clue as why it's blank.
947+
*/
948+
if (new_state->enable && !has_primary)
949+
drm_dbg_driver(&vmw->drm,
950+
"CRTC without a primary plane will be blank.\n");
946951

947952

948953
if (new_state->connector_mask != connector_mask &&

0 commit comments

Comments
 (0)