From abd923dfb2fc3d0e4cdc772112d08802562950c8 Mon Sep 17 00:00:00 2001 From: Madhurkiran Harikrishnan Date: Tue, 14 Apr 2020 21:59:28 -0700 Subject: xf86-video-armsoc: Bypass the exa layer to free the root pixmap Since the root pixmap was allocated through miCreateScreenResources, the exa layer is not aware of the pixmap resulting in the assertion to fail. This patch fixes this. Signed-off-by: Madhurkiran Harikrishnan Signed-off-by: Sai Hari Chandana Kalluri --- ...er.c-Bypass-the-exa-layer-to-free-the-roo.patch | 33 ++++++++++++++++++++++ .../xorg-driver/xf86-video-armsoc_%.bbappend | 4 ++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch new file mode 100644 index 00000000..2e024794 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch @@ -0,0 +1,33 @@ +From 497de8b16265468cacad880f4a371756924ae0c1 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 14 Apr 2020 15:25:13 -0700 +Subject: [xf86-video-armsoc][PATCH v2] armsoc_driver.c: Bypass the exa layer + to free the root pixmap + +Since the root pixmap was allocated through miCreateScreenResources, +the exa layer is not aware of the pixmap resulting in the assertion +to fail. Instead, we can directly invoke fbDestroyPixmap, thereby +freeing the pixmap and avoiding a memory leak. + +Signed-off-by: Madhurkiran Harikrishnan +--- + src/armsoc_driver.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c +index 3ace3c7..a4a1ba3 100644 +--- a/src/armsoc_driver.c ++++ b/src/armsoc_driver.c +@@ -1259,7 +1259,8 @@ ARMSOCCloseScreen(CLOSE_SCREEN_ARGS_DECL) + * 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); ++ fbDestroyPixmap (pScreen->devPrivate); ++ armsoc_bo_unreference(pARMSOC->scanout); + pScreen->devPrivate = NULL; + } + +-- +2.7.4 + diff --git a/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend index 3ddcf0b8..955398a3 100644 --- a/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend +++ b/meta-xilinx-bsp/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend @@ -1,3 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/xf86-video-armsoc:" -SRC_URI_append = " file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch" +SRC_URI_append = " file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch \ + file://0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch \ + " -- cgit v1.2.3-54-g00ecf