]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/execlists: Include priority info in trace_ports
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 30 Mar 2020 11:31:37 +0000 (12:31 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 30 Mar 2020 16:56:00 +0000 (17:56 +0100)
Add some extra information into trace_ports to help with reviewing
correctness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200330113137.24425-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_lrc.c

index 9104796673dca70a9ee13dad57c32f02458c5d90..ec5ebae29434f4f0cd8ea6ee5a42ab24b748860e 100644 (file)
@@ -1415,6 +1415,23 @@ static inline void write_desc(struct intel_engine_execlists *execlists, u64 desc
        }
 }
 
+static __maybe_unused char *
+dump_port(char *buf, int buflen, const char *prefix, struct i915_request *rq)
+{
+       if (!rq)
+               return "";
+
+       snprintf(buf, buflen, "%s%llx:%lld%s prio %d",
+                prefix,
+                rq->fence.context, rq->fence.seqno,
+                i915_request_completed(rq) ? "!" :
+                i915_request_started(rq) ? "*" :
+                "",
+                rq_prio(rq));
+
+       return buf;
+}
+
 static __maybe_unused void
 trace_ports(const struct intel_engine_execlists *execlists,
            const char *msg,
@@ -1422,18 +1439,14 @@ trace_ports(const struct intel_engine_execlists *execlists,
 {
        const struct intel_engine_cs *engine =
                container_of(execlists, typeof(*engine), execlists);
+       char __maybe_unused p0[40], p1[40];
 
        if (!ports[0])
                return;
 
-       ENGINE_TRACE(engine, "%s { %llx:%lld%s, %llx:%lld }\n", msg,
-                    ports[0]->fence.context,
-                    ports[0]->fence.seqno,
-                    i915_request_completed(ports[0]) ? "!" :
-                    i915_request_started(ports[0]) ? "*" :
-                    "",
-                    ports[1] ? ports[1]->fence.context : 0,
-                    ports[1] ? ports[1]->fence.seqno : 0);
+       ENGINE_TRACE(engine, "%s { %s%s }\n", msg,
+                    dump_port(p0, sizeof(p0), "", ports[0]),
+                    dump_port(p1, sizeof(p1), ", ", ports[1]));
 }
 
 static inline bool