Mesa (gallium-drm-driver-descriptor): swrastg: Use target-helpers

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Thu Jun 24 00:20:42 UTC 2010


Module: Mesa
Branch: gallium-drm-driver-descriptor
Commit: 44c64596d17423dc560434dcbd209997d87b2a29
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=44c64596d17423dc560434dcbd209997d87b2a29

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Thu Jun 24 00:44:53 2010 +0200

swrastg: Use target-helpers

---

 src/gallium/targets/dri-swrast/Makefile         |    4 +-
 src/gallium/targets/dri-swrast/SConscript       |    6 ++-
 src/gallium/targets/dri-swrast/swrast_drm_api.c |   57 ++---------------------
 3 files changed, 13 insertions(+), 54 deletions(-)

diff --git a/src/gallium/targets/dri-swrast/Makefile b/src/gallium/targets/dri-swrast/Makefile
index 0a53eb5..948c45a 100644
--- a/src/gallium/targets/dri-swrast/Makefile
+++ b/src/gallium/targets/dri-swrast/Makefile
@@ -3,7 +3,9 @@ include $(TOP)/configs/current
 
 LIBNAME = swrastg_dri.so
 
-DRIVER_DEFINES = -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE
+DRIVER_DEFINES = \
+	-D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE \
+	-DGALLIUM_RBUG -DGALLIUM_TRACE
 
 PIPE_DRIVERS = \
 	$(TOP)/src/gallium/state_trackers/dri/sw/libdrisw.a \
diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript
index 679afab..d814347 100644
--- a/src/gallium/targets/dri-swrast/SConscript
+++ b/src/gallium/targets/dri-swrast/SConscript
@@ -18,7 +18,11 @@ env.Prepend(LIBS = [
 ])
 
 if True:
-    env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
+    env.Append(CPPDEFINES = [
+        'GALLIUM_SOFTPIPE',
+        'GALLIUM_RBUG',
+        'GALLIUM_TRACE',
+    ])
     env.Prepend(LIBS = [softpipe])
 
 if env['llvm']:
diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c
index ddf7840..8d741c6 100644
--- a/src/gallium/targets/dri-swrast/swrast_drm_api.c
+++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c
@@ -28,60 +28,11 @@
 
 #include "pipe/p_compiler.h"
 #include "util/u_memory.h"
-#include "state_tracker/sw_winsys.h"
 #include "dri_sw_winsys.h"
-#include "trace/tr_public.h"
 
-/* Copied from targets/libgl-xlib */
+#include "target-helpers/inline_debug_helper.h"
+#include "target-helpers/inline_sw_helper.h"
 
-#ifdef GALLIUM_SOFTPIPE
-#include "softpipe/sp_public.h"
-#endif
-
-#ifdef GALLIUM_LLVMPIPE
-#include "llvmpipe/lp_public.h"
-#endif
-
-#ifdef GALLIUM_CELL
-#include "cell/ppu/cell_public.h"
-#endif
-
-static struct pipe_screen *
-swrast_create_screen(struct sw_winsys *winsys)
-{
-   const char *default_driver;
-   const char *driver;
-   struct pipe_screen *screen = NULL;
-
-#if defined(GALLIUM_CELL)
-   default_driver = "cell";
-#elif defined(GALLIUM_LLVMPIPE)
-   default_driver = "llvmpipe";
-#elif defined(GALLIUM_SOFTPIPE)
-   default_driver = "softpipe";
-#else
-   default_driver = "";
-#endif
-
-   driver = debug_get_option("GALLIUM_DRIVER", default_driver);
-
-#if defined(GALLIUM_CELL)
-   if (screen == NULL && strcmp(driver, "cell") == 0)
-      screen = cell_create_screen( winsys );
-#endif
-
-#if defined(GALLIUM_LLVMPIPE)
-   if (screen == NULL && strcmp(driver, "llvmpipe") == 0)
-      screen = llvmpipe_create_screen( winsys );
-#endif
-
-#if defined(GALLIUM_SOFTPIPE)
-   if (screen == NULL)
-      screen = softpipe_create_screen( winsys );
-#endif
-
-   return trace_screen_create(screen);;
-}
 
 struct pipe_screen *
 drisw_create_screen(struct drisw_loader_funcs *lf)
@@ -93,10 +44,12 @@ drisw_create_screen(struct drisw_loader_funcs *lf)
    if (winsys == NULL)
       return NULL;
 
-   screen = swrast_create_screen(winsys);
+   screen = sw_screen_create(winsys);
    if (!screen)
       goto fail;
 
+   screen = debug_screen_wrap(screen);
+
    return screen;
 
 fail:




More information about the mesa-commit mailing list