mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 11:10:10 +01:00
gallium/radeon: add the kernel version into the renderer string
Example: Gallium 0.4 on AMD TONGA (DRM 3.2.0 / 4.5.0, LLVM 3.9.0) My kernel version is pretty long already (4.5.0-amd-01025-g32791c1) and adding "kernel" into the string would make too it long for glxinfo to display. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
53f33619a4
commit
8539c9bf31
1 changed files with 9 additions and 3 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
#include "vl/vl_video_buffer.h"
|
#include "vl/vl_video_buffer.h"
|
||||||
#include "radeon/radeon_video.h"
|
#include "radeon/radeon_video.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
#ifndef HAVE_LLVM
|
#ifndef HAVE_LLVM
|
||||||
#define HAVE_LLVM 0
|
#define HAVE_LLVM 0
|
||||||
|
|
@ -938,10 +939,15 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
|
||||||
bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||||
struct radeon_winsys *ws)
|
struct radeon_winsys *ws)
|
||||||
{
|
{
|
||||||
char llvm_string[32] = {};
|
char llvm_string[32] = {}, kernel_version[128] = {};
|
||||||
|
struct utsname uname_data;
|
||||||
|
|
||||||
ws->query_info(ws, &rscreen->info);
|
ws->query_info(ws, &rscreen->info);
|
||||||
|
|
||||||
|
if (uname(&uname_data) == 0)
|
||||||
|
snprintf(kernel_version, sizeof(kernel_version),
|
||||||
|
" / %s", uname_data.release);
|
||||||
|
|
||||||
#if HAVE_LLVM
|
#if HAVE_LLVM
|
||||||
snprintf(llvm_string, sizeof(llvm_string),
|
snprintf(llvm_string, sizeof(llvm_string),
|
||||||
", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
|
", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
|
||||||
|
|
@ -949,10 +955,10 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),
|
snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string),
|
||||||
"%s (DRM %i.%i.%i%s)",
|
"%s (DRM %i.%i.%i%s%s)",
|
||||||
r600_get_chip_name(rscreen), rscreen->info.drm_major,
|
r600_get_chip_name(rscreen), rscreen->info.drm_major,
|
||||||
rscreen->info.drm_minor, rscreen->info.drm_patchlevel,
|
rscreen->info.drm_minor, rscreen->info.drm_patchlevel,
|
||||||
llvm_string);
|
kernel_version, llvm_string);
|
||||||
|
|
||||||
rscreen->b.get_name = r600_get_name;
|
rscreen->b.get_name = r600_get_name;
|
||||||
rscreen->b.get_vendor = r600_get_vendor;
|
rscreen->b.get_vendor = r600_get_vendor;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue