diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-06-22 16:12:32 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-06-23 16:10:33 +0900 |
commit | 9c3324715fd395fd486ea341654d78f4f298b97f (patch) | |
tree | 095c37a095e45d45b35b765dbb9ca5635731f937 | |
parent | 3bce0519a4008cf87c0e31a7a579e10f5dcdd2f3 (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.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/drmmode_display.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 50e541e..2cd99cb 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -697,17 +697,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, if (crtc->randr_crtc && crtc->randr_crtc->scanout_pixmap) { x = drmmode_crtc->prime_pixmap_x; y = 0; - - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[0]); - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); } else #endif if (drmmode_crtc->rotate.fb_id) { fb_id = drmmode_crtc->rotate.fb_id; x = y = 0; - - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[0]); - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); } else if (info->tear_free || #if XF86_CRTC_VERSION >= 4 crtc->driverIsPerformingTransform || @@ -838,9 +832,15 @@ 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_destroy(drmmode, &drmmode_crtc->scanout[0]); + drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); + } + } + return ret; } |