drm/vmwgfx: Don't destroy Screen Target when CRTC is enabled but inactive
authorIan Forbes <ian.forbes@broadcom.com>
Fri, 31 May 2024 20:33:58 +0000 (15:33 -0500)
committerZack Rusin <zack.rusin@broadcom.com>
Thu, 6 Jun 2024 02:11:42 +0000 (22:11 -0400)
commit7ef91dcba172441582962602ff6899bfec6078b7
tree7a0fbd143865f603b404d036ed0526770fe65f60
parenta54a200f3dc710db0572aba45c5c06b12b74489a
drm/vmwgfx: Don't destroy Screen Target when CRTC is enabled but inactive

drm_crtc_helper_funcs::atomic_disable can be called even when the CRTC is
still enabled. This can occur when the mode changes or the CRTC is set as
inactive.

In the case where the CRTC is being set as inactive we only want to
blank the screen. The Screen Target should remain intact as long as the
mode has not changed and CRTC is enabled.

This fixes a bug with GDM where locking the screen results in a permanent
black screen because the Screen Target is no longer defined.

Fixes: 7b0062036c3b ("drm/vmwgfx: Implement virtual crc generation")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240531203358.26677-1-ian.forbes@broadcom.com
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c