st/dri/drm: remove __driDriverExtensions and driDriverAPI
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 27 Jun 2014 18:30:38 +0000 (19:30 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 10 Jul 2014 00:06:48 +0000 (01:06 +0100)
... and use libmegadriver_stub as their provider.
Teach scons how to build the library archive and use it.

v2: scons: fix build on a drm-less system.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/state_trackers/dri/drm/dri2.c
src/gallium/targets/dri/Makefile.am
src/gallium/targets/dri/SConscript
src/mesa/drivers/dri/common/SConscript

index 1d26522ca966cdd7bbfe224834fef52a45c623b9..f6a4fe679f33883bb3527866dfaf23570fa5208c 100644 (file)
@@ -1328,20 +1328,6 @@ dri2_create_buffer(__DRIscreen * sPriv,
  *
  * DRI versions differ in their implementation of init_screen and swap_buffers.
  */
-const struct __DriverAPIRec driDriverAPI = {
-   .InitScreen = dri2_init_screen,
-   .DestroyScreen = dri_destroy_screen,
-   .CreateContext = dri_create_context,
-   .DestroyContext = dri_destroy_context,
-   .CreateBuffer = dri2_create_buffer,
-   .DestroyBuffer = dri_destroy_buffer,
-   .MakeCurrent = dri_make_current,
-   .UnbindContext = dri_unbind_context,
-
-   .AllocateBuffer = dri2_allocate_buffer,
-   .ReleaseBuffer  = dri2_release_buffer,
-};
-
 const struct __DriverAPIRec galliumdrm_driver_api = {
    .InitScreen = dri2_init_screen,
    .DestroyScreen = dri_destroy_screen,
@@ -1357,14 +1343,6 @@ const struct __DriverAPIRec galliumdrm_driver_api = {
 };
 
 /* This is the table of extensions that the loader will dlsym() for. */
-PUBLIC const __DRIextension *__driDriverExtensions[] = {
-    &driCoreExtension.base,
-    &driImageDriverExtension.base,
-    &driDRI2Extension.base,
-    &gallium_config_options.base,
-    NULL
-};
-
 const __DRIextension *galliumdrm_driver_extensions[] = {
     &driCoreExtension.base,
     &driImageDriverExtension.base,
index 090103e581b7e93c949f111e3f5d554416ec941c..fd19d65275f231dd63cbe1e27382ea576cac0382 100644 (file)
@@ -37,6 +37,7 @@ endif # HAVE_LD_VERSION_SCRIPT
 gallium_dri_la_LIBADD = \
        $(top_builddir)/src/mesa/libmesagallium.la \
        $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
+       $(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
        $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
index 5b5ddc6a25b86da65fbedf6f5bf7726059ca0cb6..a78a1b11793c917626aaf401f101a6b93aca1f06 100644 (file)
@@ -34,6 +34,7 @@ env.Prepend(LIBS = [
     mesa,
     glsl,
     gallium,
+    megadrivers_stub,
     COMMON_DRI_DRM_OBJECTS
 ])
 
index 41f6356c32d65bd81b46e0e72fe53694c29e7e5a..2763380cd8ac799418812f2e810a176d50f409b1 100644 (file)
@@ -76,9 +76,36 @@ driswenv.AppendUnique(LIBS = [
     'expat',
 ])
 
+#
+# megadrivers_stub
+#
+env = env.Clone()
+
+env.Append(CPPPATH = [
+    '#/include',
+    '#/src/',
+    '#/src/mapi',
+    '#/src/mesa',
+])
+
+env.Append(CPPDEFINES = [
+    '__NOT_HAVE_DRM_H',
+    'HAVE_DLADDR',
+])
+
+sources = env.ParseSourceList('Makefile.sources', 'megadriver_stub_FILES')
+
+megadrivers_stub = env.ConvenienceLibrary(
+       target = 'megadrivers_stub',
+       source = sources,
+)
+
+env.Alias('megadrivers_stub', megadrivers_stub)
+
 Export([
     'drienv',
     'driswenv',
     'COMMON_DRI_SW_OBJECTS',
     'COMMON_DRI_DRM_OBJECTS',
+    'megadrivers_stub',
 ])