Commit d0bc54f2 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Introduce DRM_I915_THROTTLE_JIFFIES

As Daniel commented on

commit b7ffe1362c5f468b853223acc9268804aa92afc8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Apr 27 13:41:24 2015 +0100

    drm/i915: Free RPS boosts for all laggards

it is better to be explicit when sharing hardcoded values such as
throttle/boost timeouts. Make it so!
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9a0c1e27
...@@ -279,6 +279,12 @@ struct drm_i915_file_private { ...@@ -279,6 +279,12 @@ struct drm_i915_file_private {
struct { struct {
spinlock_t lock; spinlock_t lock;
struct list_head request_list; struct list_head request_list;
/* 20ms is a fairly arbitrary limit (greater than the average frame time)
* chosen to prevent the CPU getting more than a frame ahead of the GPU
* (when using lax throttling for the frontbuffer). We also use it to
* offer free GPU waitboosts for severely congested workloads.
*/
#define DRM_I915_THROTTLE_JIFFIES msecs_to_jiffies(20)
} mm; } mm;
struct idr context_idr; struct idr context_idr;
......
...@@ -4239,7 +4239,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file) ...@@ -4239,7 +4239,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_file_private *file_priv = file->driver_priv; struct drm_i915_file_private *file_priv = file->driver_priv;
unsigned long recent_enough = jiffies - msecs_to_jiffies(20); unsigned long recent_enough = jiffies - DRM_I915_THROTTLE_JIFFIES;
struct drm_i915_gem_request *request, *target = NULL; struct drm_i915_gem_request *request, *target = NULL;
unsigned reset_counter; unsigned reset_counter;
int ret; int ret;
......
...@@ -4158,7 +4158,7 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv, ...@@ -4158,7 +4158,7 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv,
/* Force a RPS boost (and don't count it against the client) if /* Force a RPS boost (and don't count it against the client) if
* the GPU is severely congested. * the GPU is severely congested.
*/ */
if (rps && time_after(jiffies, submitted + msecs_to_jiffies(20))) if (rps && time_after(jiffies, submitted + DRM_I915_THROTTLE_JIFFIES))
rps = NULL; rps = NULL;
mutex_lock(&dev_priv->rps.hw_lock); mutex_lock(&dev_priv->rps.hw_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment