[Intel-gfx] [PATCH 1/2] drm/i915: Give simulator a way to skip forcewake

Ben Widawsky ben at bwidawsk.net
Fri Jul 20 19:43:29 CEST 2012


Forcewake isn't implemented on the simulator, and doing the dance is
problematic. I haven't really root-caused it, but something in the chain
detects the polling of the ack register, and the system grinds to a
halt.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_drv.h | 2 ++
 drivers/gpu/drm/i915/intel_pm.c | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index da1d33d..7a66f0a 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -846,6 +846,8 @@ typedef struct drm_i915_private {
 	struct work_struct parity_error_work;
 	bool hw_contexts_disabled;
 	uint32_t hw_context_size;
+
+	bool is_simulator;
 } drm_i915_private_t;
 
 /* Iterate over initialised rings */
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 18c14d7..c436ea6 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4118,6 +4118,8 @@ static void vlv_force_wake_put(struct drm_i915_private *dev_priv)
 	POSTING_READ(FORCEWAKE_VLV);
 }
 
+static void null_wake(struct drm_i915_private *dev_priv) { }
+
 void intel_gt_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4127,6 +4129,9 @@ void intel_gt_init(struct drm_device *dev)
 	if (IS_VALLEYVIEW(dev)) {
 		dev_priv->gt.force_wake_get = vlv_force_wake_get;
 		dev_priv->gt.force_wake_put = vlv_force_wake_put;
+	} else if (dev_priv->is_simulator) {
+		dev_priv->gt.force_wake_get = null_wake;
+		dev_priv->gt.force_wake_put = null_wake;
 	} else if (INTEL_INFO(dev)->gen >= 6) {
 		dev_priv->gt.force_wake_get = __gen6_gt_force_wake_get;
 		dev_priv->gt.force_wake_put = __gen6_gt_force_wake_put;
-- 
1.7.11.2




More information about the Intel-gfx mailing list