dri2: Register the DRI2DrawableType after server regeneration
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 <chris@chris-wilson.co.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
parent
bfa1a0dd19
commit
34b0e4eee9
|
@ -1235,14 +1235,24 @@ DRI2CloseScreen(ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern ExtensionModule dri2ExtensionModule;
|
extern ExtensionModule dri2ExtensionModule;
|
||||||
|
extern Bool DRI2ModuleSetup(void);
|
||||||
|
|
||||||
|
/* Called by InitExtensions() */
|
||||||
|
Bool
|
||||||
|
DRI2ModuleSetup(void)
|
||||||
|
{
|
||||||
|
dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
|
||||||
|
if (!dri2DrawableRes)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static pointer
|
static pointer
|
||||||
DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
|
DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||||
{
|
{
|
||||||
static Bool setupDone = FALSE;
|
static Bool setupDone = FALSE;
|
||||||
|
|
||||||
dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
|
|
||||||
|
|
||||||
if (!setupDone)
|
if (!setupDone)
|
||||||
{
|
{
|
||||||
setupDone = TRUE;
|
setupDone = TRUE;
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static ExtensionEntry *dri2Extension;
|
static ExtensionEntry *dri2Extension;
|
||||||
|
extern Bool DRI2ModuleSetup(void);
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
validDrawable(ClientPtr client, XID drawable, Mask access_mode,
|
validDrawable(ClientPtr client, XID drawable, Mask access_mode,
|
||||||
|
@ -634,6 +635,8 @@ DRI2ExtensionInit(void)
|
||||||
StandardMinorOpcode);
|
StandardMinorOpcode);
|
||||||
|
|
||||||
DRI2EventBase = dri2Extension->eventBase;
|
DRI2EventBase = dri2Extension->eventBase;
|
||||||
|
|
||||||
|
DRI2ModuleSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Bool noDRI2Extension;
|
extern Bool noDRI2Extension;
|
||||||
|
|
Loading…
Reference in New Issue