Skip to content

Commit d45171a

Browse files
committed
drm/i915/gt: Trace placement of timeline HWSP
Track the position of the HWSP for each timeline. References: https://gitlab.freedesktop.org/drm/intel/-/issues/2169 Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3e6761f commit d45171a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

drivers/gpu/drm/i915/gt/intel_timeline.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ hwsp_alloc(struct intel_timeline *timeline, unsigned int *cacheline)
7373
return vma;
7474
}
7575

76+
GT_TRACE(timeline->gt, "new HWSP allocated\n");
77+
7678
vma->private = hwsp;
7779
hwsp->gt = timeline->gt;
7880
hwsp->vma = vma;
@@ -327,6 +329,8 @@ int intel_timeline_pin(struct intel_timeline *tl)
327329
tl->hwsp_offset =
328330
i915_ggtt_offset(tl->hwsp_ggtt) +
329331
offset_in_page(tl->hwsp_offset);
332+
GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
333+
tl->fence_context, tl->hwsp_offset);
330334

331335
cacheline_acquire(tl->hwsp_cacheline);
332336
if (atomic_fetch_inc(&tl->pin_count)) {
@@ -434,6 +438,7 @@ __intel_timeline_get_seqno(struct intel_timeline *tl,
434438
int err;
435439

436440
might_lock(&tl->gt->ggtt->vm.mutex);
441+
GT_TRACE(tl->gt, "timeline:%llx wrapped\n", tl->fence_context);
437442

438443
/*
439444
* If there is an outstanding GPU reference to this cacheline,
@@ -497,6 +502,8 @@ __intel_timeline_get_seqno(struct intel_timeline *tl,
497502
memset(vaddr + tl->hwsp_offset, 0, CACHELINE_BYTES);
498503

499504
tl->hwsp_offset += i915_ggtt_offset(vma);
505+
GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
506+
tl->fence_context, tl->hwsp_offset);
500507

501508
cacheline_acquire(cl);
502509
tl->hwsp_cacheline = cl;

drivers/gpu/drm/i915/gt/selftest_timeline.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,9 @@ static int live_hwsp_engine(void *arg)
562562
struct intel_timeline *tl = timelines[n];
563563

564564
if (!err && *tl->hwsp_seqno != n) {
565-
pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
566-
n, *tl->hwsp_seqno);
565+
pr_err("Invalid seqno stored in timeline %lu @ %x, found 0x%x\n",
566+
n, tl->hwsp_offset, *tl->hwsp_seqno);
567+
GEM_TRACE_DUMP();
567568
err = -EINVAL;
568569
}
569570
intel_timeline_put(tl);
@@ -633,8 +634,9 @@ static int live_hwsp_alternate(void *arg)
633634
struct intel_timeline *tl = timelines[n];
634635

635636
if (!err && *tl->hwsp_seqno != n) {
636-
pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
637-
n, *tl->hwsp_seqno);
637+
pr_err("Invalid seqno stored in timeline %lu @ %x, found 0x%x\n",
638+
n, tl->hwsp_offset, *tl->hwsp_seqno);
639+
GEM_TRACE_DUMP();
638640
err = -EINVAL;
639641
}
640642
intel_timeline_put(tl);
@@ -965,8 +967,9 @@ static int live_hwsp_recycle(void *arg)
965967
}
966968

967969
if (*tl->hwsp_seqno != count) {
968-
pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
970+
pr_err("Invalid seqno stored in timeline %lu @ tl->hwsp_offset, found 0x%x\n",
969971
count, *tl->hwsp_seqno);
972+
GEM_TRACE_DUMP();
970973
err = -EINVAL;
971974
}
972975

0 commit comments

Comments
 (0)