]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/i915/gt: Trace placement of timeline HWSP
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 14 Jul 2020 13:50:02 +0000 (14:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Jul 2020 09:17:44 +0000 (10:17 +0100)
Track the position of the HWSP for each timeline.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/2169
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200714135002.17508-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_timeline.c
drivers/gpu/drm/i915/gt/selftest_timeline.c

index 4546284fede1fa9800b9f15a364e039320f5b844..46d20f5f3ddcc93ff898d23cd3f779cff093d23d 100644 (file)
@@ -73,6 +73,8 @@ hwsp_alloc(struct intel_timeline *timeline, unsigned int *cacheline)
                        return vma;
                }
 
+               GT_TRACE(timeline->gt, "new HWSP allocated\n");
+
                vma->private = hwsp;
                hwsp->gt = timeline->gt;
                hwsp->vma = vma;
@@ -327,6 +329,8 @@ int intel_timeline_pin(struct intel_timeline *tl)
        tl->hwsp_offset =
                i915_ggtt_offset(tl->hwsp_ggtt) +
                offset_in_page(tl->hwsp_offset);
+       GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
+                tl->fence_context, tl->hwsp_offset);
 
        cacheline_acquire(tl->hwsp_cacheline);
        if (atomic_fetch_inc(&tl->pin_count)) {
@@ -434,6 +438,7 @@ __intel_timeline_get_seqno(struct intel_timeline *tl,
        int err;
 
        might_lock(&tl->gt->ggtt->vm.mutex);
+       GT_TRACE(tl->gt, "timeline:%llx wrapped\n", tl->fence_context);
 
        /*
         * If there is an outstanding GPU reference to this cacheline,
@@ -497,6 +502,8 @@ __intel_timeline_get_seqno(struct intel_timeline *tl,
                memset(vaddr + tl->hwsp_offset, 0, CACHELINE_BYTES);
 
        tl->hwsp_offset += i915_ggtt_offset(vma);
+       GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
+                tl->fence_context, tl->hwsp_offset);
 
        cacheline_acquire(cl);
        tl->hwsp_cacheline = cl;
index fcdee951579b23e31684a73279111e58c3133dc2..fb5b7d3498a677d6bf7302d9cf49611c192e1527 100644 (file)
@@ -562,8 +562,9 @@ static int live_hwsp_engine(void *arg)
                struct intel_timeline *tl = timelines[n];
 
                if (!err && *tl->hwsp_seqno != n) {
-                       pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
-                              n, *tl->hwsp_seqno);
+                       pr_err("Invalid seqno stored in timeline %lu @ %x, found 0x%x\n",
+                              n, tl->hwsp_offset, *tl->hwsp_seqno);
+                       GEM_TRACE_DUMP();
                        err = -EINVAL;
                }
                intel_timeline_put(tl);
@@ -633,8 +634,9 @@ out:
                struct intel_timeline *tl = timelines[n];
 
                if (!err && *tl->hwsp_seqno != n) {
-                       pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
-                              n, *tl->hwsp_seqno);
+                       pr_err("Invalid seqno stored in timeline %lu @ %x, found 0x%x\n",
+                              n, tl->hwsp_offset, *tl->hwsp_seqno);
+                       GEM_TRACE_DUMP();
                        err = -EINVAL;
                }
                intel_timeline_put(tl);
@@ -965,8 +967,9 @@ static int live_hwsp_recycle(void *arg)
                        }
 
                        if (*tl->hwsp_seqno != count) {
-                               pr_err("Invalid seqno stored in timeline %lu, found 0x%x\n",
+                               pr_err("Invalid seqno stored in timeline %lu @ tl->hwsp_offset, found 0x%x\n",
                                       count, *tl->hwsp_seqno);
+                               GEM_TRACE_DUMP();
                                err = -EINVAL;
                        }