diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2016-11-20 14:41:42 -0500 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-11-21 22:21:50 +0800 |
commit | bcec25eb02ca7c98aad5d573f88a3b05419b93ec (patch) | |
tree | 5e9b1d9d3ad731cea40e697d67e35b967c265e44 | |
parent | efc8d00e4dbe3387db60c3d127b52e0d613ca54d (diff) |
Query the kernel API to check the EU counts of GPU device
This info can be used to configure the max EU threads of GPU device.
>eu_total * 6
V2->V3: Refresh the patches again.
V1->V2: Remove the extra bit_field of has_eu_flag. Instead the eu_total > 0
can be used.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Charles Daniel <daniel.charles@intel.com>
-rw-r--r-- | src/intel_driver.c | 11 | ||||
-rw-r--r-- | src/intel_driver.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index bb19401..67d7de1 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -50,6 +50,12 @@ uint32_t g_intel_debug_option_flags = 0; #define LOCAL_I915_PARAM_HAS_HUC 42 #endif +#ifdef I915_PARAM_EU_TOTAL +#define LOCAL_I915_PARAM_EU_TOTAL I915_PARAM_EU_TOTAL +#else +#define LOCAL_I915_PARAM_EU_TOTAL 34 +#endif + static Bool intel_driver_get_param(struct intel_driver_data *intel, int param, int *value) { @@ -142,6 +148,11 @@ intel_driver_init(VADriverContextP ctx) if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC, &ret_value)) intel->has_huc = !!ret_value; + intel->eu_total = 0; + if (intel_driver_get_param(intel, LOCAL_I915_PARAM_EU_TOTAL, &ret_value)) { + intel->eu_total = ret_value; + } + intel_driver_get_revid(intel, &intel->revision); return true; } diff --git a/src/intel_driver.h b/src/intel_driver.h index 4ff707d..036e150 100644 --- a/src/intel_driver.h +++ b/src/intel_driver.h @@ -189,6 +189,8 @@ struct intel_driver_data 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? */ + int eu_total; + const struct intel_device_info *device_info; }; |