Skip to content

Commit d0bc54f

Browse files
ickledanvet
authored andcommitted
drm/i915: Introduce DRM_I915_THROTTLE_JIFFIES
As Daniel commented on commit b7ffe1362c5f468b853223acc9268804aa92afc8 Author: Chris Wilson <[email protected]> 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 <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 9a0c1e2 commit d0bc54f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ struct drm_i915_file_private {
279279
struct {
280280
spinlock_t lock;
281281
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)
282288
} mm;
283289
struct idr context_idr;
284290

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4239,7 +4239,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
42394239
{
42404240
struct drm_i915_private *dev_priv = dev->dev_private;
42414241
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;
42434243
struct drm_i915_gem_request *request, *target = NULL;
42444244
unsigned reset_counter;
42454245
int ret;

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4158,7 +4158,7 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv,
41584158
/* Force a RPS boost (and don't count it against the client) if
41594159
* the GPU is severely congested.
41604160
*/
4161-
if (rps && time_after(jiffies, submitted + msecs_to_jiffies(20)))
4161+
if (rps && time_after(jiffies, submitted + DRM_I915_THROTTLE_JIFFIES))
41624162
rps = NULL;
41634163

41644164
mutex_lock(&dev_priv->rps.hw_lock);

0 commit comments

Comments
 (0)