aboutsummaryrefslogtreecommitdiffstats
path: root/intel
diff options
context:
space:
mode:
authorYang Rong2016-08-02 02:50:34 -0500
committerChris Wilson2016-09-07 07:50:23 -0500
commit98887140e343493f01be7a1dec721c024bcf72c7 (patch)
tree1527e4ad88154c9225ddcd848736dd57ec0fba67 /intel
parenta625ba8d2d4da33bd6d7bb057d2bdf7cb484fd6c (diff)
downloadexternal-libgbm-98887140e343493f01be7a1dec721c024bcf72c7.tar.gz
external-libgbm-98887140e343493f01be7a1dec721c024bcf72c7.tar.xz
external-libgbm-98887140e343493f01be7a1dec721c024bcf72c7.zip
intel: Export pooled EU and min no. of eus in a pool.
Update kernel interface with new I915_GETPARAM ioctl entries for pooled EU and min no. of eus in a pool. Add a wrapping function for each parameter. Userspace drivers need these values when decide the thread count. This kernel enabled pooled eu by default for BXT and for fused down 2x6 parts it is advised to turn it off. But there is another HW issue in these parts (fused down 2x6 parts) before C0 that requires Pooled EU to be enabled as a workaround. In this case the pool configuration changes depending upon which subslice is disabled and the no. of eus in a pool is different, So userspace need to know min no. of eus in a pool. V2: use return value as the query results. ret < 0 when error, ret = 0 when not support, and ret > 0 indicate query results.(Chris) V3: Correct V2 errors. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'intel')
-rw-r--r--intel/intel_bufmgr.h3
-rw-r--r--intel/intel_bufmgr_gem.c30
2 files changed, 33 insertions, 0 deletions
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index a1abbcd2..96a4d9d3 100644
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
@@ -273,6 +273,9 @@ int drm_intel_get_reset_stats(drm_intel_context *ctx,
273int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total); 273int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
274int drm_intel_get_eu_total(int fd, unsigned int *eu_total); 274int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
275 275
276int drm_intel_get_pooled_eu(int fd);
277int drm_intel_get_min_eu_in_pool(int fd);
278
276/** @{ Compatibility defines to keep old code building despite the symbol rename 279/** @{ Compatibility defines to keep old code building despite the symbol rename
277 * from dri_* to drm_intel_* 280 * from dri_* to drm_intel_*
278 */ 281 */
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 0a4012be..e6c251af 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3237,6 +3237,36 @@ drm_intel_get_eu_total(int fd, unsigned int *eu_total)
3237 return 0; 3237 return 0;
3238} 3238}
3239 3239
3240int
3241drm_intel_get_pooled_eu(int fd)
3242{
3243 drm_i915_getparam_t gp;
3244 int ret = -1;
3245
3246 memclear(gp);
3247 gp.param = I915_PARAM_HAS_POOLED_EU;
3248 gp.value = &ret;
3249 if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
3250 return -errno;
3251
3252 return ret;
3253}
3254
3255int
3256drm_intel_get_min_eu_in_pool(int fd)
3257{
3258 drm_i915_getparam_t gp;
3259 int ret = -1;
3260
3261 memclear(gp);
3262 gp.param = I915_PARAM_MIN_EU_IN_POOL;
3263 gp.value = &ret;
3264 if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
3265 return -errno;
3266
3267 return ret;
3268}
3269
3240/** 3270/**
3241 * Annotate the given bo for use in aub dumping. 3271 * Annotate the given bo for use in aub dumping.
3242 * 3272 *