Commit 5b8bc9fc authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer
Browse files

Don't set up black scanout buffer if LeaveVT is called from CloseScreen

Avoids a crash described in
xorg/driver/xf86-video-amdgpu!43 (comment 223718)



Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e6fce59a
Pipeline #65195 passed with stages
in 2 minutes and 41 seconds
......@@ -2267,6 +2267,12 @@ void AMDGPULeaveVT_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];
......@@ -2339,8 +2345,10 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn)
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);
amdgpu_drop_drm_master(pScrn);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment