<div dir="ltr">Do you need the DRM version number if you'll be displaying the kernel version anyway?</div><br><div class="gmail_quote"><div dir="ltr">On Wed, 25 May 2016 at 00:09 Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
<br>
Example:<br>
Gallium 0.4 on AMD TONGA (DRM 3.2.0 / 4.5.0, LLVM 3.9.0)<br>
<br>
My kernel version is pretty long already (4.5.0-amd-01025-g32791c1)<br>
and adding "kernel" into the string would make too it long for glxinfo<br>
to display.<br>
---<br>
 src/gallium/drivers/radeon/r600_pipe_common.c | 12 +++++++++---<br>
 1 file changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c<br>
index 8d9c5a5..c00e584 100644<br>
--- a/src/gallium/drivers/radeon/r600_pipe_common.c<br>
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c<br>
@@ -37,6 +37,7 @@<br>
 #include "vl/vl_video_buffer.h"<br>
 #include "radeon/radeon_video.h"<br>
 #include <inttypes.h><br>
+#include <sys/utsname.h><br>
<br>
 #ifndef HAVE_LLVM<br>
 #define HAVE_LLVM 0<br>
@@ -938,10 +939,15 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,<br>
 bool r600_common_screen_init(struct r600_common_screen *rscreen,<br>
                             struct radeon_winsys *ws)<br>
 {<br>
-       char llvm_string[32] = {};<br>
+       char llvm_string[32] = {}, kernel_version[128] = {};<br>
+       struct utsname uname_data;<br>
<br>
        ws->query_info(ws, &rscreen->info);<br>
<br>
+       if (uname(&uname_data) == 0)<br>
+               snprintf(kernel_version, sizeof(kernel_version),<br>
+                        " / %s", uname_data.release);<br>
+<br>
 #if HAVE_LLVM<br>
        snprintf(llvm_string, sizeof(llvm_string),<br>
                 ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,<br>
@@ -949,10 +955,10 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,<br>
 #endif<br>
<br>
        snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),<br>
-                "%s (DRM %i.%i.%i%s)",<br>
+                "%s (DRM %i.%i.%i%s%s)",<br>
                 r600_get_chip_name(rscreen), rscreen->info.drm_major,<br>
                 rscreen->info.drm_minor, rscreen->info.drm_patchlevel,<br>
-                llvm_string);<br>
+                kernel_version, llvm_string);<br>
<br>
        rscreen->b.get_name = r600_get_name;<br>
        rscreen->b.get_vendor = r600_get_vendor;<br>
--<br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>