summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-21 16:40:42 +0900
committerMichel Dänzer <michel@daenzer.net>2016-09-21 18:20:19 +0900
commit8419db3de6157875f9a840773350ecd29cd42d83 (patch)
tree07b42f0b4aa313e4d93800f78b656ef7c204baa7 /src
parent956e03d6a6b9478dd8e77c81f426c0d371c5d7a1 (diff)
Make sure drmmode_crtc->scanout[] are destroyed when not needed
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)
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 26ba9b16..cdfbbe5e 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;