[PATCH 16/42] Move Xv and XvMC from extmod to built-in
Daniel Stone
daniel at fooishbar.org
Fri Dec 2 03:27:24 PST 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>
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 | 11 +++++++----
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 | 2 --
mi/miinitext.c | 4 ++++
14 files changed, 29 insertions(+), 87 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 62a50f9..0d0bb10 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;
@@ -232,7 +236,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);
@@ -268,7 +271,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);
-#endif /* XorgLoader */
+extern void XvRegister(void);
#endif /* XVDIX_H */
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index d397ba6..71deaa6 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -200,6 +200,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 cc956d3..4686b56 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 int XvMCScreenInit(ScreenPtr pScreen,
int num,
XvMCAdaptorPtr adapt);
@@ -111,6 +110,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 99e9c8d..e01eab1 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
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 ca3eca3..7551e29 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -66,22 +66,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 13df37e..b8563ee 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/mi/miinitext.c b/mi/miinitext.c
index f5f23c6..f815217 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -366,6 +366,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.7.3
More information about the xorg-devel
mailing list