From ee7e15746148122abf6728fb0f59d6c8ae329e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 10 Jul 2018 18:53:06 +0200 Subject: [PATCH] Set drmmode_crtc->scanout_id = 0 when TearFree is disabled When disabling TearFree, drmmode_crtc->scanout_id could remain as 1, but drmmode_set_mode_major would destroy drmmode_crtc->scanout[1], so scanout_do_update() would keep bailing, and the scanout buffer would stop being updated. Fixes freeze after disabling TearFree on a CRTC with active RandR rotation or other transform. (Ported from amdgpu commit 7db0c8e9d7586cff4312d4b93684d35de3e6376f) Acked-by: Alex Deucher --- src/drmmode_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index fce8723e..df8ef320 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -885,6 +885,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, drmmode_crtc_update_tear_free(crtc); if (drmmode_crtc->tear_free) scanout_id = drmmode_crtc->scanout_id; + else + drmmode_crtc->scanout_id = 0; drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size);