From: Ben Widawsky <bwida...@gmail.com>

Parameters tell user space if contexts are available.

Signed-off-by: Ben Widawsky <b...@bwidawsk.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodo...@intel.com>
Reviewed-by: Eric Anholt <e...@anholt.net>
---
 drivers/gpu/drm/i915/i915_dma.c |    3 +++
 include/drm/i915_drm.h          |    1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index fb3fccb..07d4b96 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -781,6 +781,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
        case I915_PARAM_HAS_RELAXED_DELTA:
                value = 1;
                break;
+       case I915_PARAM_HAS_CONTEXTS:
+               value = dev_priv->hw_contexts_disabled ? 0 : 1;
+               break;
        case I915_PARAM_HAS_GEN7_SOL_RESET:
                value = 1;
                break;
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 03d159f..dd985e1 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -302,6 +302,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_RELAXED_DELTA    15
 #define I915_PARAM_HAS_GEN7_SOL_RESET   16
 #define I915_PARAM_HAS_LLC              17
+#define I915_PARAM_HAS_CONTEXTS                 18
 
 typedef struct drm_i915_getparam {
        int param;
-- 
1.7.9.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to