[PATCH 22/54] Move Xv and XvMC from extmod to built-in

Daniel Stone daniel at fooishbar.org
Mon Jul 9 18:03:06 PDT 2012


From: Tomas Carnecky <tom at dbservice.com>

Always build these extensions into the core server, rather than letting
them languish in extmod.

Signed-off-by: Tomas Carnecky <tom at dbservice.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Jamey Sharp <jamey at minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xext/Makefile.am                      |    2 +-
 Xext/xvdix.h                          |    9 ++++-----
 Xext/xvmain.c                         |   12 ++++++++++++
 Xext/xvmc.c                           |    8 ++++++++
 Xext/xvmcext.h                        |    4 ++--
 hw/kdrive/src/kxv.c                   |    4 ----
 hw/xfree86/common/xf86xv.c            |    4 ----
 hw/xfree86/common/xf86xv.h            |    4 ----
 hw/xfree86/common/xf86xvmc.c          |    2 --
 hw/xfree86/dixmods/extmod/Makefile.am |    7 +------
 hw/xfree86/dixmods/extmod/modinit.c   |   14 --------------
 hw/xfree86/dixmods/extmod/xvmod.c     |   22 ----------------------
 hw/xfree86/dixmods/extmod/xvmodproc.h |   17 -----------------
 hw/xfree86/sdksyms.sh                 |    2 --
 include/extinit.h                     |    3 ++-
 mi/miinitext.c                        |    4 ++++
 16 files changed, 34 insertions(+), 84 deletions(-)
 delete mode 100644 hw/xfree86/dixmods/extmod/xvmod.c
 delete mode 100644 hw/xfree86/dixmods/extmod/xvmodproc.h

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 5837be0..98e9917 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -46,7 +46,7 @@ endif
 # XVideo extension
 XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h
 if XV
-MODULE_SRCS  += $(XV_SRCS)
+BUILTIN_SRCS  += $(XV_SRCS)
 endif
 
 # XResource extension: lets clients get data about per-client resource usage
diff --git a/Xext/xvdix.h b/Xext/xvdix.h
index fdf33d3..fc8eb0f 100644
--- a/Xext/xvdix.h
+++ b/Xext/xvdix.h
@@ -55,7 +55,6 @@ SOFTWARE.
 #include "scrnintstr.h"
 #include <X11/extensions/Xvproto.h>
 
-#ifndef XorgLoader
 extern _X_EXPORT unsigned long XvExtensionGeneration;
 extern _X_EXPORT unsigned long XvScreenGeneration;
 extern _X_EXPORT unsigned long XvResourceGeneration;
@@ -70,7 +69,10 @@ extern _X_EXPORT RESTYPE XvRTGrab;
 extern _X_EXPORT RESTYPE XvRTVideoNotify;
 extern _X_EXPORT RESTYPE XvRTVideoNotifyList;
 extern _X_EXPORT RESTYPE XvRTPortNotify;
-#endif
+
+extern DevPrivateKey (*XvGetScreenKeyProc)(void);
+extern unsigned long (*XvGetRTPortProc)(void);
+extern int (*XvScreenInitProc)(ScreenPtr);
 
 typedef struct {
     int numerator;
@@ -231,7 +233,6 @@ typedef struct {
 #define _XvBadPort (XvBadPort+XvErrorBase)
 #define _XvBadEncoding (XvBadEncoding+XvErrorBase)
 
-#ifndef XorgLoader
 extern _X_EXPORT int ProcXvDispatch(ClientPtr);
 extern _X_EXPORT int SProcXvDispatch(ClientPtr);
 
@@ -267,6 +268,4 @@ extern _X_EXPORT int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr);
 extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr);
 extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
 extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time);
-#endif                          /* XorgLoader */
-
 #endif                          /* XVDIX_H */
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index d54da1e..bf0cd5c 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -194,6 +194,18 @@ 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 b0fec80..d022817 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -46,6 +46,8 @@ static RESTYPE XvMCRTContext;
 static RESTYPE XvMCRTSurface;
 static RESTYPE XvMCRTSubpicture;
 
+int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
+
 typedef struct {
     int num_adaptors;
     XvMCAdaptorPtr adaptors;
@@ -750,6 +752,12 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
     return Success;
 }
 
+void
+XvMCRegister(void)
+{
+    XvMCScreenInitProc = XvMCScreenInit;
+}
+
 XvImagePtr
 XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
 {
diff --git a/Xext/xvmcext.h b/Xext/xvmcext.h
index d78171d..2201d7b 100644
--- a/Xext/xvmcext.h
+++ b/Xext/xvmcext.h
@@ -84,7 +84,8 @@ typedef struct {
     XvMCDestroySubpictureProcPtr DestroySubpicture;
 } XvMCAdaptorRec, *XvMCAdaptorPtr;
 
-#ifndef XorgLoader
+extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
+
 extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
                                     int num, XvMCAdaptorPtr adapt);
 
@@ -93,6 +94,5 @@ extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
 extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
                                             char *busID, int major, int minor,
                                             int patchLevel);
-#endif
 
 #endif                          /* _XVMC_H */
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index b02dd88..b7afb2e 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -107,10 +107,6 @@ static DevPrivateKey KdXvScreenKey;
 static unsigned long KdXVGeneration = 0;
 static unsigned long PortResource = 0;
 
-DevPrivateKey (*XvGetScreenKeyProc) (void) = XvGetScreenKey;
-unsigned long (*XvGetRTPortProc) (void) = XvGetRTPort;
-int (*XvScreenInitProc) (ScreenPtr) = XvScreenInit;
-
 #define GET_XV_SCREEN(pScreen) ((XvScreenPtr) \
     dixLookupPrivate(&(pScreen)->devPrivates, KdXvScreenKey))
 
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 1a964d2..0e50f37 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -117,10 +117,6 @@ DevPrivateKey XF86XvScreenKey;
 
 static unsigned long PortResource = 0;
 
-DevPrivateKey (*XvGetScreenKeyProc) (void) = NULL;
-unsigned long (*XvGetRTPortProc) (void) = NULL;
-int (*XvScreenInitProc) (ScreenPtr) = NULL;
-
 #define GET_XV_SCREEN(pScreen) \
     ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey))
 
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
index 2db00a8..091efca 100644
--- a/hw/xfree86/common/xf86xv.h
+++ b/hw/xfree86/common/xf86xv.h
@@ -263,8 +263,4 @@ extern _X_EXPORT void
 xf86XVCopyPacked(const void *src,
                  void *dst, int srcPitch, int dstPitch, int h, int w);
 
-extern _X_EXPORT DevPrivateKey (*XvGetScreenKeyProc) (void);
-extern _X_EXPORT unsigned long (*XvGetRTPortProc) (void);
-extern _X_EXPORT int (*XvScreenInitProc) (ScreenPtr);
-
 #endif                          /* _XF86XV_H_ */
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index 2e529dd..dc6b395 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -43,8 +43,6 @@
 #include "xf86xvpriv.h"
 #include "xf86xvmc.h"
 
-XvMCScreenInitProcPtr XvMCScreenInitProc = NULL;
-
 typedef struct {
     CloseScreenProcPtr CloseScreen;
     int num_adaptors;
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
index cdbd82e..8436cb3 100644
--- a/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/hw/xfree86/dixmods/extmod/Makefile.am
@@ -7,10 +7,6 @@ if DGA
 DGA_SRCS = xf86dga2.c dgaproc.h
 endif
 
-if XV
-XV_SRCS = xvmod.c xvmodproc.h
-endif
-
 if XF86VIDMODE
 XF86VMODE_SRCS = xf86vmode.c
 endif
@@ -24,6 +20,5 @@ INCLUDES = @XORG_INCS@ \
 libextmod_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libextmod_la_SOURCES = modinit.c \
                        $(DGA_SRCS) \
-                       $(XF86VMODE_SRCS) \
-                       $(XV_SRCS)
+                       $(XF86VMODE_SRCS)
 libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index 3c69332..f8832fd 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -63,20 +63,6 @@ static ExtensionModule extensionModules[] = {
      XFree86DGARegister,
      NULL},
 #endif
-#ifdef XV
-    {
-     XvExtensionInit,
-     XvName,
-     &noXvExtension,
-     XvRegister,
-     NULL},
-    {
-     XvMCExtensionInit,
-     XvMCName,
-     &noXvExtension,
-     NULL,
-     NULL},
-#endif
 };
 
 static XF86ModuleVersionInfo VersRec = {
diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c
deleted file mode 100644
index 97616c7..0000000
--- a/hw/xfree86/dixmods/extmod/xvmod.c
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "misc.h"
-#include "scrnintstr.h"
-#include "gc.h"
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/Xvproto.h>
-#include "xvdix.h"
-#include "xvmodproc.h"
-
-void
-XvRegister(void)
-{
-    XvScreenInitProc = XvScreenInit;
-    XvGetScreenKeyProc = XvGetScreenKey;
-    XvGetRTPortProc = XvGetRTPort;
-    XvMCScreenInitProc = XvMCScreenInit;
-}
diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h
deleted file mode 100644
index 0090547..0000000
--- a/hw/xfree86/dixmods/extmod/xvmodproc.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef XVMODPROC_H
-#define XVMODPROC_H
-#include "xvmcext.h"
-
-extern DevPrivateKey (*XvGetScreenKeyProc) (void);
-extern unsigned long (*XvGetRTPortProc) (void);
-extern int (*XvScreenInitProc) (ScreenPtr);
-extern int (*XvMCScreenInitProc) (ScreenPtr, int, XvMCAdaptorPtr);
-
-extern void XvRegister(void);
-
-#endif /* XVMODPROC_H */
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index ab48fcf..6d8a4d3 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -46,10 +46,8 @@ cat > sdksyms.c << EOF
 #include "misyncstr.h"
 
 /* Xext/Makefile.am -- half is module, half is builtin */
-/*
 #include "xvdix.h"
 #include "xvmcext.h"
- */
 #include "geext.h"
 #include "geint.h"
 #ifdef MITSHM
diff --git a/include/extinit.h b/include/extinit.h
index 589db1f..a8c2539 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -175,13 +175,14 @@ extern Bool noPseudoramiXExtension;
 extern void PseudoramiXExtensionInit(void);
 #endif
 
-#if defined(XV) && !defined(XorgLoader)
+#if defined(XV)
 #include <X11/extensions/Xv.h>
 #include <X11/extensions/XvMC.h>
 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 2a54a1b..01ea7ad 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -412,6 +412,10 @@ static ExtensionModule staticExtensions[] = {
 #ifdef RES
     {ResExtensionInit, XRES_NAME, &noResExtension, NULL},
 #endif
+#ifdef XV
+    {XvExtensionInit, XvName, &noXvExtension, XvRegister},
+    {XvMCExtensionInit, XvMCName, &noXvExtension, XvMCRegister},
+#endif
 };
 
  /*ARGSUSED*/ void
-- 
1.7.10.4



More information about the xorg-devel mailing list