From b1b40ed6a87f72d07825624730cca193d5a89baf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 28 Dec 2005 10:31:46 +0000 Subject: [PATCH] Initial commit of XGL build infrastructure and XGL code changes for building within the xorg server tree. Requires additional, uncommitted dix changes to successfully build, and successful running is still yet to happen. --- configure.ac | 65 +++++++++++++++++++++++++++++++++++ hw/Makefile.am | 5 +++ hw/xgl/Makefile.am | 29 +++++++++------- hw/xgl/egl/Makefile.am | 36 ++++++++++--------- hw/xgl/egl/evdev.c | 4 +-- hw/xgl/egl/kinput.c | 4 +-- hw/xgl/egl/module/Makefile.am | 14 ++++---- hw/xgl/glx/Makefile.am | 37 +++++++++++--------- hw/xgl/glx/module/Makefile.am | 16 ++++----- hw/xgl/glx/xglxinit.c | 14 +++++--- hw/xgl/glxext/xglglxext.h | 4 +-- hw/xgl/xgl.h | 11 +++--- hw/xgl/xglglx.c | 4 +-- hw/xgl/xglhash.c | 2 +- hw/xgl/xglinit.c | 6 +++- hw/xgl/xglloader.c | 6 ++-- hw/xgl/xglmodule.h | 4 +-- include/xgl-config.h.in | 14 ++++++++ 18 files changed, 187 insertions(+), 88 deletions(-) create mode 100644 include/xgl-config.h.in diff --git a/configure.ac b/configure.ac index 05e1631657..2709bc6565 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,8 @@ AC_CONFIG_HEADERS(include/xorg-server.h) dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just dnl dix/). AC_CONFIG_HEADERS(include/dix-config.h) +dnl xgl-config.h covers the Xgl DDX. +AC_CONFIG_HEADERS(include/xgl-config.h) dnl xorg-config.h covers the Xorg DDX. AC_CONFIG_HEADERS(include/xorg-config.h) dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. @@ -400,6 +402,9 @@ AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto]) +AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no]) +AC_ARG_ENABLE(xglx, AS_HELP_STRING([--enable-xglx], [Build Xglx xgl module (default: no)]), [XGLX=$enableval], [XGLX=no]) +AC_ARG_ENABLE(xegl, AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no]) # kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) @@ -901,6 +906,59 @@ if test "x$XORG" = xauto; then fi AC_MSG_RESULT([$XORG]) +dnl Xgl DDX + +AC_MSG_CHECKING([whether to build Xgl DDX]) +if test "x$XGL" != xno; then + PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XGL=yes], [XGL=no]) + AC_SUBST(XGLMODULES_CFLAGS) + AC_SUBST(XGLMODULES_LIBS) +fi +AC_MSG_RESULT([$XGL]) +AM_CONDITIONAL(XGL, [test "x$XGL" = xyes]) + +if test "x$XGL" = xyes; then + XGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $LBX_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + AC_SUBST([XGL_LIBS]) + AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules]) + + xglmoduledir="$moduledir/xgl" + AC_SUBST([xglmoduledir]) + AC_DEFINE_DIR(XGL_MODULE_PATH, xglmoduledir, [Default XGL module search path]) +fi + +dnl Xegl DDX + +AC_MSG_CHECKING([whether to build Xegl DDX]) +if test "x$XEGL" != xno; then + PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XEGL=yes], [XEGL=no]) + AC_SUBST(XEGLMODULES_CFLAGS) + AC_SUBST(XEGLMODULES_LIBS) +fi +AC_MSG_RESULT([$XEGL]) +AM_CONDITIONAL(XEGL, [test "x$XEGL" = xyes]) + +if test "x$XEGL" = xyes; then + XEGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $LBX_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + AC_SUBST([XEGL_LIBS]) +fi + +dnl Xglx DDX + +AC_MSG_CHECKING([whether to build Xglx DDX]) +if test "x$XGLX" != xno; then + PKG_CHECK_MODULES([XGLXMODULES], [glitz-glx >= 0.4.3 xrender], [XGLX=yes], [XGLX=no]) + AC_SUBST(XGLXMODULES_CFLAGS) + AC_SUBST(XGLXMODULES_LIBS) +fi +AC_MSG_RESULT([$XGLX]) +AM_CONDITIONAL(XGLX, [test "x$XGLX" = xyes]) + +if test "x$XGLX" = xyes; then + XGLX_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $LBX_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + AC_SUBST([XGLX_LIBS]) +fi + # XORG_CORE_LIBS is needed even if you're not building the Xorg DDX XORG_CORE_LIBS="$DIX_LIB" AC_SUBST([XORG_CORE_LIBS]) @@ -1542,6 +1600,13 @@ hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/vfb/Makefile +hw/xgl/Makefile +hw/xgl/egl/Makefile +hw/xgl/egl/module/Makefile +hw/xgl/glx/Makefile +hw/xgl/glx/module/Makefile +hw/xgl/glxext/Makefile +hw/xgl/glxext/module/Makefile hw/xnest/Makefile hw/xwin/Makefile hw/darwin/Makefile diff --git a/hw/Makefile.am b/hw/Makefile.am index b409079fa7..0348e70f83 100644 --- a/hw/Makefile.am +++ b/hw/Makefile.am @@ -18,6 +18,10 @@ if XWIN XWIN_SUBDIRS = xwin endif +if XGL +XGL_SUBDIRS = xgl +endif + if KDRIVE KDRIVE_SUBDIRS = kdrive endif @@ -26,6 +30,7 @@ endif SUBDIRS = \ $(XORG_SUBDIRS) \ + $(XGL_SUBDIRS) \ $(XWIN_SUBDIRS) \ $(XVFB_SUBDIRS) \ $(XNEST_SUBDIRS) \ diff --git a/hw/xgl/Makefile.am b/hw/xgl/Makefile.am index 3fc5f59153..b8272d2dda 100644 --- a/hw/xgl/Makefile.am +++ b/hw/xgl/Makefile.am @@ -16,11 +16,9 @@ SUBDIRS = \ $(XGLX_SUBDIRS) \ $(XEGL_SUBDIRS) -INCLUDES = \ - @XGL_INCS@ \ - @XSERVER_CFLAGS@ \ - @XGLSERVER_CFLAGS@ \ - -DMODULEPATH=\"@MODULEPATH@\" +AM_CFLAGS = \ + @SERVER_DEFINES@ \ + $(XGLMODULES_CFLAGS) noinst_LIBRARIES = libxgl.a @@ -52,15 +50,20 @@ libxgl_a_SOURCES = \ xglloader.c \ xglglx.c -if XGLSERVER -Xgl_DEPENDENCIES = @XGL_LIBS@ Xgl_LDFLAGS = -export-dynamic -Xgl_SOURCES = xglinit.c -Xgl_LDADD = \ - @XGL_LIBS@ \ - @XSERVER_LIBS@ \ - @XGLSERVER_LIBS@ +Xgl_SOURCES = \ + xglinit.c \ + $(top_srcdir)/mi/miinitext.c \ + $(top_srcdir)/Xext/dpmsstubs.c \ + $(top_srcdir)/Xi/stubs.c \ + $(top_srcdir)/fb/fbcmap.c +Xgl_LDADD = \ + libxgl.a \ + $(XORG_CORE_LIBS) \ + $(XGL_LIBS) \ + $(XSERVER_LIBS) \ + $(EXTENSION_LIBS) \ + $(XGLMODULES_LIBS) Xgl_programs = Xgl -endif bin_PROGRAMS = $(Xgl_programs) diff --git a/hw/xgl/egl/Makefile.am b/hw/xgl/egl/Makefile.am index 8a9b9f5397..bc7f1e3b64 100644 --- a/hw/xgl/egl/Makefile.am +++ b/hw/xgl/egl/Makefile.am @@ -1,16 +1,14 @@ -if XGLSERVER -MODULE_SUBDIRS = module +if XGL +XGL_MODULE_DIRS = module endif SUBDIRS = \ . \ - $(MODULE_SUBDIRS) + $(XGL_MODULE_DIRS) -INCLUDES = \ - @XEGL_INCS@ \ - @XSERVER_CFLAGS@ \ - @XGLSERVER_CFLAGS@ \ - @XEGLSERVER_CFLAGS@ +AM_CFLAGS = \ + @SERVER_DEFINES@ \ + $(XEGLMODULES_CFLAGS) noinst_LTLIBRARIES = libxegl.la @@ -22,16 +20,22 @@ libxegl_la_SOURCES = \ kinput.c \ evdev.c -if XEGLSERVER Xegl_DEPENDENCIES = @XEGL_LIBS@ Xegl_LDFLAGS = -export-dynamic -Xegl_SOURCES = xeglinit.c -Xegl_LDADD = \ - @XEGL_LIBS@ \ - @XSERVER_LIBS@ \ - @XGLSERVER_LIBS@ \ - @XEGLSERVER_LIBS@ +Xegl_SOURCES = \ + xglxinit.c \ + $(top_srcdir)/mi/miinitext.c \ + $(top_srcdir)/Xext/dpmsstubs.c \ + $(top_srcdir)/Xi/stubs.c \ + $(top_srcdir)/fb/fbcmap.c +Xegl_LDADD = \ + libxegl.la \ + ../libxgl.a \ + $(XORG_CORE_LIBS) \ + $(XEGL_LIBS) \ + $(XSERVER_LIBS) \ + $(EXTENSION_LIBS) \ + $(XGLXMODULES_LIBS) Xegl_programs = Xegl -endif bin_PROGRAMS = $(Xegl_programs) diff --git a/hw/xgl/egl/evdev.c b/hw/xgl/egl/evdev.c index 634be73c48..ebfe265a35 100644 --- a/hw/xgl/egl/evdev.c +++ b/hw/xgl/egl/evdev.c @@ -22,9 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include #define NEED_EVENTS #include #include diff --git a/hw/xgl/egl/kinput.c b/hw/xgl/egl/kinput.c index 5cf4b688e2..90997d25e9 100644 --- a/hw/xgl/egl/kinput.c +++ b/hw/xgl/egl/kinput.c @@ -23,9 +23,7 @@ */ /* $RCSId: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.30 2002/11/13 16:37:39 keithp Exp $ */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include #include diff --git a/hw/xgl/egl/module/Makefile.am b/hw/xgl/egl/module/Makefile.am index c321926ba4..ec1e2c45e3 100644 --- a/hw/xgl/egl/module/Makefile.am +++ b/hw/xgl/egl/module/Makefile.am @@ -1,14 +1,14 @@ -INCLUDES = \ - @XEGL_INCS@ \ - @XSERVER_CFLAGS@ \ - @XEGLSERVER_CFLAGS@ +AM_CFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../.. \ + $(XEGLMODULES_CFLAGS) libxegl_la_LDFLAGS = -avoid-version libxegl_la_SOURCES = xeglmodule.c libxegl_la_LIBADD = \ - @XEGL_MOD_LIBS@ \ - @XEGLSERVER_LIBS@ + $(top_builddir)/hw/xgl/glx/libxegl.la \ + $(XEGLMODULES_LIBS) -moduledir = @MODULEPATH@/xgl +moduledir = @xglmoduledir@ module_LTLIBRARIES = libxegl.la \ No newline at end of file diff --git a/hw/xgl/glx/Makefile.am b/hw/xgl/glx/Makefile.am index 138ee8ceff..dfd0d38f0a 100644 --- a/hw/xgl/glx/Makefile.am +++ b/hw/xgl/glx/Makefile.am @@ -1,16 +1,15 @@ -if XGLSERVER -MODULE_SUBDIRS = module +if XGL +XGL_MODULE_DIRS = module endif SUBDIRS = \ . \ - $(MODULE_SUBDIRS) + $(XGL_MODULE_DIRS) -INCLUDES = \ - @XGLX_INCS@ \ - @XSERVER_CFLAGS@ \ - @XGLSERVER_CFLAGS@ \ - @XGLXSERVER_CFLAGS@ +AM_CFLAGS = \ + -I$(srcdir)/.. \ + @SERVER_DEFINES@ \ + $(XGLXMODULES_CFLAGS) noinst_LTLIBRARIES = libxglx.la @@ -18,16 +17,22 @@ libxglx_la_SOURCES = \ xglx.h \ xglx.c -if XGLXSERVER Xglx_DEPENDENCIES = @XGLX_LIBS@ Xglx_LDFLAGS = -export-dynamic -Xglx_SOURCES = xglxinit.c -Xglx_LDADD = \ - @XGLX_LIBS@ \ - @XSERVER_LIBS@ \ - @XGLSERVER_LIBS@ \ - @XGLXSERVER_LIBS@ +Xglx_SOURCES = \ + xglxinit.c \ + $(top_srcdir)/mi/miinitext.c \ + $(top_srcdir)/Xext/dpmsstubs.c \ + $(top_srcdir)/Xi/stubs.c \ + $(top_srcdir)/fb/fbcmap.c +Xglx_LDADD = \ + libxglx.la \ + ../libxgl.a \ + $(XORG_CORE_LIBS) \ + $(XGLX_LIBS) \ + $(XSERVER_LIBS) \ + $(EXTENSION_LIBS) \ + $(XGLXMODULES_LIBS) Xglx_programs = Xglx -endif bin_PROGRAMS = $(Xglx_programs) diff --git a/hw/xgl/glx/module/Makefile.am b/hw/xgl/glx/module/Makefile.am index dd5f097724..5c22c67f2a 100644 --- a/hw/xgl/glx/module/Makefile.am +++ b/hw/xgl/glx/module/Makefile.am @@ -1,14 +1,14 @@ -INCLUDES = \ - @XGLX_INCS@ \ - @XSERVER_CFLAGS@ \ - @XGLXSERVER_CFLAGS@ +AM_CFLAGS = \ + -I$(srcdir)/.. \ + -I$(srcdir)/../.. \ + $(XGLXMODULES_CFLAGS) libxglx_la_LDFLAGS = -avoid-version libxglx_la_SOURCES = xglxmodule.c -libxglx_la_LIBADD = \ - @XGLX_MOD_LIBS@ \ - @XGLXSERVER_LIBS@ +libxglx_la_LIBADD = \ + $(top_builddir)/hw/xgl/glx/libxglx.la \ + $(XGLXMODULES_LIBS) -moduledir = @MODULEPATH@/xgl +moduledir = @xglmoduledir@ module_LTLIBRARIES = libxglx.la \ No newline at end of file diff --git a/hw/xgl/glx/xglxinit.c b/hw/xgl/glx/xglxinit.c index 18bdca1f8c..0376133bb5 100644 --- a/hw/xgl/glx/xglxinit.c +++ b/hw/xgl/glx/xglxinit.c @@ -25,7 +25,7 @@ #include "xglx.h" -static xglScreenInfoRec xglxScreenInfo = { +xglScreenInfoRec xglScreenInfo = { NULL, 0, 0, 0, 0, DEFAULT_GEOMETRY_DATA_TYPE, DEFAULT_GEOMETRY_USAGE, @@ -53,7 +53,7 @@ InitOutput (ScreenInfo *pScreenInfo, } #endif - xglxInitOutput (&xglxScreenInfo, pScreenInfo, argc, argv); + xglxInitOutput (pScreenInfo, argc, argv); } Bool @@ -73,7 +73,7 @@ void InitInput (int argc, char **argv) { - xglxInitInput (&xglxScreenInfo, argc, argv); + xglxInitInput (argc, argv); } void @@ -105,11 +105,11 @@ ddxProcessArgument (int argc, } #endif - skip = xglProcessArgument (&xglxScreenInfo, argc, argv, i); + skip = xglProcessArgument (argc, argv, i); if (skip) return skip; - return xglxProcessArgument (&xglxScreenInfo, argc, argv, i); + return xglxProcessArgument (argc, argv, i); } void @@ -129,3 +129,7 @@ OsVendorInit (void) { xglxOsVendorInit (); } + +void ddxInitGlobals(void) +{ +} diff --git a/hw/xgl/glxext/xglglxext.h b/hw/xgl/glxext/xglglxext.h index 491b268813..2fe9d742fb 100644 --- a/hw/xgl/glxext/xglglxext.h +++ b/hw/xgl/glxext/xglglxext.h @@ -26,9 +26,7 @@ #ifndef _XGL_GLXEXT_H_ #define _XGL_GLXEXT_H_ -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include "scrnintstr.h" diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index ceb18ddaa0..0ccf936e49 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -26,9 +26,7 @@ #ifndef _XGL_H_ #define _XGL_H_ -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include #include @@ -53,6 +51,11 @@ typedef struct _GCFuncs *GCFuncsPtr; #include "mipict.h" #endif +/* For the modules. We should decide what the actual version numbering should + * be. + */ +#define VERSION "0.0.1" + extern WindowPtr *WindowTable; #define XGL_DEFAULT_PBO_MASK 0 @@ -1331,7 +1334,7 @@ xglAddTraps (PicturePtr pDst, #endif -#ifdef XLOADABLE +#ifdef XGL_MODULAR /* xglloader.c */ diff --git a/hw/xgl/xglglx.c b/hw/xgl/xglglx.c index f22603e906..99ff72d5cb 100644 --- a/hw/xgl/xglglx.c +++ b/hw/xgl/xglglx.c @@ -139,7 +139,7 @@ Bool xglLoadGLXModules (void) { -#ifdef XLOADABLE +#ifdef XGL_MODULAR if (!glXHandle) { xglSymbolRec sym[] = { @@ -207,7 +207,7 @@ void xglUnloadGLXModules (void) { -#ifdef XLOADABLE +#ifdef XGL_MODULAR if (glXHandle) { xglUnloadModule (glXHandle); diff --git a/hw/xgl/xglhash.c b/hw/xgl/xglhash.c index 2635422f8e..c6c22ad88e 100644 --- a/hw/xgl/xglhash.c +++ b/hw/xgl/xglhash.c @@ -52,7 +52,7 @@ Bool xglLoadHashFuncs (void *handle) { -#ifdef XLOADABLE +#ifdef XGL_MODULAR xglSymbolRec sym[] = { SYM (__hashFunc.NewHashTable, "_mesa_NewHashTable"), SYM (__hashFunc.DeleteHashTable, "_mesa_DeleteHashTable"), diff --git a/hw/xgl/xglinit.c b/hw/xgl/xglinit.c index e6af7eef29..a6fcd43c60 100644 --- a/hw/xgl/xglinit.c +++ b/hw/xgl/xglinit.c @@ -98,7 +98,7 @@ static Bool xglEnsureDDXModule (void) { -#ifdef XLOADABLE +#ifdef XGL_MODULAR static void *ddxHandle = 0; static Bool status = TRUE; @@ -285,3 +285,7 @@ OsVendorInit (void) if (xglEnsureDDXModule ()) (*__ddxFunc.osVendorInit) (); } + +void ddxInitGlobals(void) +{ +} diff --git a/hw/xgl/xglloader.c b/hw/xgl/xglloader.c index 9a311aecd2..c06b9e225e 100644 --- a/hw/xgl/xglloader.c +++ b/hw/xgl/xglloader.c @@ -26,7 +26,7 @@ #include "xgl.h" #include "xglmodule.h" -#ifdef XLOADABLE +#ifdef XGL_MODULAR #include @@ -44,11 +44,11 @@ xglLoadModule (const char *name) SYM (moduleInit, "moduleInit") }; - module = malloc (strlen (MODULEPATH "/xgl/lib.so") + strlen (name) + 1); + module = malloc (strlen (XGL_MODULE_PATH "/lib.so") + strlen (name) + 1); if (!module) return 0; - sprintf (module, MODULEPATH "/xgl/lib%s.so", name); + sprintf (module, XGL_MODULE_PATH "/lib%s.so", name); handle = dlopen (module, RTLD_NOW); if (handle) diff --git a/hw/xgl/xglmodule.h b/hw/xgl/xglmodule.h index 0dcabebcaf..78c3e44d08 100644 --- a/hw/xgl/xglmodule.h +++ b/hw/xgl/xglmodule.h @@ -26,9 +26,7 @@ #ifndef _XGL_MODULE_H_ #define _XGL_MODULE_H_ -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include #include "misc.h" diff --git a/include/xgl-config.h.in b/include/xgl-config.h.in new file mode 100644 index 0000000000..877d179c4b --- /dev/null +++ b/include/xgl-config.h.in @@ -0,0 +1,14 @@ +/* + * xgl-config.h.in + * + * This file has defines used in the xgl ddx + * + */ + +#include + +/* Use loadable XGL modules. */ +#undef XGL_MODULAR + +/* Default XGL module search path */ +#undef XGL_MODULE_PATH