aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-07-10 15:30:20 +0000
committermarha <marha@users.sourceforge.net>2010-07-10 15:30:20 +0000
commitec013c535cd7057bfdf7d1933cc7478bdb5dba71 (patch)
tree5314d289bf854d1de55269b3ebf0dd1e822e4651 /xorg-server/hw
parentd8d64f070eb8b9d1364b9791c17aa32a21e8eb31 (diff)
parentd2698d30377ded3f817f90cf2f17d9d3cda5a855 (diff)
downloadvcxsrv-ec013c535cd7057bfdf7d1933cc7478bdb5dba71.tar.gz
vcxsrv-ec013c535cd7057bfdf7d1933cc7478bdb5dba71.tar.bz2
vcxsrv-ec013c535cd7057bfdf7d1933cc7478bdb5dba71.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c
index fbed587c2..9bf838e6c 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.c
+++ b/xorg-server/hw/xfree86/dri2/dri2.c
@@ -82,6 +82,7 @@ typedef struct _DRI2Drawable {
CARD64 last_swap_msc; /* msc at completion of most recent swap */
CARD64 last_swap_ust; /* ust at completion of most recent swap */
int swap_limit; /* for N-buffering */
+ unsigned long serialNumber;
} DRI2DrawableRec, *DRI2DrawablePtr;
typedef struct _DRI2Screen {
@@ -130,6 +131,19 @@ DRI2GetDrawable(DrawablePtr pDraw)
}
}
+static unsigned long
+DRI2DrawableSerial(DrawablePtr pDraw)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ PixmapPtr pPix;
+
+ if (pDraw->type != DRAWABLE_WINDOW)
+ return pDraw->serialNumber;
+
+ pPix = pScreen->GetWindowPixmap((WindowPtr)pDraw);
+ return pPix->drawable.serialNumber;
+}
+
static DRI2DrawablePtr
DRI2AllocateDrawable(DrawablePtr pDraw)
{
@@ -163,6 +177,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
pPriv->last_swap_msc = 0;
pPriv->last_swap_ust = 0;
list_init(&pPriv->reference_list);
+ pPriv->serialNumber = DRI2DrawableSerial(pDraw);
if (pDraw->type == DRAWABLE_WINDOW) {
pWin = (WindowPtr) pDraw;
@@ -326,6 +341,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
|| !dimensions_match
|| (pPriv->buffers[old_buf]->format != format)) {
*buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+ pPriv->serialNumber = DRI2DrawableSerial(pDraw);
return TRUE;
} else {
@@ -384,7 +400,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
}
dimensions_match = (pDraw->width == pPriv->width)
- && (pDraw->height == pPriv->height);
+ && (pDraw->height == pPriv->height)
+ && (pPriv->serialNumber == DRI2DrawableSerial(pDraw));
buffers = malloc((count + 1) * sizeof(buffers[0]));