Commit 0e994828 authored by Christian König's avatar Christian König

drm/etnaviv: use new iterator in etnaviv_gem_describe

Instead of hand rolling the logic.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211025080532.177424-2-christian.koenig@amd.com
parent 55d5e4f9
...@@ -427,19 +427,17 @@ int etnaviv_gem_wait_bo(struct etnaviv_gpu *gpu, struct drm_gem_object *obj, ...@@ -427,19 +427,17 @@ int etnaviv_gem_wait_bo(struct etnaviv_gpu *gpu, struct drm_gem_object *obj,
static void etnaviv_gem_describe_fence(struct dma_fence *fence, static void etnaviv_gem_describe_fence(struct dma_fence *fence,
const char *type, struct seq_file *m) const char *type, struct seq_file *m)
{ {
if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) seq_printf(m, "\t%9s: %s %s seq %llu\n", type,
seq_printf(m, "\t%9s: %s %s seq %llu\n", fence->ops->get_driver_name(fence),
type, fence->ops->get_timeline_name(fence),
fence->ops->get_driver_name(fence), fence->seqno);
fence->ops->get_timeline_name(fence),
fence->seqno);
} }
static void etnaviv_gem_describe(struct drm_gem_object *obj, struct seq_file *m) static void etnaviv_gem_describe(struct drm_gem_object *obj, struct seq_file *m)
{ {
struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj); struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
struct dma_resv *robj = obj->resv; struct dma_resv *robj = obj->resv;
struct dma_resv_list *fobj; struct dma_resv_iter cursor;
struct dma_fence *fence; struct dma_fence *fence;
unsigned long off = drm_vma_node_start(&obj->vma_node); unsigned long off = drm_vma_node_start(&obj->vma_node);
...@@ -448,21 +446,14 @@ static void etnaviv_gem_describe(struct drm_gem_object *obj, struct seq_file *m) ...@@ -448,21 +446,14 @@ static void etnaviv_gem_describe(struct drm_gem_object *obj, struct seq_file *m)
obj->name, kref_read(&obj->refcount), obj->name, kref_read(&obj->refcount),
off, etnaviv_obj->vaddr, obj->size); off, etnaviv_obj->vaddr, obj->size);
rcu_read_lock(); dma_resv_iter_begin(&cursor, robj, true);
fobj = dma_resv_shared_list(robj); dma_resv_for_each_fence_unlocked(&cursor, fence) {
if (fobj) { if (dma_resv_iter_is_exclusive(&cursor))
unsigned int i, shared_count = fobj->shared_count; etnaviv_gem_describe_fence(fence, "Exclusive", m);
else
for (i = 0; i < shared_count; i++) {
fence = rcu_dereference(fobj->shared[i]);
etnaviv_gem_describe_fence(fence, "Shared", m); etnaviv_gem_describe_fence(fence, "Shared", m);
}
} }
dma_resv_iter_end(&cursor);
fence = dma_resv_excl_fence(robj);
if (fence)
etnaviv_gem_describe_fence(fence, "Exclusive", m);
rcu_read_unlock();
} }
void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv, void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv,
......
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