Mesa (master): nouveau: Build the driver into the shared mesa_dri_drivers. so.

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 24 21:48:09 UTC 2013


Module: Mesa
Branch: master
Commit: ead86e378fd4a8b19f7a3f185c751a41b2530b2f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ead86e378fd4a8b19f7a3f185c751a41b2530b2f

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 24 10:24:07 2013 -0700

nouveau: Build the driver into the shared mesa_dri_drivers.so.

v2: drop dridir now that it's unused.
v3: Consistently put spaces around += in the updated Makefile.am block.
v4: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).
v5: Fix missed public symbol in nouveau. (caught by Emil)

Reviewed-by: Matt Turner <mattst88 at gmail.com> (v2)
Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

---

 configure.ac                                  |    2 +-
 src/mesa/drivers/dri/Makefile.am              |    4 +++-
 src/mesa/drivers/dri/nouveau/Makefile.am      |   20 +++-----------------
 src/mesa/drivers/dri/nouveau/nouveau_screen.c |   17 +++++++++++++++--
 src/mesa/drivers/dri/nouveau/nouveau_screen.h |    2 ++
 5 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index d47636d..c352cf5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1039,7 +1039,7 @@ fi
 enable_dricore=no
 enable_megadriver=no
 for driver in $DRI_DIRS; do
-    if test $driver != "i965"; then
+    if test $driver != "i965" -a $driver != "nouveau"; then
         enable_dricore=yes
     else
         enable_megadriver=yes
diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am
index 7c57356..d69bf38 100644
--- a/src/mesa/drivers/dri/Makefile.am
+++ b/src/mesa/drivers/dri/Makefile.am
@@ -17,7 +17,9 @@ MEGADRIVERS += i965_dri.so
 endif
 
 if HAVE_NOUVEAU_DRI
-SUBDIRS+=nouveau
+SUBDIRS += nouveau
+MEGADRIVERS_DEPS += nouveau/libnouveau_dri.la
+MEGADRIVERS += nouveau_vieux_dri.so
 endif
 
 if HAVE_R200_DRI
diff --git a/src/mesa/drivers/dri/nouveau/Makefile.am b/src/mesa/drivers/dri/nouveau/Makefile.am
index 7e6605f..377b9a2 100644
--- a/src/mesa/drivers/dri/nouveau/Makefile.am
+++ b/src/mesa/drivers/dri/nouveau/Makefile.am
@@ -33,20 +33,6 @@ AM_CFLAGS = \
 	$(VISIBILITY_CFLAGS) \
 	$(NOUVEAU_CFLAGS)
 
-dridir = $(DRI_DRIVER_INSTALL_DIR)
-dri_LTLIBRARIES = nouveau_vieux_dri.la
-
-nouveau_vieux_dri_la_SOURCES = \
-	$(NOUVEAU_C_FILES)
-
-nouveau_vieux_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
-nouveau_vieux_dri_la_LIBADD = \
-	../common/libdricommon.la \
-	$(DRI_LIB_DEPS) \
-	$(NOUVEAU_LIBS)
-
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: nouveau_vieux_dri.la
-	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-	ln -f .libs/nouveau_vieux_dri.so $(top_builddir)/$(LIB_DIR)/nouveau_vieux_dri.so;
+noinst_LTLIBRARIES = libnouveau_dri.la
+libnouveau_dri_la_SOURCES = $(NOUVEAU_C_FILES)
+libnouveau_dri_la_LIBADD = $(NOUVEAU_LIBS)
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 6816406..4ab830e 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -246,7 +246,7 @@ static const __DRIextension *nouveau_screen_extensions[] = {
     NULL
 };
 
-const struct __DriverAPIRec driDriverAPI = {
+const struct __DriverAPIRec nouveau_driver_api = {
 	.InitScreen      = nouveau_init_screen2,
 	.DestroyScreen   = nouveau_destroy_screen,
 	.CreateBuffer    = nouveau_create_buffer,
@@ -257,9 +257,22 @@ const struct __DriverAPIRec driDriverAPI = {
 	.UnbindContext   = nouveau_context_unbind,
 };
 
+static const struct __DRIDriverVtableExtensionRec nouveau_vtable = {
+   .base = { __DRI_DRIVER_VTABLE, 1 },
+   .vtable = &nouveau_driver_api,
+};
+
 /* This is the table of extensions that the loader will dlsym() for. */
-PUBLIC const __DRIextension *__driDriverExtensions[] = {
+static const __DRIextension *nouveau_driver_extensions[] = {
 	&driCoreExtension.base,
 	&driDRI2Extension.base,
+	&nouveau_vtable.base,
 	NULL
 };
+
+PUBLIC const __DRIextension **__driDriverGetExtensions_nouveau_vieux(void)
+{
+   globalDriverAPI = &nouveau_driver_api;
+
+   return nouveau_driver_extensions;
+}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.h b/src/mesa/drivers/dri/nouveau/nouveau_screen.h
index bcf57e2..45b1ee9 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.h
@@ -27,6 +27,8 @@
 #ifndef __NOUVEAU_SCREEN_H__
 #define __NOUVEAU_SCREEN_H__
 
+const __DRIextension **__driDriverGetExtensions_nouveau_vieux(void);
+
 struct nouveau_context;
 
 struct nouveau_screen {




More information about the mesa-commit mailing list