@@ -35,6 +35,7 @@
#include "intel_ringbuffer.h"
#include <linux/io-mapping.h>
#include <linux/i2c.h>
+#include <linux/pm_qos_params.h>
#include <drm/intel-gtt.h>
/* 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;
@@ -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 +