diff options
| author | Christian König <christian.koenig@amd.com> | 2025-10-10 14:22:06 +0200 |
|---|---|---|
| committer | Christian König <christian.koenig@amd.com> | 2025-11-25 10:46:55 +0100 |
| commit | ac364014fd812c8a2babe8f9dff8c909271a653e (patch) | |
| tree | 3ad6e387282e34bba220c43332abc8da4fa8029f /drivers/dma-buf | |
| parent | 17331d0f339fc6ec00a118e72ca28cb39d18e960 (diff) | |
dma-buf: cleanup dma_fence_describe v3
The driver and timeline name are meaningless for signaled fences.
Drop them and also print the context number.
v2: avoid the calls when the BO is already signaled.
v3: use same format as trace points for context and seqno.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://lore.kernel.org/r/20251113145332.16805-2-christian.koenig@amd.com
Diffstat (limited to 'drivers/dma-buf')
| -rw-r--r-- | drivers/dma-buf/dma-fence.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 35e241041c10..2bb18af369b9 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -997,19 +997,21 @@ EXPORT_SYMBOL(dma_fence_set_deadline); */ void dma_fence_describe(struct dma_fence *fence, struct seq_file *seq) { - const char __rcu *timeline; - const char __rcu *driver; + const char __rcu *timeline = ""; + const char __rcu *driver = ""; + const char *signaled = ""; rcu_read_lock(); - timeline = dma_fence_timeline_name(fence); - driver = dma_fence_driver_name(fence); + if (!dma_fence_is_signaled(fence)) { + timeline = dma_fence_timeline_name(fence); + driver = dma_fence_driver_name(fence); + signaled = "un"; + } - seq_printf(seq, "%s %s seq %llu %ssignalled\n", - rcu_dereference(driver), - rcu_dereference(timeline), - fence->seqno, - dma_fence_is_signaled(fence) ? "" : "un"); + seq_printf(seq, "%llu:%llu %s %s %ssignalled\n", + fence->context, fence->seqno, timeline, driver, + signaled); rcu_read_unlock(); } |
