diff options
author | Tomas Carnecky <tom@dbservice.com> | 2012-07-10 02:03:11 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-09 23:40:55 -0700 |
commit | 60f53e3012be795eee741ecd4be858552c5e86c8 (patch) | |
tree | 18b75841168f0ee6a4b1af33b96fb3a8e2f43f67 /hw/xfree86/common | |
parent | 7a5880bc3b47e1f90a638f056ad4d40be6931977 (diff) |
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>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r-- | hw/xfree86/common/dgaproc.h | 5 | ||||
-rw-r--r-- | hw/xfree86/common/xf86DGA.c | 22 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Extensions.c | 2 |
3 files changed, 8 insertions, 21 deletions
diff --git a/hw/xfree86/common/dgaproc.h b/hw/xfree86/common/dgaproc.h index 2c2fae097..e824d3094 100644 --- a/hw/xfree86/common/dgaproc.h +++ b/hw/xfree86/common/dgaproc.h @@ -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 */ diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 00b90226b..a441dee99 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -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) @@ -2170,12 +2168,6 @@ ProcXDGADispatch(ClientPtr client) } void -XFree86DGARegister(void) -{ - XDGAEventBase = &DGAEventBase; -} - -void XFree86DGAExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/hw/xfree86/common/xf86Extensions.c b/hw/xfree86/common/xf86Extensions.c index 7a84988d7..5ee6be88f 100644 --- a/hw/xfree86/common/xf86Extensions.c +++ b/hw/xfree86/common/xf86Extensions.c @@ -54,7 +54,7 @@ static ExtensionModule extensionModules[] = { XFree86DGAExtensionInit, XF86DGANAME, &noXFree86DGAExtension, - XFree86DGARegister, + NULL, NULL }, #endif |