From ad53635af150cda9b8da413be5a011d74f972ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 3 Mar 2017 16:41:49 +0900 Subject: [PATCH] Move DPMS check from amdgpu_scanout_do_update to amdgpu_scanout_flip When amdgpu_scanout_do_update is called from drmmode_crtc_scanout_update, drmmode_crtc->pending_dpms_mode may still be != DPMSModeOn, e.g. during server startup. Fixes intermittently showing garbage with TearFree enabled. (Ported from radeon commit cc9d6b7db9c2078be1e530a64af6d517c6a42024) Reviewed-by: Alex Deucher --- src/amdgpu_kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index ce1ae43..c5205e2 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -787,7 +787,6 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) BoxRec extents; if (!xf86_crtc->enabled || - drmmode_crtc->pending_dpms_mode != DPMSModeOn || !drmmode_crtc->scanout[scanout_id].pixmap) return FALSE; @@ -970,7 +969,8 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info, uintptr_t drm_queue_seq; unsigned scanout_id; - if (drmmode_crtc->scanout_update_pending) + if (drmmode_crtc->scanout_update_pending || + drmmode_crtc->pending_dpms_mode != DPMSModeOn) return; scanout_id = drmmode_crtc->scanout_id ^ 1;