diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-09 14:00:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-09 14:12:25 +0100 |
commit | 6ff369cd2602497ee11273b50f76d1a7bf25991d (patch) | |
tree | aae7b6b2dab64cf95dfa0dcf7a8ddecf29b7e837 /src | |
parent | 6fba8c449f61341a98a5ae8d97effa6fd0610fd4 (diff) |
drmmode: Destroy Crtc on screen shutdown
Should fix:
Bug 26946 - CRTC cursor BO leak in 2D
https://bugs.freedesktop.org/show_bug.cgi?id=26946
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 11 | ||||
-rw-r--r-- | src/intel.h | 2 | ||||
-rw-r--r-- | src/intel_driver.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 40643b0d..906cd71a 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -643,7 +643,7 @@ drmmode_crtc_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, int num) GTT_PAGE_SIZE); drm_intel_bo_disable_reuse(drmmode_crtc->cursor); - return; + intel->crtc = crtc; } static xf86OutputStatus @@ -1487,6 +1487,15 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp) return TRUE; } +void +drmmode_close_screen(intel_screen_private *intel) +{ + if (intel->crtc) { + xf86CrtcDestroy(intel->crtc); + intel->crtc = NULL; + } +} + int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc) { diff --git a/src/intel.h b/src/intel.h index bdd89e5f..bd24708d 100644 --- a/src/intel.h +++ b/src/intel.h @@ -278,6 +278,7 @@ typedef struct intel_screen_private { long FbMapSize; long GTTMapSize; + xf86CrtcPtr crtc; drm_intel_bo *front_buffer; dri_bufmgr *bufmgr; @@ -436,6 +437,7 @@ enum { }; extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp); +extern void drmmode_close_screen(intel_screen_private *intel); extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc); extern int drmmode_output_dpms_status(xf86OutputPtr output); extern Bool drmmode_do_pageflip(ScreenPtr screen, dri_bo *new_front, void *data); diff --git a/src/intel_driver.c b/src/intel_driver.c index a69f7c1b..2ced844f 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -1139,6 +1139,8 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen) screen->CloseScreen = intel->CloseScreen; (*screen->CloseScreen) (scrnIndex, screen); + drmmode_close_screen(intel); + if (intel->directRenderingOpen && intel->directRenderingType == DRI_DRI2) { intel->directRenderingOpen = FALSE; |