summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-07-10 02:03:18 +0100
committerKeith Packard <keithp@keithp.com>2012-07-10 00:31:01 -0700
commit9a953e0e9dcb8a8e43cc27ffaef460268fbe1916 (patch)
tree25b7a4f67b67b3740a9646df569fe7dc100a62a5
parentb8a3267c36e2e335b888bd4f2ef2f2c477cdfdce (diff)
Move DRI2 from external module to built-in
Instead of keeping a tiny amount of code in an external module, just man up and build it into the core server. v2: Fix test/Makefile.am to only link libdri2.la if DRI2 is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/Makefile.am8
-rw-r--r--hw/xfree86/common/Makefile.am2
-rw-r--r--hw/xfree86/common/xf86Config.c3
-rw-r--r--hw/xfree86/common/xf86Extensions.c9
-rw-r--r--hw/xfree86/common/xf86Extensions.h1
-rw-r--r--hw/xfree86/dri2/Makefile.am12
-rw-r--r--hw/xfree86/dri2/dri2.c38
-rw-r--r--hw/xfree86/dri2/dri2.h2
-rw-r--r--hw/xfree86/dri2/dri2ext.c24
-rw-r--r--hw/xfree86/dri2/dri2int.h26
-rw-r--r--hw/xfree86/loader/Makefile.am2
-rw-r--r--hw/xfree86/loader/loadmod.c1
-rwxr-xr-xhw/xfree86/sdksyms.sh2
-rw-r--r--test/Makefile.am7
14 files changed, 66 insertions, 71 deletions
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 0c3801d46..cd699eee9 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -6,6 +6,7 @@ endif
if DRI2
DRI2_SUBDIR = dri2
+DRI2_LIB = dri2/libdri2.la
endif
if XF86UTILS
@@ -27,8 +28,8 @@ INT10_SUBDIR = int10
endif
SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
- ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) . \
- $(VBE_SUBDIR) $(XAA_SUBDIR) $(DRI2_SUBDIR) i2c dixmods \
+ ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
+ $(DRI2_SUBDIR) . $(VBE_SUBDIR) $(XAA_SUBDIR) i2c dixmods \
fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man
DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
@@ -42,7 +43,7 @@ nodist_Xorg_SOURCES = sdksyms.c
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
- -I$(srcdir)/dri
+ -I$(srcdir)/dri -I$(srcdir)/dri2
LOCAL_LIBS = \
$(MAIN_LIB) \
@@ -59,6 +60,7 @@ LOCAL_LIBS = \
$(XORG_LIBS) \
dixmods/libxorgxkb.la \
$(DRI_LIB) \
+ $(DRI2_LIB) \
$(top_builddir)/mi/libmi.la \
$(top_builddir)/os/libos.la
Xorg_LDADD = \
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index cb6d0d478..325875d52 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -56,7 +56,7 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
-I$(srcdir)/../loader -I$(srcdir)/../parser \
-I$(srcdir)/../vbe -I$(srcdir)/../int10 \
-I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \
- -I$(srcdir)/../modes -I$(srcdir)/../ramdac
+ -I$(srcdir)/../modes -I$(srcdir)/../ramdac -I$(srcdir)/../dri2
sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
xf86PciInfo.h xf86Priv.h xf86Privstr.h \
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 0dbfa985f..486752b07 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -112,9 +112,6 @@ static ModuleDefault ModuleDefaults[] = {
#ifdef GLXEXT
{.name = "glx",.toLoad = TRUE,.load_opt = NULL},
#endif
-#ifdef DRI2
- {.name = "dri2",.toLoad = TRUE,.load_opt = NULL},
-#endif
#ifdef __CYGWIN__
/* load DIX modules used by drivers first */
{.name = "fb",.toLoad = TRUE,.load_opt = NULL},
diff --git a/hw/xfree86/common/xf86Extensions.c b/hw/xfree86/common/xf86Extensions.c
index b38ecf27c..15bab42ad 100644
--- a/hw/xfree86/common/xf86Extensions.c
+++ b/hw/xfree86/common/xf86Extensions.c
@@ -81,6 +81,15 @@ static ExtensionModule extensionModules[] = {
NULL
},
#endif
+#ifdef DRI2
+ {
+ DRI2ExtensionInit,
+ DRI2_NAME,
+ &noDRI2Extension,
+ NULL,
+ NULL
+ }
+#endif
};
static void
diff --git a/hw/xfree86/common/xf86Extensions.h b/hw/xfree86/common/xf86Extensions.h
index f86a421d6..9b8448d64 100644
--- a/hw/xfree86/common/xf86Extensions.h
+++ b/hw/xfree86/common/xf86Extensions.h
@@ -35,6 +35,7 @@ extern void XFree86DRIExtensionInit(void);
#ifdef DRI2
#include <X11/extensions/dri2proto.h>
+extern Bool noDRI2Extension;
extern void DRI2ExtensionInit(void);
#endif
diff --git a/hw/xfree86/dri2/Makefile.am b/hw/xfree86/dri2/Makefile.am
index ad3419bd2..502a2ee29 100644
--- a/hw/xfree86/dri2/Makefile.am
+++ b/hw/xfree86/dri2/Makefile.am
@@ -1,16 +1,14 @@
-libdri2_la_LTLIBRARIES = libdri2.la
-libdri2_la_CFLAGS = \
+noinst_LTLIBRARIES = libdri2.la
+AM_CFLAGS = \
-DHAVE_XORG_CONFIG_H \
- @DIX_CFLAGS@ @XORG_CFLAGS@ @DRI2PROTO_CFLAGS@ @LIBDRM_CFLAGS@ \
+ @DIX_CFLAGS@ @XORG_CFLAGS@ \
-I$(top_srcdir)/hw/xfree86/common \
-I$(top_srcdir)/hw/xfree86/os-support/bus
-libdri2_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
-libdri2_la_LIBADD = @LIBDRM_LIBS@ $(PIXMAN_LIBS)
-libdri2_ladir = $(moduledir)/extensions
libdri2_la_SOURCES = \
dri2.c \
dri2.h \
- dri2ext.c
+ dri2ext.c \
+ dri2int.h
sdk_HEADERS = dri2.h
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 887ce46c6..2ea0c331e 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -44,6 +44,7 @@
#include "windowstr.h"
#include "dixstruct.h"
#include "dri2.h"
+#include "dri2int.h"
#include "xf86VGAarbiter.h"
#include "damage.h"
#include "xf86.h"
@@ -1552,7 +1553,6 @@ DRI2CloseScreen(ScreenPtr pScreen)
dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL);
}
-extern ExtensionModule dri2ExtensionModule;
extern Bool DRI2ModuleSetup(void);
/* Called by InitExtensions() */
@@ -1566,46 +1566,14 @@ DRI2ModuleSetup(void)
return TRUE;
}
-static pointer
-DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- LoadExtension(&dri2ExtensionModule, FALSE);
- }
- else {
- if (errmaj)
- *errmaj = LDR_ONCEONLY;
- }
-
- return (pointer) 1;
-}
-
-static XF86ModuleVersionInfo DRI2VersRec = {
- "dri2",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 2, 0,
- ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_NONE,
- {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL };
-
void
DRI2Version(int *major, int *minor)
{
if (major != NULL)
- *major = DRI2VersRec.majorversion;
+ *major = 1;
if (minor != NULL)
- *minor = DRI2VersRec.minorversion;
+ *minor = 2;
}
int
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 28f2d753d..da7825e09 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -254,8 +254,6 @@ typedef struct {
DRI2CopyRegion2ProcPtr CopyRegion2;
} DRI2InfoRec, *DRI2InfoPtr;
-extern _X_EXPORT int DRI2EventBase;
-
extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info);
extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index c73fe9d12..eb6fd44fc 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -44,13 +44,15 @@
#include "extnsionst.h"
#include "xfixes.h"
#include "dri2.h"
+#include "dri2int.h"
#include "protocol-versions.h"
-/* The only xf86 include */
+/* The only xf86 includes */
#include "xf86Module.h"
+#include "xf86Extensions.h"
+
+static int DRI2EventBase;
-static ExtensionEntry *dri2Extension;
-extern Bool DRI2ModuleSetup(void);
static Bool
validDrawable(ClientPtr client, XID drawable, Mask access_mode,
@@ -664,11 +666,11 @@ SProcDRI2Dispatch(ClientPtr client)
}
}
-int DRI2EventBase;
-
-static void
+void
DRI2ExtensionInit(void)
{
+ ExtensionEntry *dri2Extension;
+
dri2Extension = AddExtension(DRI2_NAME,
DRI2NumberEvents,
DRI2NumberErrors,
@@ -679,13 +681,3 @@ DRI2ExtensionInit(void)
DRI2ModuleSetup();
}
-
-extern Bool noDRI2Extension;
-
-_X_HIDDEN ExtensionModule dri2ExtensionModule = {
- DRI2ExtensionInit,
- DRI2_NAME,
- &noDRI2Extension,
- NULL,
- NULL
-};
diff --git a/hw/xfree86/dri2/dri2int.h b/hw/xfree86/dri2/dri2int.h
new file mode 100644
index 000000000..7f53eba45
--- /dev/null
+++ b/hw/xfree86/dri2/dri2int.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright © 2011 Daniel Stone
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+extern Bool DRI2ModuleSetup(void);
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 660504202..d6ddbec37 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libloader.la
INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
-I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
- -I$(srcdir)/../ramdac -I$(srcdir)/../dri
+ -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2
#AM_LDFLAGS = -r
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 1ef8791f3..2347b8e5b 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -837,6 +837,7 @@ static const char *compiled_in_modules[] = {
"record",
"extmod",
"dri",
+ "dri2",
NULL
};
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index d8a7efbca..420640ffe 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -93,11 +93,9 @@ cat > sdksyms.c << EOF
/* hw/xfree86/dri2/Makefile.am -- module */
-/*
#if DRI2
# include "dri2.h"
#endif
- */
/* hw/xfree86/vgahw/Makefile.am -- module */
diff --git a/test/Makefile.am b/test/Makefile.am
index b388888cf..aa018c962 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -18,7 +18,8 @@ if XORG
INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \
-I$(top_srcdir)/hw/xfree86/ddc \
-I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
- -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri
+ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \
+ -I$(top_srcdir)/hw/xfree86/dri2
endif
TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
@@ -61,6 +62,10 @@ if DRI
libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la
endif
+if DRI2
+libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la
+endif
+
else
nodist_libxservertest_la_SOURCES = \
ddxstubs.c \