diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-09-14 17:16:49 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-09-14 17:26:35 +0900 |
commit | 01565e4427b192c7c55a820f1fb762e852859903 (patch) | |
tree | 3ace9e28a17e6dc9712f84e3e78efb4c64fbdefc /src | |
parent | 7977f39d3c7847aeba2a06f4923f12eee27b4474 (diff) |
Destroy all dedicated scanout buffers during CloseScreen
Fixes leaking active scanout buffers across a server reset, which also
fixes server reset with glamor and active scanout buffers.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(Cherry picked from commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052)
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index e41573f..5fc7ce5 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2160,8 +2160,10 @@ void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode) void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); AMDGPUInfoPtr info = AMDGPUPTR(pScrn); + int c; if (!info->drmmode_inited) return; @@ -2172,6 +2174,14 @@ void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode) RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, drm_wakeup_handler, drmmode); } + + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[0]); + drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[1]); + } } void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, |