[Intel-gfx] [PATCH 15/18] drm/i915/context: add params

Ben Widawsky ben at bwidawsk.net
Sun Mar 18 21:39:55 CET 2012


From: Ben Widawsky <bwidawsk at gmail.com>

Parameters tell user space if contexts are available.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
Reviewed-by: Eric Anholt <eric at 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




More information about the Intel-gfx mailing list