diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index f9ba8e7..e1238a5 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/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 { @@ -163,6 +164,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw) pPriv->last_swap_msc = 0; pPriv->last_swap_ust = 0; list_init(&pPriv->reference_list); + pPriv->serialNumber = pDraw->serialNumber; if (pDraw->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDraw; @@ -326,6 +328,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 = pDraw->serialNumber; return TRUE; } else { @@ -384,7 +387,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, } dimensions_match = (pDraw->width == pPriv->width) - && (pDraw->height == pPriv->height); + && (pDraw->height == pPriv->height) + && (pDraw->serialNumber == pPriv->serialNumber); buffers = malloc((count + 1) * sizeof(buffers[0]));