[PATCH xf86-video-amdgpu] Remove AMDGPUInfoRec::fbcon_pixmap

Michel Dänzer michel at daenzer.net
Thu Jul 19 15:01:23 UTC 2018


From: Michel Dänzer <michel.daenzer at amd.com>

We always destroy the fbcon pixmap in drmmode_copy_fb anyway.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_drv.h      |  1 -
 src/amdgpu_kms.c      |  3 ---
 src/drmmode_display.c | 13 ++-----------
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 8a77b05fd..45bc394aa 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -264,7 +264,6 @@ typedef struct {
 	struct amdgpu_dri2 dri2;
 
 	/* accel */
-	PixmapPtr fbcon_pixmap;
 	int callback_event_type;
 	uint_fast32_t gpu_flushed;
 	uint_fast32_t gpu_synced;
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 39e047e29..c22b7975c 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -125,9 +125,6 @@ static void AMDGPUFreeRec(ScrnInfoPtr pScrn)
 
 	info = AMDGPUPTR(pScrn);
 	if (info) {
-		if (info->fbcon_pixmap)
-			pScrn->pScreen->DestroyPixmap(info->fbcon_pixmap);
-
 		pEnt = info->pEnt;
 		free(pScrn->driverPrivate);
 		pScrn->driverPrivate = NULL;
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8407a4577..aa4915933 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -357,13 +357,9 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
 {
 	ScreenPtr pScreen = pScrn->pScreen;
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
-	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
-	PixmapPtr pixmap = info->fbcon_pixmap;
+	PixmapPtr pixmap = NULL;
 	drmModeFBPtr fbcon;
 
-	if (pixmap)
-		return pixmap;
-
 	fbcon = drmModeGetFB(pAMDGPUEnt->fd, fbcon_id);
 	if (!fbcon)
 		return NULL;
@@ -387,7 +383,6 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
 		pixmap = NULL;
 	}
 
-	info->fbcon_pixmap = pixmap;
 out_free_fb:
 	drmModeFreeFB(fbcon);
 	return pixmap;
@@ -396,7 +391,6 @@ out_free_fb:
 void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 {
 	xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
 	ScreenPtr pScreen = pScrn->pScreen;
 	PixmapPtr src, dst = pScreen->GetScreenPixmap(pScreen);
 	struct drmmode_fb *fb = amdgpu_pixmap_get_fb(dst);
@@ -436,10 +430,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	FreeScratchGC(gc);
 
 	pScreen->canDoBGNoneRoot = TRUE;
-
-	if (info->fbcon_pixmap)
-		pScrn->pScreen->DestroyPixmap(info->fbcon_pixmap);
-	info->fbcon_pixmap = NULL;
+	pScreen->DestroyPixmap(src);
 
 	return;
 }
-- 
2.18.0



More information about the amd-gfx mailing list