Skip to content

Commit bcff1ed

Browse files
zackrgregkh
authored andcommitted
drm/vmwgfx: Fix crtc's atomic check conditional
commit a60ccad upstream. 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 <zack.rusin@broadcom.com> Fixes: 06ec419 ("drm/vmwgfx: Add and connect CRTC helper functions") Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v4.12+ Reviewed-by: Ian Forbes <ian.forbes@broadcom.com> Reviewed-by: Martin Krastev <martin.krastev@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-5-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8f79b42 commit bcff1ed

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
@@ -793,16 +793,21 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane,
793793
int vmw_du_crtc_atomic_check(struct drm_crtc *crtc,
794794
struct drm_atomic_state *state)
795795
{
796+
struct vmw_private *vmw = vmw_priv(crtc->dev);
796797
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state,
797798
crtc);
798799
struct vmw_display_unit *du = vmw_crtc_to_du(new_state->crtc);
799800
int connector_mask = drm_connector_mask(&du->connector);
800801
bool has_primary = new_state->plane_mask &
801802
drm_plane_mask(crtc->primary);
802803

803-
/* We always want to have an active plane with an active CRTC */
804-
if (has_primary != new_state->enable)
805-
return -EINVAL;
804+
/*
805+
* This is fine in general, but broken userspace might expect
806+
* some actual rendering so give a clue as why it's blank.
807+
*/
808+
if (new_state->enable && !has_primary)
809+
drm_dbg_driver(&vmw->drm,
810+
"CRTC without a primary plane will be blank.\n");
806811

807812

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

0 commit comments

Comments
 (0)