[Mesa-dev] [PATCH 2/2] st/va: Make the vendor string more descriptive

Mark Thompson sw at jkqxz.net
Wed Feb 7 23:15:05 UTC 2018


Include the Mesa version and detail about the platform.

Signed-off-by: Mark Thompson <sw at jkqxz.net>
---
This gives:

$ vainfo --display drm --device /dev/dri/renderD128
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.1.pre1)
vainfo: Driver version: Mesa Gallium driver 18.1.0-devel for AMD Radeon (TM) RX 460 Graphics (POLARIS11 / DRM 3.19.0 / 4.14.0-3-amd64, LLVM 4.0.1)

Compare with:

$ vainfo --display drm --device /dev/dri/renderD129
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.1.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.1.1.pre1 (2.0.0-122-gd1453b5)


The name above is 122 characters, so the fixed array is set to 256 bytes to allow double that before truncation.  Given the sizes involved I don't think there is much reason to allocate it separately to be smaller.


 src/gallium/state_trackers/va/context.c    | 6 +++++-
 src/gallium/state_trackers/va/va_private.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 189d361ff3..836aa77c36 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -181,7 +181,11 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
    ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
    ctx->max_subpic_formats = 1;
    ctx->max_display_attributes = 1;
-   ctx->str_vendor = "mesa gallium vaapi";
+
+   snprintf(drv->vendor_string, sizeof(drv->vendor_string),
+            "Mesa Gallium driver " PACKAGE_VERSION " for %s",
+            drv->vscreen->pscreen->get_name(drv->vscreen->pscreen));
+   ctx->str_vendor = drv->vendor_string;
 
    return VA_STATUS_SUCCESS;
 
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index 11b208c4b3..4396abb586 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -233,6 +233,7 @@ typedef struct {
    struct vl_compositor_state cstate;
    vl_csc_matrix csc;
    mtx_t mutex;
+   char vendor_string[256];
 } vlVaDriver;
 
 typedef struct {
-- 
2.15.1


More information about the mesa-dev mailing list