[RFC PATCH] amd/ttm: test fence->ops->signaled before use

James Zhu James.Zhu at amd.com
Tue Jan 7 20:01:40 UTC 2025


this original test condition is unclear.

Signed-off-by: James Zhu <James.Zhu at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 48c5365efca1..d40f07802c4f 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -218,7 +218,7 @@ static void ttm_bo_flush_all_fences(struct ttm_buffer_object *bo)
 
 	dma_resv_iter_begin(&cursor, resv, DMA_RESV_USAGE_BOOKKEEP);
 	dma_resv_for_each_fence_unlocked(&cursor, fence) {
-		if (!fence->ops->signaled)
+		if (fence->ops->signaled && !fence->ops->signaled(fence))
 			dma_fence_enable_sw_signaling(fence);
 	}
 	dma_resv_iter_end(&cursor);
-- 
2.34.1



More information about the amd-gfx mailing list