summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-10-21 11:19:36 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2011-10-26 13:19:32 +0200
commita33710b0d16c9c01a1995b60f0b0d4d482f459d3 (patch)
treee645bfe6245ddcf0d8e78f63830c3127eaa96d66
parent5c43481aa639053bbbf7fbf5f72f0edecf616731 (diff)
vmwgfx: Save the dri2 requested depth since it may differ from the drawable
depth. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--vmwgfx/vmwgfx_dri2.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
index 5cffc4d..b3fb1e8 100644
--- a/vmwgfx/vmwgfx_dri2.c
+++ b/vmwgfx/vmwgfx_dri2.c
@@ -48,6 +48,7 @@ typedef struct {
int refcount;
PixmapPtr pPixmap;
struct xa_surface *srf;
+ unsigned int dri2_depth;
} *BufferPrivatePtr;
@@ -114,6 +115,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
return FALSE;
private->pPixmap = pPixmap;
+ private->dri2_depth = depth;
vpix = vmwgfx_saa_pixmap(pPixmap);
}
break;
@@ -127,6 +129,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
buffer->flags = 0; /* not tiled */
buffer->format = pDraw->bitsPerPixel;
if (!private->pPixmap) {
+ private->dri2_depth = 0;
private->pPixmap = pPixmap;
pPixmap->refcnt++;
}
@@ -146,6 +149,8 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
if (!srf)
return FALSE;
+ private->dri2_depth = depth;
+
break;
case DRI2BufferDepth:
depth = (format) ? vmwgfx_z_format_to_depth(format) :
@@ -156,6 +161,9 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
XA_FLAG_SHARED);
if (!srf)
return FALSE;
+
+ private->dri2_depth = depth;
+
break;
}
@@ -179,6 +187,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
vpix->hw_is_dri2_fronts++;
private->refcount++;
+ private->dri2_depth = depth;
}
private->srf = srf;
@@ -303,8 +312,9 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
/* pixmap glXWaitX */
if (pSrcBuffer->attachment == DRI2BufferFrontLeft &&
pDestBuffer->attachment == DRI2BufferFakeFrontLeft) {
-
- if (!vmwgfx_hw_dri2_validate(src_priv->pPixmap, 0))
+
+ if (!vmwgfx_hw_dri2_validate(dst_priv->pPixmap,
+ dst_priv->dri2_depth))
return;
}
/* pixmap glXWaitGL */