Mesa (master): radeong: Automatically softpipe for non-r3xx.

Corbin Simpson csimpson at kemper.freedesktop.org
Sun Dec 6 23:57:14 PST 2009


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

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Sun Dec  6 23:55:58 2009 -0800

radeong: Automatically softpipe for non-r3xx.

Well, technically non-r[345]xx. At any rate...

$ glxgears
libGL: OpenDriver: trying /home/simpson/mesa/lib/gallium/r600_dri.so
131 frames in 5.0 seconds = 26.107 FPS

I'm sure you can see where this is going. :3

---

 src/gallium/winsys/drm/radeon/core/radeon_drm.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
index bc66b42..dec7c06 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
@@ -109,14 +109,15 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api,
                                          int drmFB,
                                          struct drm_create_screen_arg *arg)
 {
-    struct radeon_winsys* winsys = radeon_pipe_winsys(drmFB);
-    do_ioctls(drmFB, winsys);
+    struct radeon_winsys* rwinsys = radeon_pipe_winsys(drmFB);
+    do_ioctls(drmFB, rwinsys);
 
-    if (debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
-        return softpipe_create_screen((struct pipe_winsys*)winsys);
+    if (!is_r3xx(rwinsys->pci_id) ||
+        debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
+        return softpipe_create_screen((struct pipe_winsys*)rwinsys);
     } else {
-        radeon_setup_winsys(drmFB, winsys);
-        return r300_create_screen(winsys);
+        radeon_setup_winsys(drmFB, rwinsys);
+        return r300_create_screen(rwinsys);
     }
 }
 
@@ -124,11 +125,13 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api,
 struct pipe_context* radeon_create_context(struct drm_api* api,
                                            struct pipe_screen* screen)
 {
-    if (debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
+    struct radeon_winsys* rwinsys = (struct radeon_winsys*)screen->winsys;
+
+    if (!is_r3xx(rwinsys->pci_id) ||
+        debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
         return softpipe_create(screen);
     } else {
-        return r300_create_context(screen,
-                                   (struct radeon_winsys*)screen->winsys);
+        return r300_create_context(screen, rwinsys);
     }
 }
 



More information about the mesa-commit mailing list