summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Stanner <phasta@kernel.org>2025-12-01 13:50:08 +0300
committerPhilipp Stanner <phasta@kernel.org>2025-12-04 17:03:40 +0300
commitdbcd754b845987f7157260c15e80ae19da81c9df (patch)
tree5c9c03d2e9330111d20f88d757bbd199ec8317cd
parent06bc18e0def7d926265480faa555bf0b67a35a90 (diff)
downloadlinux-dbcd754b845987f7157260c15e80ae19da81c9df.tar.xz
drm/xe: Use dma_fence_check_and_signal_locked()
Xe is one of the few users utilizing the return code of dma_fence_signal() to check whether a fence had already been signaled by someone else. To clean up and simplify the dma_fence API, the few kernel users relying on that behavior shall be ported to an alternative function. Replace dma_fence_signal_locked() with dma_fence_check_and_signal_locked(). Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20251201105011.19386-6-phasta@kernel.org
-rw-r--r--drivers/gpu/drm/xe/xe_hw_fence.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.c b/drivers/gpu/drm/xe/xe_hw_fence.c
index b2a0c46dfcd4..f6057456e460 100644
--- a/drivers/gpu/drm/xe/xe_hw_fence.c
+++ b/drivers/gpu/drm/xe/xe_hw_fence.c
@@ -85,7 +85,6 @@ void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq)
{
struct xe_hw_fence *fence, *next;
unsigned long flags;
- int err;
bool tmp;
if (XE_WARN_ON(!list_empty(&irq->pending))) {
@@ -93,9 +92,8 @@ void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq)
spin_lock_irqsave(&irq->lock, flags);
list_for_each_entry_safe(fence, next, &irq->pending, irq_link) {
list_del_init(&fence->irq_link);
- err = dma_fence_signal_locked(&fence->dma);
+ XE_WARN_ON(dma_fence_check_and_signal_locked(&fence->dma));
dma_fence_put(&fence->dma);
- XE_WARN_ON(err);
}
spin_unlock_irqrestore(&irq->lock, flags);
dma_fence_end_signalling(tmp);