target-helpers: Remove per target software wrapper check
authorJakob Bornecrantz <jakob@vmware.com>
Fri, 15 Oct 2010 14:46:10 +0000 (15:46 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 15 Oct 2010 18:13:00 +0000 (19:13 +0100)
Instead of having a NAME_SOFTWARE check just use the GALLIUM_DRIVER
instead but set the default to native which is the same as not wrapped.

src/gallium/auxiliary/target-helpers/inline_sw_helper.h
src/gallium/auxiliary/target-helpers/inline_wrapper_sw_helper.h
src/gallium/targets/dri-i915/target.c
src/gallium/targets/dri-i965/target.c
src/gallium/targets/egl/pipe_i965.c
src/gallium/targets/xorg-i965/intel_target.c

index 036c1ee48a868f3753777ca5c81088b71427fac7..34bfa527db0c99a1179a2a8fdaa0ae7835ea505e 100644 (file)
 #include "cell/ppu/cell_public.h"
 #endif
 
+
 static INLINE struct pipe_screen *
-sw_screen_create(struct sw_winsys *winsys)
+sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
 {
-   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);
@@ -60,4 +47,26 @@ sw_screen_create(struct sw_winsys *winsys)
    return screen;
 }
 
+
+static INLINE struct pipe_screen *
+sw_screen_create(struct sw_winsys *winsys)
+{
+   const char *default_driver;
+   const char *driver;
+
+#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);
+   return sw_screen_create_named(winsys, driver);
+}
+
+
 #endif
index f27e34a3002d1f3d23693f278750185f29d7af34..e4effa713e9ff8f9f9291ea99ef494ed9c1b478c 100644 (file)
@@ -13,14 +13,20 @@ static INLINE struct pipe_screen *
 sw_screen_wrap(struct pipe_screen *screen)
 {
    struct sw_winsys *sws;
-   struct pipe_screen *sw_screen;
+   struct pipe_screen *sw_screen = NULL;
+   const char *driver;
+
+   driver = debug_get_option("GALLIUM_DRIVER", "native");
+   if (strcmp(driver, "native") == 0)
+      return screen;
 
    sws = wrapper_sw_winsys_wrap_pipe_screen(screen);
    if (!sws)
       goto err;
 
-   sw_screen = sw_screen_create(sws);
-   if (sw_screen == screen)
+   sw_screen = sw_screen_create_named(sws, driver);
+
+   if (!sw_screen)
       goto err_winsys;
 
    return sw_screen;
index 5ae6ca367d849b5dce98b33b427926703bce79f2..a27b7bd6d810010767426dfa0e960c443b837a35 100644 (file)
@@ -19,8 +19,7 @@ create_screen(int fd)
    if (!screen)
       return NULL;
 
-   if (debug_get_bool_option("I915_SOFTWARE", FALSE))
-      screen = sw_screen_wrap(screen);
+   screen = sw_screen_wrap(screen);
 
    screen = debug_screen_wrap(screen);
 
index ce97f8202780ea49d20e1fe1ead76300d66a2a50..0632b97beaacaa8282b6f151ad8067f9e189e05a 100644 (file)
@@ -19,8 +19,7 @@ create_screen(int fd)
    if (!screen)
       return NULL;
 
-   if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
-      screen = sw_screen_wrap(screen);
+   screen = sw_screen_wrap(screen);
 
    screen = debug_screen_wrap(screen);
 
index ae452128b0b8e85820d5edb5d61a31ee94b32f22..6b886fb3f149e9e864077671fb11f3cba28a384f 100644 (file)
@@ -18,8 +18,7 @@ create_screen(int fd)
    if (!screen)
       return NULL;
 
-   if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
-      screen = sw_screen_wrap(screen);
+   screen = sw_screen_wrap(screen);
 
    screen = debug_screen_wrap(screen);
 
index ce97f8202780ea49d20e1fe1ead76300d66a2a50..0632b97beaacaa8282b6f151ad8067f9e189e05a 100644 (file)
@@ -19,8 +19,7 @@ create_screen(int fd)
    if (!screen)
       return NULL;
 
-   if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
-      screen = sw_screen_wrap(screen);
+   screen = sw_screen_wrap(screen);
 
    screen = debug_screen_wrap(screen);