dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] dma-buf: make the flags can be configured during dma fence init
@ 2021-12-13  6:34 Huang Rui
  2021-12-13  6:34 ` [PATCH 2/3] drm/amdgpu: fix the fence timeline null pointer Huang Rui
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Huang Rui @ 2021-12-13  6:34 UTC (permalink / raw)
  To: dri-devel, Christian König, Daniel Vetter, Sumit Semwal
  Cc: Alex Deucher, Huang Rui, Monk Liu, amd-gfx, linux-media

In some user scenarios, the get_timeline_name callback uses the flags to
decide which way to return the timeline string name. Once the
trace_dma_fence_init event is enabled, it will call get_timeline_name
callback to dump the fence structure. However, at this moment, the flags
are always 0, and it might trigger some issues in get_timeline_name
callback implementation of different gpu driver. So make a member to
initialize the flags in dma_fence_init().

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/dma-buf/dma-fence.c | 2 +-
 include/linux/dma-fence.h   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 066400ed8841..3e0622bf385f 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -952,7 +952,7 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
 	fence->lock = lock;
 	fence->context = context;
 	fence->seqno = seqno;
-	fence->flags = 0UL;
+	fence->flags = ops->init_flags;
 	fence->error = 0;
 
 	trace_dma_fence_init(fence);
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 1ea691753bd3..f9270c5bc07a 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -131,6 +131,13 @@ struct dma_fence_ops {
 	 */
 	bool use_64bit_seqno;
 
+	/**
+	 * @init_flags:
+	 *
+	 * The initial value of fence flags (A mask of DMA_FENCE_FLAG_* defined).
+	 */
+	unsigned long init_flags;
+
 	/**
 	 * @get_driver_name:
 	 *
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-20  0:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13  6:34 [PATCH 1/3] dma-buf: make the flags can be configured during dma fence init Huang Rui
2021-12-13  6:34 ` [PATCH 2/3] drm/amdgpu: fix the fence timeline null pointer Huang Rui
2021-12-14  8:01   ` Christian König
2021-12-14  9:23     ` Huang, Ray
2021-12-13  6:34 ` [PATCH 3/3] drm: fix the warnning of string style for scheduler trace Huang Rui
2021-12-20  5:30   ` Huang Rui
2022-01-20  0:31   ` Huang Rui
2021-12-14  7:59 ` [PATCH 1/3] dma-buf: make the flags can be configured during dma fence init Christian König
2021-12-14  9:19   ` Huang, Ray
2021-12-14  9:24     ` Christian König
2021-12-14  9:44       ` Huang, Ray
2021-12-14  9:51         ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).