diff options
author | Tomas Carnecky <tom@dbservice.com> | 2012-07-10 02:03:08 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-09 23:28:37 -0700 |
commit | 5d92ee4081a23a6b4d1f9ba2a98985f539f99312 (patch) | |
tree | 680b217768541a0b7a67af9679bc5f11f385618b | |
parent | 2e6c5f959153cdcea4bcf719621ebec408250f54 (diff) |
Xv: Remove excessive module-induced indirection
Xv used to call XvScreenInit and co. through function pointers, as
XvScreenInit may have been sitting on the other side of a module
boundary from xf86XvScreenInit. Why this was so is a mystery, but make
it not so any more.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Acked-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>
-rw-r--r-- | Xext/xvdix.h | 4 | ||||
-rw-r--r-- | Xext/xvmain.c | 12 | ||||
-rw-r--r-- | Xext/xvmc.c | 6 | ||||
-rw-r--r-- | hw/kdrive/src/kxv.c | 8 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.c | 9 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xvmc.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xvmc.h | 3 | ||||
-rw-r--r-- | include/extinit.h | 2 | ||||
-rw-r--r-- | mi/miinitext.c | 4 |
9 files changed, 12 insertions, 40 deletions
diff --git a/Xext/xvdix.h b/Xext/xvdix.h index fc8eb0f35..9c6160c3b 100644 --- a/Xext/xvdix.h +++ b/Xext/xvdix.h @@ -70,10 +70,6 @@ extern _X_EXPORT RESTYPE XvRTVideoNotify; extern _X_EXPORT RESTYPE XvRTVideoNotifyList; extern _X_EXPORT RESTYPE XvRTPortNotify; -extern DevPrivateKey (*XvGetScreenKeyProc)(void); -extern unsigned long (*XvGetRTPortProc)(void); -extern int (*XvScreenInitProc)(ScreenPtr); - typedef struct { int numerator; int denominator; diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 77c4156de..c2860b86a 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -194,18 +194,6 @@ XvExtensionInit(void) } } -DevPrivateKey (*XvGetScreenKeyProc)(void) = NULL; -unsigned long (*XvGetRTPortProc)(void) = NULL; -int (*XvScreenInitProc)(ScreenPtr) = NULL; - -void -XvRegister(void) -{ - XvScreenInitProc = XvScreenInit; - XvGetScreenKeyProc = XvGetScreenKey; - XvGetRTPortProc = XvGetRTPort; -} - static Bool CreateResourceTypes(void) { diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 910adf48b..ad7956bad 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -764,12 +764,6 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) return Success; } -void -XvMCRegister(void) -{ - XvMCScreenInitProc = XvMCScreenInit; -} - XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id) { diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index b7afb2efb..cf656363d 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -182,17 +182,17 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) if (KdXVGeneration != serverGeneration) KdXVGeneration = serverGeneration; - if (!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc) + if (noXvExtension) return FALSE; if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; - if (Success != (*XvScreenInitProc) (pScreen)) + if (Success != XvScreenInit(pScreen)) return FALSE; - KdXvScreenKey = (*XvGetScreenKeyProc) (); - PortResource = (*XvGetRTPortProc) (); + KdXvScreenKey = XvGetScreenKey(); + PortResource = XvGetRTPort(); pxvs = GET_XV_SCREEN(pScreen); diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 0e50f378f..92d0f6da2 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -234,19 +234,18 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) XF86XVScreenPtr ScreenPriv; XvScreenPtr pxvs; - if (num <= 0 || - !XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc) + if (num <= 0 || noXvExtension) return FALSE; - if (Success != (*XvScreenInitProc) (pScreen)) + if (Success != XvScreenInit(pScreen)) return FALSE; if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; - XF86XvScreenKey = (*XvGetScreenKeyProc) (); + XF86XvScreenKey = XvGetScreenKey(); - PortResource = (*XvGetRTPortProc) (); + PortResource = XvGetRTPort(); pxvs = GET_XV_SCREEN(pScreen); diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c index dc6b3956a..78a32bfe1 100644 --- a/hw/xfree86/common/xf86xvmc.c +++ b/hw/xfree86/common/xf86xvmc.c @@ -152,7 +152,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen, XF86XvScreenKey); int i, j; - if (!XvMCScreenInitProc) + if (noXvExtension) return FALSE; if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors))) @@ -201,7 +201,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen, adaptors++; } - if (Success != (*XvMCScreenInitProc) (pScreen, num_adaptors, pAdapt)) + if (Success != XvMCScreenInit(pScreen, num_adaptors, pAdapt)) return FALSE; return TRUE; diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h index ff32379fe..2478fe344 100644 --- a/hw/xfree86/common/xf86xvmc.h +++ b/hw/xfree86/common/xf86xvmc.h @@ -138,7 +138,4 @@ extern _X_EXPORT Bool xf86XvMCScreenInit(ScreenPtr pScreen, extern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void); extern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor); -typedef int (*XvMCScreenInitProcPtr) (ScreenPtr, int, XvMCAdaptorPtr); -extern _X_EXPORT XvMCScreenInitProcPtr XvMCScreenInitProc; - #endif /* _XF86XVMC_H */ diff --git a/include/extinit.h b/include/extinit.h index a8c253914..ea41eba14 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -181,8 +181,6 @@ extern void PseudoramiXExtensionInit(void); extern Bool noXvExtension; extern void XvExtensionInit(void); extern void XvMCExtensionInit(void); -extern void XvRegister(void); -extern void XvMCRegister(void); #endif #endif diff --git a/mi/miinitext.c b/mi/miinitext.c index a83df609d..74fb223fb 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -413,8 +413,8 @@ static ExtensionModule staticExtensions[] = { {ResExtensionInit, XRES_NAME, &noResExtension, NULL}, #endif #ifdef XV - {XvExtensionInit, XvName, &noXvExtension, XvRegister}, - {XvMCExtensionInit, XvMCName, &noXvExtension, XvMCRegister}, + {XvExtensionInit, XvName, &noXvExtension, NULL}, + {XvMCExtensionInit, XvMCName, &noXvExtension, NULL}, #endif }; |