[PATCH xf86-video-ati 07/15] Make sure drmmode_crtc->scanout[] are destroyed when not needed

Michel Dänzer michel at daenzer.net
Wed Sep 21 09:50:46 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

We failed to do this when going back to scanning out directly from the
screen pixmap.

As a bonus, since we now destroy drmmode_crtc->scanout[] after setting
the new scanout buffer, we may avoid the CRTC turning off intermittently
in this case.

(Ported from amdgpu commit 9c3324715fd395fd486ea341654d78f4f298b97f)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 26ba9b1..cdfbbe5 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -781,7 +781,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 			fb_id = drmmode_crtc->rotate.fb_id;
 			x = y = 0;
 
-			drmmode_crtc_scanout_free(drmmode_crtc);
 		} else if (
 #ifdef RADEON_PIXMAP_SHARING
 			!pScreen->isGPU &&
@@ -909,9 +908,13 @@ done:
 		crtc->y = saved_y;
 		crtc->rotation = saved_rotation;
 		crtc->mode = saved_mode;
-	} else
+	} else {
 		crtc->active = TRUE;
 
+		if (fb_id != drmmode_crtc->scanout[0].fb_id)
+			drmmode_crtc_scanout_free(drmmode_crtc);
+	}
+
 	free(output_ids);
 
 	return ret;
-- 
2.9.3



More information about the amd-gfx mailing list