From 544ef50a6e7019d918f79748043ace7e77bc34a7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 8 Dec 2010 16:15:26 +0000 Subject: [PATCH] drm/i915: Use PM QoS to prevent C-state memory starvation of the GPU --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d9b54a2..4675f6d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -35,6 +35,7 @@ #include "intel_ringbuffer.h" #include #include +#include #include /* General customization: @@ -659,6 +660,7 @@ typedef struct drm_i915_private { int lvds_downclock; struct work_struct idle_work; struct timer_list idle_timer; + struct pm_qos_request_list pm_qos; bool busy; u16 orig_clock; int child_dev_num; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e213529..128020a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4765,6 +4765,8 @@ static void intel_gpu_idle_timer(unsigned long arg) return; } + pm_qos_remove_request(&dev_priv->pm_qos); + dev_priv->busy = false; queue_work(dev_priv->wq, &dev_priv->idle_work); } @@ -4940,6 +4942,12 @@ void intel_mark_busy(struct drm_device *dev, struct drm_i915_gem_object *obj) fw_blc_self &= ~FW_BLC_SELF_EN; I915_WRITE(FW_BLC_SELF, fw_blc_self | FW_BLC_SELF_EN_MASK); } + + /* Install a handle to prevent C-state starvation of the GPU */ + pm_qos_add_request(&dev_priv->pm_qos, + PM_QOS_CPU_DMA_LATENCY, + 20); + dev_priv->busy = true; } else mod_timer(&dev_priv->idle_timer, jiffies + -- 1.7.2.3