diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-05-21 16:01:48 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-05-22 02:59:52 -0400 |
commit | d0bc54f2f012d8c8c3b4315f51f408ff3d938031 (patch) | |
tree | 10fb00416f3e71313a1e4092dc89729c2b5287a2 | |
parent | 9a0c1e2770b839b806bae6bc8f93001f86bc0cf3 (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 44d592f3b67c..1038f5c7f15b 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -279,6 +279,12 @@ struct drm_i915_file_private { | |||
279 | struct { | 279 | struct { |
280 | spinlock_t lock; | 280 | spinlock_t lock; |
281 | struct list_head request_list; | 281 | struct list_head request_list; |
282 | /* 20ms is a fairly arbitrary limit (greater than the average frame time) | ||
283 | * chosen to prevent the CPU getting more than a frame ahead of the GPU | ||
284 | * (when using lax throttling for the frontbuffer). We also use it to | ||
285 | * offer free GPU waitboosts for severely congested workloads. | ||
286 | */ | ||
287 | #define DRM_I915_THROTTLE_JIFFIES msecs_to_jiffies(20) | ||
282 | } mm; | 288 | } mm; |
283 | struct idr context_idr; | 289 | struct idr context_idr; |
284 | 290 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0ce3e4b3059e..cc206f199d66 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4239,7 +4239,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file) | |||
4239 | { | 4239 | { |
4240 | struct drm_i915_private *dev_priv = dev->dev_private; | 4240 | struct drm_i915_private *dev_priv = dev->dev_private; |
4241 | struct drm_i915_file_private *file_priv = file->driver_priv; | 4241 | struct drm_i915_file_private *file_priv = file->driver_priv; |
4242 | unsigned long recent_enough = jiffies - msecs_to_jiffies(20); | 4242 | unsigned long recent_enough = jiffies - DRM_I915_THROTTLE_JIFFIES; |
4243 | struct drm_i915_gem_request *request, *target = NULL; | 4243 | struct drm_i915_gem_request *request, *target = NULL; |
4244 | unsigned reset_counter; | 4244 | unsigned reset_counter; |
4245 | int ret; | 4245 | int ret; |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 84809a67fac8..55d993110d51 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -4158,7 +4158,7 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv, | |||
4158 | /* Force a RPS boost (and don't count it against the client) if | 4158 | /* Force a RPS boost (and don't count it against the client) if |
4159 | * the GPU is severely congested. | 4159 | * the GPU is severely congested. |
4160 | */ | 4160 | */ |
4161 | if (rps && time_after(jiffies, submitted + msecs_to_jiffies(20))) | 4161 | if (rps && time_after(jiffies, submitted + DRM_I915_THROTTLE_JIFFIES)) |
4162 | rps = NULL; | 4162 | rps = NULL; |
4163 | 4163 | ||
4164 | mutex_lock(&dev_priv->rps.hw_lock); | 4164 | mutex_lock(&dev_priv->rps.hw_lock); |