mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-26 12:34:41 +08:00
drm/i915: Convert i915_gem_ring_throttle to use requests
Convert the throttle code to use the request structure rather than extracting a ring/seqno pair from it and using those. This is in preparation for __wait_seqno() becoming __wait_request(). For: VIZ-4377 Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
97b2a6a10a
commit
54fb2411dd
@ -4098,10 +4098,8 @@ 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 - msecs_to_jiffies(20);
|
||||||
struct drm_i915_gem_request *request;
|
struct drm_i915_gem_request *request, *target = NULL;
|
||||||
struct intel_engine_cs *ring = NULL;
|
|
||||||
unsigned reset_counter;
|
unsigned reset_counter;
|
||||||
u32 seqno = 0;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = i915_gem_wait_for_error(&dev_priv->gpu_error);
|
ret = i915_gem_wait_for_error(&dev_priv->gpu_error);
|
||||||
@ -4117,16 +4115,17 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
|
|||||||
if (time_after_eq(request->emitted_jiffies, recent_enough))
|
if (time_after_eq(request->emitted_jiffies, recent_enough))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ring = request->ring;
|
target = request;
|
||||||
seqno = request->seqno;
|
|
||||||
}
|
}
|
||||||
reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
|
reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
|
||||||
spin_unlock(&file_priv->mm.lock);
|
spin_unlock(&file_priv->mm.lock);
|
||||||
|
|
||||||
if (seqno == 0)
|
if (target == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = __i915_wait_seqno(ring, seqno, reset_counter, true, NULL, NULL);
|
ret = __i915_wait_seqno(i915_gem_request_get_ring(target),
|
||||||
|
i915_gem_request_get_seqno(target),
|
||||||
|
reset_counter, true, NULL, NULL);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, 0);
|
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user