[PATCH 8/8] Clean up radeon_dri2_create_buffer2()

Michel Dänzer michel at daenzer.net
Tue Nov 10 23:16:06 PST 2015


From: Tom St Denis <tom.stdenis at amd.com>

Remove the depth_pixmap variable from the function and clear
out any dead/odd behaviour that results.

Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
(ported from amdgpu commit 6000aef4e2f0a121b94023484406fb6f04688f74)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_dri2.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 466d700..d30bbd0 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -181,7 +181,7 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
     RADEONInfoPtr info = RADEONPTR(pScrn);
     BufferPtr buffers;
     struct dri2_buffer_priv *privates;
-    PixmapPtr pixmap, depth_pixmap;
+    PixmapPtr pixmap;
     int flags;
     unsigned front_width;
     uint32_t tiling = 0;
@@ -209,10 +209,9 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 	cpp = drawable->bitsPerPixel / 8;
     }
 
-    pixmap = pScreen->GetScreenPixmap(pScreen);
-    front_width = pixmap->drawable.width;
+    front_width = pScreen->GetScreenPixmap(pScreen)->drawable.width;
 
-    pixmap = depth_pixmap = NULL;
+    pixmap = NULL;
 
     if (attachment == DRI2BufferFrontLeft) {
 	uint32_t handle;
@@ -227,9 +226,6 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 	    pixmap = NULL;
 	} else
 	    pixmap->refcnt++;
-    } else if (attachment == DRI2BufferStencil && depth_pixmap) {
-        pixmap = depth_pixmap;
-        pixmap->refcnt++;
     }
 
     if (!pixmap && (is_glamor_pixmap || attachment != DRI2BufferFrontLeft)) {
@@ -314,10 +310,6 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
     if (buffers == NULL)
         goto error;
 
-    if (attachment == DRI2BufferDepth) {
-        depth_pixmap = pixmap;
-    }
-
     if (pixmap) {
 	if (!info->use_glamor) {
 	    info->exa_force_create = TRUE;
-- 
2.6.2



More information about the xorg-driver-ati mailing list