From 4b6493021bc664183aa8af82f96421f21e3ea9cd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 May 2012 14:24:47 +0100 Subject: [PATCH] drm/i915: Bump the CPU to C0 to ensure that we have left rc6 As part of the extended forcewake dance, we need this workaround of raising the CPU to C0 to be sure that we have left rc6. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index d3e1948..2fba381 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -36,6 +36,7 @@ #include #include +#include #include "drm_crtc_helper.h" static int i915_modeset __read_mostly = -1; @@ -423,6 +424,17 @@ bool i915_semaphore_is_enabled(struct drm_device *dev) return 1; } +static void bump_cpu_c0(struct drm_i915_private *dev_priv) +{ + struct pm_qos_request rq; + + /* w/a: we need for the CPU to be in C0 to be sure we are out of rc6 */ + memset(&rq, 0, sizeof(rq)); + pm_qos_add_request(&rq, PM_QOS_CPU_DMA_LATENCY, 0); + flush_delayed_work_sync(&rq.work); + pm_qos_remove_request(&rq); +} + void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) { int count; @@ -437,6 +449,8 @@ void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) count = 0; while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1) == 0) udelay(10); + + bump_cpu_c0(dev_priv); } void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv) @@ -453,6 +467,8 @@ void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv) count = 0; while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_MT_ACK) & 1) == 0) udelay(10); + + bump_cpu_c0(dev_priv); } /* -- 1.7.10