summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2019-09-20 18:47:02 +0200
committerMichel Dänzer <mdaenzer@redhat.com>2019-09-20 18:47:02 +0200
commit2cbbd8648cdd27db8076565943b932ef81337053 (patch)
tree7c01887eb81922842d4b59038fb3cc7f0c7ad490
parentc7ed12cb2ea76999351d7cb87877224bdc0664f0 (diff)
Don't set up black scanout buffer if LeaveVT is called from CloseScreen
Avoids a crash described in https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/merge_requests/43#note_223718 (Ported from amdgpu commit 5b8bc9fc505c551dcd9b0ed5ab835a49fa4f9fda) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_kms.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 777fc14e..107c1ce7 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -2629,6 +2629,12 @@ void RADEONLeaveVT_KMS(ScrnInfoPtr pScrn)
unsigned w = 0, h = 0;
int i;
+ /* If we're called from CloseScreen, trying to clear the black
+ * scanout BO will likely crash and burn
+ */
+ if (!pScreen->GCperDepth[0])
+ goto hide_cursors;
+
/* Compute maximum scanout dimensions of active CRTCs */
for (i = 0; i < xf86_config->num_crtc; i++) {
crtc = xf86_config->crtc[i];
@@ -2701,8 +2707,10 @@ void RADEONLeaveVT_KMS(ScrnInfoPtr pScrn)
pScrn->displayWidth * info->pixel_bytes * pScrn->virtualY);
}
- TimerSet(NULL, 0, 1000, cleanup_black_fb, pScreen);
+ if (pScreen->GCperDepth[0])
+ TimerSet(NULL, 0, 1000, cleanup_black_fb, pScreen);
+ hide_cursors:
xf86_hide_cursors (pScrn);
radeon_drop_drm_master(pScrn);