[gnome-session] check-accelerated: export renderer string also for llvmpipe



commit 51d1e18193f74a53e32667cf1b550f889027fdf1
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Jun 30 14:17:30 2016 -0500

    check-accelerated: export renderer string also for llvmpipe
    
    Since the renderer string is now used to display the graphics label in
    gnome-control-center, we need to make sure it gets set even if software
    rendering is in use, else we wind up showing an empty string to the
    user.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768292

 tools/gnome-session-check-accelerated-gl-helper.c |    8 +-------
 tools/gnome-session-check-accelerated.c           |   20 +++++++++++---------
 2 files changed, 12 insertions(+), 16 deletions(-)
---
diff --git a/tools/gnome-session-check-accelerated-gl-helper.c 
b/tools/gnome-session-check-accelerated-gl-helper.c
index 020f9a4..9a5d505 100644
--- a/tools/gnome-session-check-accelerated-gl-helper.c
+++ b/tools/gnome-session-check-accelerated-gl-helper.c
@@ -469,13 +469,7 @@ main (int argc, char **argv)
                 goto out;
         }
 
-        if (has_llvmpipe) {
-                _print_error ("llvmpipe detected.");
-                ret = HELPER_SOFTWARE_RENDERING;
-                goto out;
-        }
-
-        ret = HELPER_ACCEL;
+        ret = has_llvmpipe ? HELPER_SOFTWARE_RENDERING : HELPER_ACCEL;
 
         if (print_renderer)
                 g_print ("%s", renderer);
diff --git a/tools/gnome-session-check-accelerated.c b/tools/gnome-session-check-accelerated.c
index b0557b0..caade1c 100644
--- a/tools/gnome-session-check-accelerated.c
+++ b/tools/gnome-session-check-accelerated.c
@@ -182,7 +182,7 @@ main (int argc, char **argv)
                            NULL, NULL, &renderer_string, NULL, &estatus, &gl_error)) {
                 is_accelerated = (WEXITSTATUS(estatus) == HELPER_ACCEL) || (WEXITSTATUS(estatus) == 
HELPER_SOFTWARE_RENDERING);
                 is_software_rendering = (WEXITSTATUS(estatus) == HELPER_SOFTWARE_RENDERING);
-                if (is_accelerated)
+                if (is_accelerated || is_software_rendering)
                         goto finish;
 
                 g_clear_pointer (&renderer_string, g_free);
@@ -217,14 +217,6 @@ main (int argc, char **argv)
                                rootwin,
                                is_accelerated_atom,
                                XA_CARDINAL, 32, PropModeReplace, (guchar *) &is_accelerated, 1);
-
-                XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
-                               rootwin,
-                               renderer_atom,
-                               XA_STRING, 8, PropModeReplace, (guchar *) renderer_string, strlen 
(renderer_string));
-
-                /* Print the renderer */
-                g_print ("%s", renderer_string);
        }
 
        if (is_software_rendering) {
@@ -234,6 +226,16 @@ main (int argc, char **argv)
                                XA_CARDINAL, 32, PropModeReplace, (guchar *) &is_software_rendering, 1);
        }
 
+        if (is_accelerated || is_software_rendering) {
+                XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
+                               rootwin,
+                               renderer_atom,
+                               XA_STRING, 8, PropModeReplace, (guchar *) renderer_string, strlen 
(renderer_string));
+
+                /* Print the renderer */
+                g_print ("%s", renderer_string);
+        }
+
         gdk_display_sync (display);
 
         return is_accelerated ? 0 : 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]