[PATCH 13/15] glamor: Hook the module back up to the build.

Eric Anholt eric at anholt.net
Thu Jan 9 17:26:27 PST 2014


For now we're just building an uninstalled library.  The extra EGL
stubs are required so that we can get the DIX building and usable
without pulling in the xf86 DDX code in glamor_egl.c.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 Makefile.am               |  6 +++++
 configure.ac              | 10 ++++++++
 glamor/Makefile.am        | 31 ++++-------------------
 glamor/glamor.c           |  1 +
 glamor/glamor_egl_stubs.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++
 include/dix-config.h.in   |  3 +++
 6 files changed, 89 insertions(+), 26 deletions(-)
 create mode 100644 glamor/glamor_egl_stubs.c

diff --git a/Makefile.am b/Makefile.am
index 5bf760b..876c8a6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,6 +25,10 @@ if PRESENT
 PRESENT_DIR=present
 endif
 
+if GLAMOR
+GLAMOR_DIR=glamor
+endif
+
 SUBDIRS = \
 	doc \
 	man \
@@ -49,6 +53,7 @@ SUBDIRS = \
 	$(PRESENT_DIR) \
 	$(DRI3_DIR) \
 	exa \
+	$(GLAMOR_DIR) \
 	config \
 	hw \
 	test
@@ -100,6 +105,7 @@ DIST_SUBDIRS = \
 	composite \
 	glx \
 	exa \
+	$(GLAMOR_DIR) \
 	config \
 	dri3 \
 	present \
diff --git a/configure.ac b/configure.ac
index 51ac30b..bc9aaec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -638,6 +638,7 @@ AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest serv
 AC_ARG_ENABLE(xquartz,        AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
 AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
 AC_ARG_ENABLE(xwin,    	      AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
+AC_ARG_ENABLE(glamor,         AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: no)]), [GLAMOR=$enableval], [GLAMOR=no])
 dnl 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])
@@ -2065,6 +2066,14 @@ AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
 AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
 AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
 AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
+
+dnl glamor
+AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes])
+if test "x$GLAMOR" = xyes; then
+	AC_DEFINE(GLAMOR, 1, [Build glamor])
+	PKG_CHECK_MODULES([GLAMOR], [egl gl])
+fi
+
 dnl XWin DDX
 
 AC_MSG_CHECKING([whether to build XWin DDX])
@@ -2434,6 +2443,7 @@ doc/Makefile
 doc/dtrace/Makefile
 man/Makefile
 fb/Makefile
+glamor/Makefile
 record/Makefile
 config/Makefile
 mi/Makefile
diff --git a/glamor/Makefile.am b/glamor/Makefile.am
index 90d80a7..3fe2530 100644
--- a/glamor/Makefile.am
+++ b/glamor/Makefile.am
@@ -1,14 +1,8 @@
-lib_LTLIBRARIES = libglamor.la
+noinst_LTLIBRARIES = libglamor.la libglamor_egl_stubs.la
 
-if GLAMOR_GLES2
-libglamor_la_LIBADD = $(GLESV2_LIBS)
-else
-libglamor_la_LIBADD = $(GL_LIBS)
-endif
+libglamor_la_LIBADD = $(GLAMOR_LIBS)
 
-AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
-
-libglamor_la_LDFLAGS = -version-info 0:0:0
+AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS)
 
 libglamor_la_SOURCES = \
 	glamor.c \
@@ -48,21 +42,6 @@ libglamor_la_SOURCES = \
 	glamor_utils.h\
 	glamor.h
 
-sdk_HEADERS = glamor.h
-
-if EGL
-LIBGLAMOREGL = libglamoregl.la
-module_LTLIBRARIES = $(LIBGLAMOREGL)
-libglamoregl_la_DEPENDENCIES = libglamor.la
-libglamoregl_la_LDFLAGS = -avoid-version -module
-libglamoregl_la_LIBADD = $(EGL_LIBS) $(GLX_SYS_LIBS) $(GBM_LIBS) libglamor.la
-libglamoregl_la_SOURCES = glamor_eglmodule.c glamor_egl.c
-libglamoregl_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	$(GLX_DEFINES) \
-	$(LIBDRM_CFLAGS) \
-	$(EGL_CFLAGS) \
-	$(GBM_CFLAGS)
-endif
-
+libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c
 
+sdk_HEADERS = glamor.h
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 188aef5..feb110a 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -261,6 +261,7 @@ glamor_set_debug_level(int *debug_level)
 
 int glamor_debug_level;
 
+
 /** Set up glamor for an already-configured GL context. */
 Bool
 glamor_init(ScreenPtr screen, unsigned int flags)
diff --git a/glamor/glamor_egl_stubs.c b/glamor/glamor_egl_stubs.c
new file mode 100644
index 0000000..1449d08
--- /dev/null
+++ b/glamor/glamor_egl_stubs.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * 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.
+ */
+
+/** @file glamor_egl_stubs.c
+ *
+ * Stubbed out glamor_egl.c functions for servers other than Xorg.
+ */
+
+#include "glamor_priv.h"
+
+void
+glamor_egl_screen_init(ScreenPtr screen)
+{
+}
+
+void
+glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap)
+{
+}
+
+void
+glamor_egl_make_current(ScreenPtr screen)
+{
+}
+
+void
+glamor_egl_restore_context(ScreenPtr screen)
+{
+}
+
+int
+glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
+                                 PixmapPtr pixmap,
+                                 unsigned int tex,
+                                 Bool want_name, CARD16 *stride, CARD32 *size)
+{
+    return 0;
+}
+
+unsigned int
+glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
+{
+    return 0;
+}
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 3066100..8991cd9 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -469,4 +469,7 @@
 /* Directory for shared memory temp files */
 #undef SHMDIR
 
+/* Build GLAMOR */
+#undef GLAMOR
+
 #endif /* _DIX_CONFIG_H_ */
-- 
1.8.5.1



More information about the xorg-devel mailing list