DGA: Remove excessive module-induced indirection
The DGA event base used to have to be passed through a function pointer, as the code was cleaved in two with half in a module, and half in the core server. Now that's not the case, just access DGAEventBase directly. v2: Deal with Alan's event initialization cleanups Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
7a5880bc3b
commit
60f53e3012
|
@ -107,9 +107,4 @@ extern _X_EXPORT Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode);
|
||||||
extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id,
|
extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id,
|
||||||
int mode, int alloc);
|
int mode, int alloc);
|
||||||
|
|
||||||
extern _X_EXPORT unsigned char DGAReqCode;
|
|
||||||
extern _X_EXPORT int DGAErrorBase;
|
|
||||||
extern _X_EXPORT int DGAEventBase;
|
|
||||||
extern _X_EXPORT int *XDGAEventBase;
|
|
||||||
|
|
||||||
#endif /* __DGAPROC_H */
|
#endif /* __DGAPROC_H */
|
||||||
|
|
|
@ -93,7 +93,9 @@ static void DGAHandleEvent(int screen_num, InternalEvent *event,
|
||||||
static void
|
static void
|
||||||
DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode);
|
DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode);
|
||||||
|
|
||||||
int *XDGAEventBase = NULL;
|
static unsigned char DGAReqCode = 0;
|
||||||
|
static int DGAErrorBase;
|
||||||
|
static int DGAEventBase;
|
||||||
|
|
||||||
#define DGA_GET_SCREEN_PRIV(pScreen) ((DGAScreenPtr) \
|
#define DGA_GET_SCREEN_PRIV(pScreen) ((DGAScreenPtr) \
|
||||||
dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec))
|
dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec))
|
||||||
|
@ -1042,7 +1044,7 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
|
||||||
.u.event.screen = pScreen->myNum,
|
.u.event.screen = pScreen->myNum,
|
||||||
.u.event.state = ev.corestate
|
.u.event.state = ev.corestate
|
||||||
};
|
};
|
||||||
de.u.u.type = *XDGAEventBase + GetCoreType(ev.type);
|
de.u.u.type = DGAEventBase + GetCoreType(ev.type);
|
||||||
de.u.u.detail = event->detail;
|
de.u.u.detail = event->detail;
|
||||||
|
|
||||||
/* If the DGA client has selected input, then deliver based on the usual filter */
|
/* If the DGA client has selected input, then deliver based on the usual filter */
|
||||||
|
@ -1093,7 +1095,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
|
||||||
.u.event.screen = pScreen->myNum,
|
.u.event.screen = pScreen->myNum,
|
||||||
.u.event.state = ev.corestate
|
.u.event.state = ev.corestate
|
||||||
};
|
};
|
||||||
de.u.u.type = *XDGAEventBase + coreEquiv;
|
de.u.u.type = DGAEventBase + coreEquiv;
|
||||||
de.u.u.detail = event->detail;
|
de.u.u.detail = event->detail;
|
||||||
|
|
||||||
/* If the DGA client has selected input, then deliver based on the usual filter */
|
/* If the DGA client has selected input, then deliver based on the usual filter */
|
||||||
|
@ -1180,8 +1182,8 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device)
|
||||||
DGAScreenPtr pScreenPriv;
|
DGAScreenPtr pScreenPriv;
|
||||||
|
|
||||||
/* no DGA */
|
/* no DGA */
|
||||||
if (!DGAScreenKeyRegistered || XDGAEventBase == 0)
|
if (!DGAScreenKeyRegistered || noXFree86DGAExtension)
|
||||||
return;
|
return;
|
||||||
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
/* DGA not initialized on this screen */
|
/* DGA not initialized on this screen */
|
||||||
|
@ -1210,10 +1212,6 @@ static void XDGAResetProc(ExtensionEntry * extEntry);
|
||||||
|
|
||||||
static void DGAClientStateChange(CallbackListPtr *, pointer, pointer);
|
static void DGAClientStateChange(CallbackListPtr *, pointer, pointer);
|
||||||
|
|
||||||
unsigned char DGAReqCode = 0;
|
|
||||||
int DGAErrorBase;
|
|
||||||
int DGAEventBase;
|
|
||||||
|
|
||||||
static DevPrivateKeyRec DGAScreenPrivateKeyRec;
|
static DevPrivateKeyRec DGAScreenPrivateKeyRec;
|
||||||
|
|
||||||
#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec)
|
#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec)
|
||||||
|
@ -2169,12 +2167,6 @@ ProcXDGADispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
XFree86DGARegister(void)
|
|
||||||
{
|
|
||||||
XDGAEventBase = &DGAEventBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XFree86DGAExtensionInit(void)
|
XFree86DGAExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@ static ExtensionModule extensionModules[] = {
|
||||||
XFree86DGAExtensionInit,
|
XFree86DGAExtensionInit,
|
||||||
XF86DGANAME,
|
XF86DGANAME,
|
||||||
&noXFree86DGAExtension,
|
&noXFree86DGAExtension,
|
||||||
XFree86DGARegister,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user