summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-29 10:39:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-29 10:39:28 +0100
commit44d45d3fa56f121ce89ffe5b28beb48be01a95df (patch)
treec7acc6c53ce68f035a5960e43807112a66de1c6c
parent90c74a43149ec72bef64fb7e64b812294bda69a5 (diff)
dri: Use size from backing pixmap when creating buffers.
This avoid using the garbage values stored in the Screen drawable, instead of the true values which are only maintained in its backing pixmap. The consequence of using the wrong size was to hand a 1x1 pixmap to metacity/mutter and have it believe it was a full screen drawable; GPU hangs ensued if using page flipping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-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 61abd36f..f7b9018b 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;
+ int i, width, height, depth;
I830DRI2BufferPrivatePtr privates;
PixmapPtr pixmap, pDepthPixmap;
@@ -96,6 +96,11 @@ 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) {
@@ -125,12 +130,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
if (!intel->tiling)
hint = 0;
- pixmap = screen->CreatePixmap(screen,
- drawable->width,
- drawable->height,
- drawable->depth,
- hint);
-
+ pixmap = screen->CreatePixmap(screen, width, height, 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,
- drawable->width,
- drawable->height,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
(format != 0) ? format :
- drawable->depth,
+ pixmap->drawable.depth,
hint);
}