aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-08 05:23:22 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-08 08:29:12 -0400
commit2fedbff948cf5bc1e9977b7bc885aae45bd32f74 (patch)
tree2fb434867abb4bff322fd8e34a7ce9039a9e820f
parent6c6cf5aa9c583478b19e23149feaa92d01fb8c2d (diff)
drm/i915: Add I915_GEM_PARAM_HAS_SEMAPHORES
Userspace tries to estimate the cost of ring switching based on whether the GPU and GEM supports semaphores. (If we have multiple rings and no semaphores, userspace assumes that the cost of switching rings between batches is exorbitant and will endeavour to keep the next batch on the active ring - as a coarse approximation to tracking both destination and source surfaces.) Currently userspace has to guess whether semaphores exist based on the chipset generation and the module parameter, i915.semaphores. This is a crude and inaccurate guess as the defaults internally depend upon other chipset features being enabled or disabled, nor does it extend well into the future. By exporting a HAS_SEMAPHORES parameter, we can easily query the driver and obtain an accurate answer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c3
-rw-r--r--include/drm/i915_drm.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 71672cee00f7..d57ea1672134 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1009,6 +1009,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
1009 case I915_PARAM_HAS_WAIT_TIMEOUT: 1009 case I915_PARAM_HAS_WAIT_TIMEOUT:
1010 value = 1; 1010 value = 1;
1011 break; 1011 break;
1012 case I915_PARAM_HAS_SEMAPHORES:
1013 value = i915_semaphore_is_enabled(dev);
1014 break;
1012 default: 1015 default:
1013 DRM_DEBUG_DRIVER("Unknown parameter %d\n", 1016 DRM_DEBUG_DRIVER("Unknown parameter %d\n",
1014 param->param); 1017 param->param);
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 772b0d638912..d8a79bf59ae7 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -311,6 +311,7 @@ typedef struct drm_i915_irq_wait {
311#define I915_PARAM_HAS_LLC 17 311#define I915_PARAM_HAS_LLC 17
312#define I915_PARAM_HAS_ALIASING_PPGTT 18 312#define I915_PARAM_HAS_ALIASING_PPGTT 18
313#define I915_PARAM_HAS_WAIT_TIMEOUT 19 313#define I915_PARAM_HAS_WAIT_TIMEOUT 19
314#define I915_PARAM_HAS_SEMAPHORES 20
314 315
315typedef struct drm_i915_getparam { 316typedef struct drm_i915_getparam {
316 int param; 317 int param;