[Libva] [Libva-intel-driver][PATCH 1/2] Check whether there is a fully loaded HuC firmware

Xiang, Haihao haihao.xiang at intel.com
Wed Sep 28 00:42:00 UTC 2016


Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/intel_driver.c | 12 ++++++++++++
 src/intel_driver.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
 #define LOCAL_I915_PARAM_HAS_BSD2	30
 #endif
 
+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
 static Bool
 intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
 {
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
     if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2, &ret_value))
         intel->has_bsd2 = !!ret_value;
 
+    intel->has_huc = 0;
+    ret_value = 0;
+
+    if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC, &ret_value))
+        intel->has_huc = !!ret_value;
+
     intel_driver_get_revid(intel, &intel->revision);
     return true;
 }
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
     unsigned int has_blt    : 1; /* Flag: has BLT unit? */
     unsigned int has_vebox  : 1; /* Flag: has VEBOX unit */
     unsigned int has_bsd2   : 1; /* Flag: has the second BSD video ring unit */
+    unsigned int has_huc    : 1; /* Flag: has a fully loaded HuC firmware? */
 
     const struct intel_device_info *device_info;
 };
-- 
1.9.1



More information about the Libva mailing list