xf86-video-intel: src/i830_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Sat May 29 04:16:33 PDT 2010


 src/i830_dri.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 8b2039187fc23f5e9dddf4081f8b1ab6f4c01416
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat May 29 12:14:55 2010 +0100

    Revert "dri: Use size from backing pixmap when creating buffers."
    
    This reverts commit 44d45d3fa56f121ce89ffe5b28beb48be01a95df.
    
    Michel Dänzer pointed out the flaw in using the pixmap size instead of
    the drawable size:
    
      Using the backing pixmap dimensions for this is not desirable. In
      particular, it means that the DRI2 buffers of non-redirected windows
      always have the same size as the screen. But even for redirected windows
      it wastes some graphics memory with a re-parenting window manager, that
      is if it doesn't break in various ways due to the top left corner of the
      DRI2 buffers no longer corresponding to the top left corner of the window.

diff --git a/src/i830_dri.c b/src/i830_dri.c
index f7b9018..61abd36 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -83,7 +83,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	DRI2BufferPtr buffers;
 	dri_bo *bo;
-	int i, width, height, depth;
+	int i;
 	I830DRI2BufferPrivatePtr privates;
 	PixmapPtr pixmap, pDepthPixmap;
 
@@ -96,11 +96,6 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 		return NULL;
 	}
 
-	pixmap = get_drawable_pixmap(drawable);
-	width = pixmap->drawable.width;
-	height = pixmap->drawable.height;
-	depth = pixmap->drawable.depth;
-
 	pDepthPixmap = NULL;
 	for (i = 0; i < count; i++) {
 		if (attachments[i] == DRI2BufferFrontLeft) {
@@ -130,7 +125,12 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 			if (!intel->tiling)
 				hint = 0;
 
-			pixmap = screen->CreatePixmap(screen, width, height, depth, hint);
+			pixmap = screen->CreatePixmap(screen,
+						      drawable->width,
+						      drawable->height,
+						      drawable->depth,
+						      hint);
+
 		}
 
 		if (attachments[i] == DRI2BufferDepth)
@@ -196,8 +196,8 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 		return NULL;
 	}
 
-	pixmap = get_drawable_pixmap(drawable);
 	if (attachment == DRI2BufferFrontLeft) {
+		pixmap = get_drawable_pixmap(drawable);
 		pixmap->refcnt++;
 	} else {
 		unsigned int hint = 0;
@@ -222,10 +222,10 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 			hint = 0;
 
 		pixmap = screen->CreatePixmap(screen,
-					      pixmap->drawable.width,
-					      pixmap->drawable.height,
+					      drawable->width,
+					      drawable->height,
 					      (format != 0) ? format :
-							      pixmap->drawable.depth,
+							      drawable->depth,
 					      hint);
 
 	}


More information about the xorg-commit mailing list