Move DRI1 from external module to built-in

Rather than building the tiny amount of code required for XFree86-DRI as
an external module, build it in if it's enabled at configure time.

v2: Fix test/Makefile.am to only link libdri.la if DRI is set

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>

fixup for DRI1 move

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Daniel Stone 2012-07-10 02:03:15 +01:00 committed by Keith Packard
parent b905d87ba0
commit 459c6da0f9
15 changed files with 31 additions and 119 deletions

View File

@ -1087,9 +1087,8 @@ AC_SUBST([GLX_SYS_LIBS])
AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
AC_SUBST(DRIPROTO_CFLAGS)
REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
fi
PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
@ -1659,7 +1658,7 @@ if test "x$XORG" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])

View File

@ -7,10 +7,8 @@ noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY)
AM_CFLAGS = \
@DIX_CFLAGS@ \
@GL_CFLAGS@ \
@DRI_CFLAGS@ \
@XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \
@DRIPROTO_CFLAGS@ \
@GLX_DEFINES@ \
@GLX_ARCH_DEFINES@

View File

@ -5,7 +5,6 @@ INCLUDES = \
@KDRIVE_CFLAGS@ \
@XEPHYR_INCS@ \
@XEPHYR_CFLAGS@ \
@DRIPROTO_CFLAGS@ \
-I$(top_srcdir) \
-I$(top_srcdir)/exa

View File

@ -1,6 +1,7 @@
if DRI
DRI_SUBDIR = dri
DRI_LIB = dri/libdri.la
endif
if DRI2
@ -26,8 +27,8 @@ INT10_SUBDIR = int10
endif
SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
ramdac $(VGAHW_SUBDIR) loader modes . $(VBE_SUBDIR) \
$(XAA_SUBDIR) $(DRI_SUBDIR) $(DRI2_SUBDIR) i2c dixmods \
ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) . \
$(VBE_SUBDIR) $(XAA_SUBDIR) $(DRI2_SUBDIR) i2c dixmods \
fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man
DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
@ -40,7 +41,8 @@ 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)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
-I$(srcdir)/dri
LOCAL_LIBS = \
$(MAIN_LIB) \
@ -56,6 +58,7 @@ LOCAL_LIBS = \
i2c/libi2c.la \
$(XORG_LIBS) \
dixmods/libxorgxkb.la \
$(DRI_LIB) \
$(top_builddir)/mi/libmi.la \
$(top_builddir)/os/libos.la
Xorg_LDADD = \

View File

@ -112,9 +112,6 @@ static ModuleDefault ModuleDefaults[] = {
#ifdef GLXEXT
{.name = "glx",.toLoad = TRUE,.load_opt = NULL},
#endif
#ifdef XF86DRI
{.name = "dri",.toLoad = TRUE,.load_opt = NULL},
#endif
#ifdef DRI2
{.name = "dri2",.toLoad = TRUE,.load_opt = NULL},
#endif

View File

@ -72,6 +72,15 @@ static ExtensionModule extensionModules[] = {
NULL
},
#endif
#ifdef XF86DRI
{
XFree86DRIExtensionInit,
"XFree86-DRI",
&noXFree86DRIExtension,
NULL,
NULL
},
#endif
};
static void

View File

@ -1,4 +1,4 @@
libdri_la_LTLIBRARIES = libdri.la
noinst_LTLIBRARIES = libdri.la
libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \
-I$(top_srcdir)/hw/xfree86/os-support \
-I$(top_srcdir)/hw/xfree86/modes \
@ -9,16 +9,10 @@ libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \
-I$(top_srcdir)/hw/xfree86/os-support/bus \
-I$(top_srcdir)/glx \
-DHAVE_XORG_CONFIG_H \
@DIX_CFLAGS@ @XORG_CFLAGS@ @DRIPROTO_CFLAGS@ \
@LIBDRM_CFLAGS@ \
@DRI_CFLAGS@
libdri_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
libdri_la_LIBADD = @LIBDRM_LIBS@ $(PIXMAN_LIBS)
libdri_ladir = $(moduledir)/extensions
@DIX_CFLAGS@ @XORG_CFLAGS@
libdri_la_SOURCES = \
dri.c \
dri.h \
drimodule.c \
dristruct.h \
sarea.h \
xf86dri.c

View File

@ -791,6 +791,8 @@ DRIExtensionInit(void)
RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
drmSetServerInfo(&DRIDRMServerInfo);
return TRUE;
}

View File

@ -197,7 +197,7 @@ extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
extern _X_EXPORT Bool DRIExtensionInit(void);
extern Bool DRIExtensionInit(void);
extern _X_EXPORT void DRIReset(void);

View File

@ -1,92 +0,0 @@
/**************************************************************************
Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
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, sub license, 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 NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Rickard E. Faith <faith@precisioninsight.com>
*
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "xf86Module.h"
#include "xf86Extensions.h"
#include "globals.h"
#include "xf86drm.h"
static MODULESETUPPROTO(driSetup);
drmServerInfo DRIDRMServerInfo;
static XF86ModuleVersionInfo VersRec = {
"dri",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_EXTENSION,
ABI_EXTENSION_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0}
};
#define _XF86DRI_SERVER_
#include <X11/dri/xf86driproto.h>
static ExtensionModule XF86DRIExt = {
XFree86DRIExtensionInit,
XF86DRINAME,
&noXFree86DRIExtension,
NULL,
NULL
};
_X_EXPORT XF86ModuleData driModuleData = { &VersRec, driSetup, NULL };
static pointer
driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
if (!setupDone) {
setupDone = TRUE;
LoadExtension(&XF86DRIExt, FALSE);
}
else {
if (errmaj)
*errmaj = LDR_ONCEONLY;
}
drmSetServerInfo(&DRIDRMServerInfo);
/* Need a non-NULL return value to indicate success */
return (pointer) 1;
}

View File

@ -1,7 +1,6 @@
libdri2_la_LTLIBRARIES = libdri2.la
libdri2_la_CFLAGS = \
-DHAVE_XORG_CONFIG_H \
@DRI_CFLAGS@ \
@DIX_CFLAGS@ @XORG_CFLAGS@ @DRI2PROTO_CFLAGS@ @LIBDRM_CFLAGS@ \
-I$(top_srcdir)/hw/xfree86/common \
-I$(top_srcdir)/hw/xfree86/os-support/bus

View File

@ -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)/../ramdac -I$(srcdir)/../dri
#AM_LDFLAGS = -r
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)

View File

@ -836,6 +836,7 @@ static const char *compiled_in_modules[] = {
"dbe",
"record",
"extmod",
"dri",
NULL
};

View File

@ -203,13 +203,11 @@ cat > sdksyms.c << EOF
/* hw/xfree86/dri/Makefile.am -- module */
/*
#if XF86DRI
# include "dri.h"
# include "sarea.h"
# include "dristruct.h"
#endif
*/
/* mi/Makefile.am */

View File

@ -18,7 +18,7 @@ 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/ramdac -I$(top_srcdir)/hw/xfree86/dri
endif
TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
@ -42,6 +42,7 @@ os_LDADD=$(TEST_LDADD)
libxservertest_la_LIBADD = $(XSERVER_LIBS)
if XORG
nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
libxservertest_la_LIBADD += \
$(top_builddir)/hw/xfree86/loader/libloader.la \
@ -56,6 +57,10 @@ libxservertest_la_LIBADD += \
$(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
@XORG_LIBS@
if DRI
libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la
endif
else
nodist_libxservertest_la_SOURCES = \
ddxstubs.c \