Skip to content

Commit 833b2ec

Browse files
drm/xe/guc: Capture all available bits of GuC timestamp
The extra bits are not hugely useful because the GuC log only uses 32bit time stamps. But they exist so might as well provide them. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241024002554.1983101-2-John.C.Harrison@Intel.com
1 parent 55858fa commit 833b2ec

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

drivers/gpu/drm/xe/regs/xe_guc_regs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
#define HUC_LOADING_AGENT_GUC REG_BIT(1)
8585
#define GUC_WOPCM_OFFSET_VALID REG_BIT(0)
8686
#define GUC_MAX_IDLE_COUNT XE_REG(0xc3e4)
87-
#define GUC_PMTIMESTAMP XE_REG(0xc3e8)
87+
#define GUC_PMTIMESTAMP_LO XE_REG(0xc3e8)
88+
#define GUC_PMTIMESTAMP_HI XE_REG(0xc3ec)
8889

8990
#define GUC_SEND_INTERRUPT XE_REG(0xc4c8)
9091
#define GUC_SEND_TRIGGER REG_BIT(0)

drivers/gpu/drm/xe/xe_guc_log.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ struct xe_guc_log_snapshot *xe_guc_log_snapshot_capture(struct xe_guc_log *log,
171171

172172
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
173173
if (!fw_ref) {
174-
snapshot->stamp = ~0;
174+
snapshot->stamp = ~0ULL;
175175
} else {
176-
snapshot->stamp = xe_mmio_read32(&gt->mmio, GUC_PMTIMESTAMP);
176+
snapshot->stamp = xe_mmio_read64_2x32(&gt->mmio, GUC_PMTIMESTAMP_LO);
177177
xe_force_wake_put(gt_to_fw(gt), fw_ref);
178178
}
179179
snapshot->ktime = ktime_get_boottime_ns();
@@ -205,7 +205,7 @@ void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_
205205
snapshot->ver_found.major, snapshot->ver_found.minor, snapshot->ver_found.patch,
206206
snapshot->ver_want.major, snapshot->ver_want.minor, snapshot->ver_want.patch);
207207
drm_printf(p, "Kernel timestamp: 0x%08llX [%llu]\n", snapshot->ktime, snapshot->ktime);
208-
drm_printf(p, "GuC timestamp: 0x%08X [%u]\n", snapshot->stamp, snapshot->stamp);
208+
drm_printf(p, "GuC timestamp: 0x%08llX [%llu]\n", snapshot->stamp, snapshot->stamp);
209209
drm_printf(p, "Log level: %u\n", snapshot->level);
210210

211211
remain = snapshot->size;

drivers/gpu/drm/xe/xe_guc_log_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct xe_guc_log_snapshot {
2727
/** @ktime: Kernel time the snapshot was taken */
2828
u64 ktime;
2929
/** @stamp: GuC timestamp at which the snapshot was taken */
30-
u32 stamp;
30+
u64 stamp;
3131
/** @level: GuC log verbosity level */
3232
u32 level;
3333
/** @ver_found: GuC firmware version */

0 commit comments

Comments
 (0)