[CI 11/12] cb xfer

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Feb 13 17:23:36 UTC 2023


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/i915_active.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index f9282b8c87c1..01d42573455a 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -1063,8 +1063,19 @@ __i915_active_fence_set(struct i915_active_fence *active,
 		GEM_BUG_ON(prev == fence);
 		spin_lock_nested(prev->lock, SINGLE_DEPTH_NESTING);
 		__list_del_entry(&active->cb.node);
+		if (test_bit(DMA_FENCE_CB_FLAG_WAITCOUNT_BIT,
+			     &active->cb.flags)) {
+			trace_printk("  X  %llx:%llu @ %u [%p] (i915) (%lx)\n",
+				     prev->context, prev->seqno, prev->waitcount, &active->cb, active->cb.flags);
+			WARN_ON_ONCE(!prev->waitcount);
+			prev->waitcount--;
+			fence->waitcount++;
+			WARN_ON_ONCE(!fence->waitcount);
+		}
 		spin_unlock(prev->lock); /* serialise with prev->cb_list */
 	}
+	trace_printk("  A  %llx:%llu @ %u [%p] (i915) (%lx)\n",
+		     fence->context, fence->seqno, fence->waitcount, &active->cb, active->cb.flags);
 	list_add_tail(&active->cb.node, &fence->cb_list);
 	spin_unlock_irqrestore(fence->lock, flags);
 
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list