Commit 617dbe27 authored by Daniel Vetter's avatar Daniel Vetter Committed by Chris Wilson

drm/i915: drop seqno argument from i915_gem_object_move_to_active

By moving one i915_add_request we can solely depend on the new
auto-seqno-numbering behaviour.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 86394c66
...@@ -1481,12 +1481,14 @@ i915_gem_next_request_seqno(struct drm_device *dev, ...@@ -1481,12 +1481,14 @@ i915_gem_next_request_seqno(struct drm_device *dev,
} }
static void static void
i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno, i915_gem_object_move_to_active(struct drm_gem_object *obj,
struct intel_ring_buffer *ring) struct intel_ring_buffer *ring)
{ {
struct drm_device *dev = obj->dev; struct drm_device *dev = obj->dev;
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
uint32_t seqno = i915_gem_next_request_seqno(dev, ring);
BUG_ON(ring == NULL); BUG_ON(ring == NULL);
obj_priv->ring = ring; obj_priv->ring = ring;
...@@ -1496,10 +1498,6 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno, ...@@ -1496,10 +1498,6 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno,
obj_priv->active = 1; obj_priv->active = 1;
} }
/* Take the seqno of the next request if none is given */
if (seqno == 0)
seqno = i915_gem_next_request_seqno(dev, ring);
/* Move from whatever list we were on to the tail of execution. */ /* Move from whatever list we were on to the tail of execution. */
spin_lock(&dev_priv->mm.active_list_lock); spin_lock(&dev_priv->mm.active_list_lock);
list_move_tail(&obj_priv->list, &ring->active_list); list_move_tail(&obj_priv->list, &ring->active_list);
...@@ -1590,7 +1588,7 @@ i915_gem_process_flushing_list(struct drm_device *dev, ...@@ -1590,7 +1588,7 @@ i915_gem_process_flushing_list(struct drm_device *dev,
obj->write_domain = 0; obj->write_domain = 0;
list_del_init(&obj_priv->gpu_write_list); list_del_init(&obj_priv->gpu_write_list);
i915_gem_object_move_to_active(obj, 0, ring); i915_gem_object_move_to_active(obj, ring);
/* update the fence lru list */ /* update the fence lru list */
if (obj_priv->fence_reg != I915_FENCE_REG_NONE) { if (obj_priv->fence_reg != I915_FENCE_REG_NONE) {
...@@ -3819,6 +3817,16 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -3819,6 +3817,16 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
i915_verify_inactive(dev, __FILE__, __LINE__); i915_verify_inactive(dev, __FILE__, __LINE__);
for (i = 0; i < args->buffer_count; i++) {
struct drm_gem_object *obj = object_list[i];
obj_priv = to_intel_bo(obj);
i915_gem_object_move_to_active(obj, ring);
#if WATCH_LRU
DRM_INFO("%s: move to exec list %p\n", __func__, obj);
#endif
}
/* /*
* Get a seqno representing the execution of the current buffer, * Get a seqno representing the execution of the current buffer,
* which we can wait on. We would like to mitigate these interrupts, * which we can wait on. We would like to mitigate these interrupts,
...@@ -3827,15 +3835,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -3827,15 +3835,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
* wait on when trying to clear up gtt space). * wait on when trying to clear up gtt space).
*/ */
seqno = i915_add_request(dev, file_priv, ring); seqno = i915_add_request(dev, file_priv, ring);
for (i = 0; i < args->buffer_count; i++) {
struct drm_gem_object *obj = object_list[i];
obj_priv = to_intel_bo(obj);
i915_gem_object_move_to_active(obj, seqno, ring);
#if WATCH_LRU
DRM_INFO("%s: move to exec list %p\n", __func__, obj);
#endif
}
#if WATCH_LRU #if WATCH_LRU
i915_dump_lru(dev, __func__); i915_dump_lru(dev, __func__);
#endif #endif
......
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