diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-09-14 16:56:22 +0900 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2016-09-14 16:56:22 +0900 |
commit | 4a5fa37f74c233c6b9c6a08306688628a8e216e8 (patch) | |
tree | 64f622995a17930193a01190c5e40b56c6744cfd | |
parent | cc2555835cd4c5fd2ae4f999a4bf7c18cdb1dda4 (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.
(Ported from amdgpu commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-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 34f77351..3aae69a8 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2386,8 +2386,10 @@ void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode) void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); RADEONInfoPtr info = RADEONPTR(pScrn); + int c; if (info->dri2.pKernelDRMVersion->version_minor < 4 || !info->drmmode_inited) return; @@ -2402,6 +2404,14 @@ void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode) drm_wakeup_handler, drmmode); #endif } + + 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]); + } } |