Commit dd7a7d1f authored by Christian König's avatar Christian König

drm/i915: use new reservation_object_fences helper

Instead of open coding the sequence loop use the new helper.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/322377/?series=64837&rev=1
parent 67c97fb7
...@@ -83,7 +83,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, ...@@ -83,7 +83,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
struct drm_i915_gem_busy *args = data; struct drm_i915_gem_busy *args = data;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct reservation_object_list *list; struct reservation_object_list *list;
unsigned int seq; unsigned int i, shared_count;
struct dma_fence *excl;
int err; int err;
err = -ENOENT; err = -ENOENT;
...@@ -109,29 +110,18 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, ...@@ -109,29 +110,18 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
* to report the overall busyness. This is what the wait-ioctl does. * to report the overall busyness. This is what the wait-ioctl does.
* *
*/ */
retry: reservation_object_fences(obj->base.resv, &excl, &list, &shared_count);
seq = raw_read_seqcount(&obj->base.resv->seq);
/* Translate the exclusive fence to the READ *and* WRITE engine */ /* Translate the exclusive fence to the READ *and* WRITE engine */
args->busy = args->busy = busy_check_writer(excl);
busy_check_writer(rcu_dereference(obj->base.resv->fence_excl));
/* Translate shared fences to READ set of engines */ /* Translate shared fences to READ set of engines */
list = rcu_dereference(obj->base.resv->fence); for (i = 0; i < shared_count; ++i) {
if (list) { struct dma_fence *fence = rcu_dereference(list->shared[i]);
unsigned int shared_count = list->shared_count, i;
for (i = 0; i < shared_count; ++i) { args->busy |= busy_check_reader(fence);
struct dma_fence *fence =
rcu_dereference(list->shared[i]);
args->busy |= busy_check_reader(fence);
}
} }
if (args->busy && read_seqcount_retry(&obj->base.resv->seq, seq))
goto retry;
err = 0; err = 0;
out: out:
rcu_read_unlock(); rcu_read_unlock();
......
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