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:
Tomas Carnecky 2012-07-10 02:03:11 +01:00 committed by Keith Packard
parent 7a5880bc3b
commit 60f53e3012
3 changed files with 8 additions and 21 deletions

View File

@ -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,
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 */

View File

@ -93,7 +93,9 @@ static void DGAHandleEvent(int screen_num, InternalEvent *event,
static void
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) \
dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec))
@ -1042,7 +1044,7 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
.u.event.screen = pScreen->myNum,
.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;
/* 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.state = ev.corestate
};
de.u.u.type = *XDGAEventBase + coreEquiv;
de.u.u.type = DGAEventBase + coreEquiv;
de.u.u.detail = event->detail;
/* 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;
/* no DGA */
if (!DGAScreenKeyRegistered || XDGAEventBase == 0)
return;
if (!DGAScreenKeyRegistered || noXFree86DGAExtension)
return;
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
/* DGA not initialized on this screen */
@ -1210,10 +1212,6 @@ static void XDGAResetProc(ExtensionEntry * extEntry);
static void DGAClientStateChange(CallbackListPtr *, pointer, pointer);
unsigned char DGAReqCode = 0;
int DGAErrorBase;
int DGAEventBase;
static DevPrivateKeyRec DGAScreenPrivateKeyRec;
#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec)
@ -2169,12 +2167,6 @@ ProcXDGADispatch(ClientPtr client)
}
}
void
XFree86DGARegister(void)
{
XDGAEventBase = &DGAEventBase;
}
void
XFree86DGAExtensionInit(void)
{

View File

@ -54,7 +54,7 @@ static ExtensionModule extensionModules[] = {
XFree86DGAExtensionInit,
XF86DGANAME,
&noXFree86DGAExtension,
XFree86DGARegister,
NULL,
NULL
},
#endif