The Resource database is reset upon regeneration and so the dri2 module needs to re-register its RESTYPE for the drawable or else it will clobber the next unsuspecting user of the database. Fortunately, DRI2 is loaded late in the initialisation sequence and was last up until xf86-video-intel started using the Resource database to track outstanding swaps...
Signed-off-by: Chris Wilson <[email protected]> --- hw/xfree86/dri2/dri2.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 561237d..535078a 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -1102,6 +1102,7 @@ DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPixmap) Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) { + static int dri2_server_generation; DRI2ScreenPtr ds; const char* driverTypeNames[] = { "DRI", /* DRI2DriverDRI */ @@ -1119,6 +1120,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) return FALSE; } + if (serverGeneration != dri2_server_generation) { + dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable"); + if (!dri2DrawableRes) + return FALSE; + + dri2_server_generation = serverGeneration; + } + if (!dixRegisterPrivateKey(&dri2ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; @@ -1227,8 +1236,6 @@ DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; - dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable"); - if (!setupDone) { setupDone = TRUE; -- 1.7.5.4 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
