gallium/radeon: add DRM and LLVM version to the renderer string
authorMarek Olšák <marek.olsak@amd.com>
Sun, 19 Jul 2015 22:15:59 +0000 (00:15 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 6 Aug 2015 20:54:03 +0000 (22:54 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h

index 79e7457a02b9cb81630fcbf49c01f0c4653ebae0..4c29f5235e18d523f20ab53edad36a0613a6c0e3 100644 (file)
@@ -365,11 +365,9 @@ static const char* r600_get_device_vendor(struct pipe_screen* pscreen)
        return "AMD";
 }
 
-static const char* r600_get_name(struct pipe_screen* pscreen)
+static const char* r600_get_chip_name(struct r600_common_screen *rscreen)
 {
-       struct r600_common_screen *rscreen = (struct r600_common_screen*)pscreen;
-
-       switch (rscreen->family) {
+       switch (rscreen->info.family) {
        case CHIP_R600: return "AMD R600";
        case CHIP_RV610: return "AMD RV610";
        case CHIP_RV630: return "AMD RV630";
@@ -409,6 +407,13 @@ static const char* r600_get_name(struct pipe_screen* pscreen)
        }
 }
 
+static const char* r600_get_name(struct pipe_screen* pscreen)
+{
+       struct r600_common_screen *rscreen = (struct r600_common_screen*)pscreen;
+
+       return rscreen->renderer_string;
+}
+
 static float r600_get_paramf(struct pipe_screen* pscreen,
                             enum pipe_capf param)
 {
@@ -868,8 +873,21 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
 bool r600_common_screen_init(struct r600_common_screen *rscreen,
                             struct radeon_winsys *ws)
 {
+       char llvm_string[32] = {};
+
        ws->query_info(ws, &rscreen->info);
 
+       if (HAVE_LLVM)
+               snprintf(llvm_string, sizeof(llvm_string),
+                        ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
+                        HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH);
+
+       snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),
+                "%s (DRM %i.%i.%i%s)",
+                r600_get_chip_name(rscreen), rscreen->info.drm_major,
+                rscreen->info.drm_minor, rscreen->info.drm_patchlevel,
+                llvm_string);
+
        rscreen->b.get_name = r600_get_name;
        rscreen->b.get_vendor = r600_get_vendor;
        rscreen->b.get_device_vendor = r600_get_device_vendor;
index 6a75c4cdb563fa5846bfd6e68d427921aca7cfed..dbd828805836a493901654cc13b7cf03d6ef767e 100644 (file)
@@ -305,6 +305,8 @@ struct r600_common_screen {
        unsigned                        gpu_load_counter_busy;
        unsigned                        gpu_load_counter_idle;
        volatile unsigned               gpu_load_stop_thread; /* bool */
+
+       char                            renderer_string[64];
 };
 
 /* This encapsulates a state or an operation which can emitted into the GPU