aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Barnish <dave.barnish@arm.com>2013-11-14 08:52:10 +0000
committerDave Barnish <dave.barnish@arm.com>2013-11-21 16:10:25 +0000
commitcaed3a1952bb92723aa61c361f4f57709fef740f (patch)
tree2dd43e0b412df425f3f6699f763697393391d5e5
parent3be1f6273441fe95dd442f44064387322e16b7e9 (diff)
downloadxf86-video-armsoc-caed3a1952bb92723aa61c361f4f57709fef740f.tar.gz
Fix leaks in ARMSOCCloseScreen
Call the hardware cursor cleanup on close screen. Destroy the root pixmap in close screen (based on a change in https://chromium-review.googlesource.com/#/c/167860/1) Change-Id: I20987c9772bc5a3d9f44e976e57160ae428ec728
-rw-r--r--src/armsoc_driver.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c
index 4fa87cc..fb995a5 100644
--- a/src/armsoc_driver.c
+++ b/src/armsoc_driver.c
@@ -1218,6 +1218,17 @@ ARMSOCCloseScreen(CLOSE_SCREEN_ARGS_DECL)
TRACE_ENTER();
drmmode_screen_fini(pScrn);
+ drmmode_cursor_fini(pScreen);
+
+ /* pScreen->devPrivate holds the root pixmap created around our bo by miCreateResources which is installed
+ * by fbScreenInit() when called from ARMSOCScreenInit().
+ * This pixmap should be destroyed in miScreenClose() but this isn't wrapped by fbScreenInit() so to prevent a leak
+ * we do it here, before calling the CloseScreen chain which would just free pScreen->devPrivate in fbCloseScreen()
+ */
+ if (pScreen->devPrivate) {
+ (void) (*pScreen->DestroyPixmap)(pScreen->devPrivate);
+ pScreen->devPrivate = NULL;
+ }
unwrap(pARMSOC, pScreen, CloseScreen);
unwrap(pARMSOC, pScreen, BlockHandler);
@@ -1232,9 +1243,9 @@ ARMSOCCloseScreen(CLOSE_SCREEN_ARGS_DECL)
if (pARMSOC->pARMSOCEXA->CloseScreen)
pARMSOC->pARMSOCEXA->CloseScreen(CLOSE_SCREEN_ARGS);
- /* release the scanout buffer */
- armsoc_bo_unreference(pARMSOC->scanout);
+ /* scanout buffer is released when root pixmap is destroyed */
pARMSOC->scanout = NULL;
+
pScrn->displayWidth = 0;
if (pScrn->vtSema == TRUE)