[PATCH 13/37] Move Xv and XvMC from extmod to built-in
Daniel Stone
daniel at fooishbar.org
Tue Jun 28 12:27:29 PDT 2011
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>
---
Xext/Makefile.am | 2 +-
Xext/xvdix.h | 9 +++++++--
Xext/xvmain.c | 15 +++++++++++++++
Xext/xvmcext.h | 5 +----
hw/kdrive/src/kxv.c | 4 ----
hw/xfree86/common/xf86xv.c | 5 -----
hw/xfree86/common/xf86xv.h | 4 ----
hw/xfree86/common/xf86xvmc.c | 5 -----
hw/xfree86/dixmods/extmod/Makefile.am | 7 +------
hw/xfree86/dixmods/extmod/modinit.c | 16 ----------------
hw/xfree86/dixmods/extmod/xvmod.c | 23 -----------------------
hw/xfree86/dixmods/extmod/xvmodproc.h | 13 -------------
hw/xfree86/sdksyms.sh | 4 +---
mi/miinitext.c | 9 +++++++++
14 files changed, 35 insertions(+), 86 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 04e1b36..acbcc17 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 e9c22bf..fc35935 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,12 @@ 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 _XvMCAdaptor *XvMCAdaptorPtr;
+extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
typedef struct {
int numerator;
@@ -269,6 +273,7 @@ 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);
+extern void XvRegister(void);
#endif /* XorgLoader */
#endif /* XVDIX_H */
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index d21a56c..c86f911 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -199,6 +199,21 @@ XvExtensionInit(void)
}
}
+DevPrivateKey (*XvGetScreenKeyProc)(void) = NULL;
+unsigned long (*XvGetRTPortProc)(void) = NULL;
+int (*XvScreenInitProc)(ScreenPtr) = NULL;
+int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
+extern int XvMCScreenInit(ScreenPtr, int, XvMCAdaptorPtr);
+
+void
+XvRegister(void)
+{
+ XvScreenInitProc = XvScreenInit;
+ XvGetScreenKeyProc = XvGetScreenKey;
+ XvGetRTPortProc = XvGetRTPort;
+ XvMCScreenInitProc = XvMCScreenInit;
+}
+
static Bool
CreateResourceTypes(void)
diff --git a/Xext/xvmcext.h b/Xext/xvmcext.h
index 5b43126..b6c7749 100644
--- a/Xext/xvmcext.h
+++ b/Xext/xvmcext.h
@@ -87,7 +87,7 @@ typedef void (*XvMCDestroySubpictureProcPtr) (
);
-typedef struct {
+typedef struct _XvMCAdaptor {
XvAdaptorPtr xv_adaptor;
int num_surfaces;
XvMCSurfaceInfoPtr *surfaces;
@@ -101,7 +101,6 @@ typedef struct {
XvMCDestroySubpictureProcPtr DestroySubpicture;
} XvMCAdaptorRec, *XvMCAdaptorPtr;
-#ifndef XorgLoader
extern _X_EXPORT void XvMCExtensionInit(void);
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
@@ -113,6 +112,4 @@ 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 50dc235..5162ea1 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -109,10 +109,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 b46dfef..50b6be5 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -52,7 +52,6 @@
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvproto.h>
#include "xvdix.h"
-#include "xvmodproc.h"
#include "xf86xvpriv.h"
@@ -121,10 +120,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 f0d8495..a8401ca 100644
--- a/hw/xfree86/common/xf86xv.h
+++ b/hw/xfree86/common/xf86xv.h
@@ -282,8 +282,4 @@ xf86XVCopyPacked(
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 e6464a5..da64d1e 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -40,14 +40,9 @@
#include "resource.h"
#include "dixstruct.h"
-#include "xvmodproc.h"
-
#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 cce19f7..7ef1e7e 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
@@ -25,6 +21,5 @@ libextmod_la_LDFLAGS = -avoid-version
libextmod_la_SOURCES = modinit.c \
modinit.h \
$(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 9a3b811..3dfacf1 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -65,22 +65,6 @@ static ExtensionModule extensionModules[] = {
NULL
},
#endif
-#ifdef XV
- {
- XvExtensionInit,
- XvName,
- &noXvExtension,
- XvRegister,
- NULL
- },
- {
- XvMCExtensionInit,
- XvMCName,
- &noXvExtension,
- NULL,
- NULL
- },
-#endif
{ /* DON'T delete this entry ! */
NULL,
NULL,
diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c
deleted file mode 100644
index 9551046..0000000
--- a/hw/xfree86/dixmods/extmod/xvmod.c
+++ /dev/null
@@ -1,23 +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 b39c915..0000000
--- a/hw/xfree86/dixmods/extmod/xvmodproc.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#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);
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 882c486..2adf727 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"
#include "shmint.h"
@@ -319,7 +317,7 @@ topdir=$1
shift
LC_ALL=C
export LC_ALL
-${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
+${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
BEGIN {
sdk = 0;
print("/*");
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 4e76c8e..eb42303 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -189,6 +189,10 @@ typedef void (*InitExtension)(void);
#ifdef DPMSExtension
#include <X11/extensions/dpmsconst.h>
#endif
+#ifdef XV
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/XvMC.h>
+#endif
/* FIXME: this whole block of externs should be from the appropriate headers */
#ifdef MITSHM
@@ -211,6 +215,7 @@ extern void ScreenSaverExtensionInit (void);
#ifdef XV
extern void XvExtensionInit(void);
extern void XvMCExtensionInit(void);
+extern void XvRegister(void);
#endif
extern void SyncExtensionInit(void);
extern void XkbExtensionInit(void);
@@ -533,6 +538,10 @@ static ExtensionModule staticExtensions[] = {
#ifdef RES
{ ResExtensionInit, XRES_NAME, &noResExtension, NULL },
#endif
+#ifdef XV
+ { XvExtensionInit, XvName, &noXvExtension, XvRegister },
+ { XvMCExtensionInit, XvMCName, &noXvExtension, NULL },
+#endif
{ NULL, NULL, NULL, NULL, NULL }
};
--
1.7.5.4
More information about the xorg-devel
mailing list