Add correct version info for vaQueryVendorString().
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 25 Aug 2011 09:54:20 +0000 (11:54 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 25 Aug 2011 12:28:40 +0000 (14:28 +0200)
src/i965_drv_video.c
src/i965_drv_video.h

index e788bc5..906dfed 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include "config.h"
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
@@ -2540,7 +2541,6 @@ VA_DRIVER_INIT_FUNC(  VADriverContextP ctx )
     ctx->max_image_formats = I965_MAX_IMAGE_FORMATS;
     ctx->max_subpic_formats = I965_MAX_SUBPIC_FORMATS;
     ctx->max_display_attributes = I965_MAX_DISPLAY_ATTRIBUTES;
-    ctx->str_vendor = I965_STR_VENDOR;
 
     vtable->vaTerminate = i965_Terminate;
     vtable->vaQueryConfigEntrypoints = i965_QueryConfigEntrypoints;
@@ -2621,6 +2621,19 @@ VA_DRIVER_INIT_FUNC(  VADriverContextP ctx )
                               sizeof(struct object_subpic), 
                               SUBPIC_ID_OFFSET);
     assert(result == 0);
-    
+
+    sprintf(i965->va_vendor, "%s %s driver - %d.%d.%d",
+            INTEL_STR_DRIVER_VENDOR,
+            INTEL_STR_DRIVER_NAME,
+            INTEL_DRIVER_MAJOR_VERSION,
+            INTEL_DRIVER_MINOR_VERSION,
+            INTEL_DRIVER_MICRO_VERSION);
+
+    if (INTEL_DRIVER_PRE_VERSION > 0) {
+        const int len = strlen(i965->va_vendor);
+        sprintf(&i965->va_vendor[len], ".pre%d", INTEL_DRIVER_PRE_VERSION);
+    }
+    ctx->str_vendor = i965->va_vendor;
+
     return i965_Init(ctx);
 }
index fd423bc..ac77b19 100644 (file)
@@ -43,7 +43,9 @@
 #define I965_MAX_IMAGE_FORMATS                  3
 #define I965_MAX_SUBPIC_FORMATS                 4
 #define I965_MAX_DISPLAY_ATTRIBUTES             4
-#define I965_STR_VENDOR                         "i965 Driver 0.1"
+
+#define INTEL_STR_DRIVER_VENDOR                 "Intel"
+#define INTEL_STR_DRIVER_NAME                   "i965"
 
 struct i965_kernel 
 {
@@ -218,6 +220,7 @@ struct i965_driver_data
     struct intel_batchbuffer *batch;
     struct i965_render_state render_state;
     void *pp_context;
+    char va_vendor[256];
 };
 
 #define NEW_CONFIG_ID() object_heap_allocate(&i965->config_heap);