Mesa (master): targets/dri-swrast: convert to gallium megadrivers :)
Emil Velikov
evelikov at kemper.freedesktop.org
Thu Jul 10 00:07:30 UTC 2014
Module: Mesa
Branch: master
Commit: f6483aa6947437c42928c879dd28d758b7d12901
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6483aa6947437c42928c879dd28d758b7d12901
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date: Sat Jun 21 13:48:52 2014 +0100
targets/dri-swrast: convert to gallium megadrivers :)
Export the approapriate new symbol, and keep backwards compat
via the megadriver_stub helper library.
Our next step would be to unify dri/drm and dri/sw, leading to
a complete megadrivers solution, and having a single library
that provides dri across all targets.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Tested-by: Rob Clark <robclark at freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard at amd.com>
---
src/gallium/Automake.inc | 2 ++
src/gallium/state_trackers/dri/common/dri_screen.h | 2 ++
src/gallium/state_trackers/dri/sw/drisw.c | 4 ++--
src/gallium/targets/dri-swrast/Makefile.am | 1 +
src/gallium/targets/dri-swrast/SConscript | 9 +++++++++
src/gallium/targets/dri-swrast/swrast_drm_api.c | 9 +++++++++
6 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index e70a136..1a21cad 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -28,6 +28,8 @@ GALLIUM_DRIVER_CXXFLAGS = \
GALLIUM_DRI_CFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/gallium/state_trackers/dri/common \
+ -I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h
index 106dcc3..63758d2 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.h
+++ b/src/gallium/state_trackers/dri/common/dri_screen.h
@@ -147,6 +147,8 @@ dri_destroy_screen(__DRIscreen * sPriv);
extern const struct __DriverAPIRec galliumdrm_driver_api;
extern const __DRIextension *galliumdrm_driver_extensions[];
+extern const struct __DriverAPIRec galliumsw_driver_api;
+extern const __DRIextension *galliumsw_driver_extensions[];
extern const __DRIconfigOptionsExtension gallium_config_options;
#endif
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 6f50b05..f1d5a06 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -397,7 +397,7 @@ drisw_create_buffer(__DRIscreen * sPriv,
*
* DRI versions differ in their implementation of init_screen and swap_buffers.
*/
-const struct __DriverAPIRec driDriverAPI = {
+const struct __DriverAPIRec galliumsw_driver_api = {
.InitScreen = drisw_init_screen,
.DestroyScreen = dri_destroy_screen,
.CreateContext = dri_create_context,
@@ -411,7 +411,7 @@ const struct __DriverAPIRec driDriverAPI = {
};
/* This is the table of extensions that the loader will dlsym() for. */
-PUBLIC const __DRIextension *__driDriverExtensions[] = {
+const __DRIextension *galliumsw_driver_extensions[] = {
&driCoreExtension.base,
&driSWRastExtension.base,
&driCopySubBufferExtension.base,
diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am
index 7db7d40..b52c4c2 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -39,6 +39,7 @@ swrast_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
swrast_dri_la_LIBADD = \
$(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/sw/libdrisw.la \
$(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript
index 029bb03..2497ec6 100644
--- a/src/gallium/targets/dri-swrast/SConscript
+++ b/src/gallium/targets/dri-swrast/SConscript
@@ -2,6 +2,14 @@ Import('*')
env = drienv.Clone()
+env.Append(CPPPATH = [
+ '#/src/loader',
+ '#/src/mapi',
+ '#/src/mesa',
+ '#/src/mesa/drivers/dri/common',
+ '#/src/gallium/state_trackers/dri/common',
+])
+
env.Prepend(LIBS = [
st_drisw,
ws_dri,
@@ -10,6 +18,7 @@ env.Prepend(LIBS = [
mesa,
glsl,
gallium,
+ megadrivers_stub,
dri_common,
])
diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c
index 3394722..102d5bd 100644
--- a/src/gallium/targets/dri-swrast/swrast_drm_api.c
+++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c
@@ -34,6 +34,15 @@
#include "state_tracker/drm_driver.h"
#include "sw/dri/dri_sw_winsys.h"
+#include "dri_screen.h"
+
+const __DRIextension **__driDriverGetExtensions_swrast(void);
+
+PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void)
+{
+ globalDriverAPI = &galliumsw_driver_api;
+ return galliumsw_driver_extensions;
+}
DRM_DRIVER_DESCRIPTOR("swrast", NULL, NULL, NULL);
More information about the mesa-commit
mailing list