aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2024-10-10 20:56:17 -0700
committerLucas De Marchi <lucas.demarchi@intel.com>2024-10-11 19:06:32 -0700
commit5c84985b07acc0fefd2d619c0bb03eed18f769b5 (patch)
tree0a7f9098fe71b558836f0f41470b7d6ddcb26e12
parentdrm/xe/query: Increase timestamp width (diff)
downloadwireguard-linux-5c84985b07acc0fefd2d619c0bb03eed18f769b5.tar.xz
wireguard-linux-5c84985b07acc0fefd2d619c0bb03eed18f769b5.zip
drm/xe/query: Move timestamp reg to hwe_read_timestamp()
__read_timestamps() is actually reading the timestamp from a certain hwe. Use it as parameter, move register declarations to be inside that function and rename it. Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241011035618.1057602-2-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/xe/xe_query.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 07093af0b32e..69307ff4146a 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -85,16 +85,13 @@ static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
}
static void
-__read_timestamps(struct xe_gt *gt,
- struct xe_reg lower_reg,
- struct xe_reg upper_reg,
- u64 *engine_ts,
- u64 *cpu_ts,
- u64 *cpu_delta,
- __ktime_func_t cpu_clock)
+hwe_read_timestamp(struct xe_hw_engine *hwe, u64 *engine_ts, u64 *cpu_ts,
+ u64 *cpu_delta, __ktime_func_t cpu_clock)
{
- struct xe_mmio *mmio = &gt->mmio;
+ struct xe_mmio *mmio = &hwe->gt->mmio;
u32 upper, lower, old_upper, loop = 0;
+ struct xe_reg upper_reg = RING_TIMESTAMP_UDW(hwe->mmio_base),
+ lower_reg = RING_TIMESTAMP(hwe->mmio_base);
upper = xe_mmio_read32(mmio, upper_reg);
do {
@@ -155,13 +152,8 @@ query_engine_cycles(struct xe_device *xe,
if (xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL))
return -EIO;
- __read_timestamps(gt,
- RING_TIMESTAMP(hwe->mmio_base),
- RING_TIMESTAMP_UDW(hwe->mmio_base),
- &resp.engine_cycles,
- &resp.cpu_timestamp,
- &resp.cpu_delta,
- cpu_clock);
+ hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp,
+ &resp.cpu_delta, cpu_clock);
xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);