summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-29 12:14:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-29 12:14:55 +0100
commit8b2039187fc23f5e9dddf4081f8b1ab6f4c01416 (patch)
treed6bcc70c4347fcba578e7722b494cb07cf286000
parent44d45d3fa56f121ce89ffe5b28beb48be01a95df (diff)
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.
-rw-r--r--src/i830_dri.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index f7b9018b..61abd36f 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);
}