@@ -85,16 +85,13 @@ static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
85
85
}
86
86
87
87
static void
88
- __read_timestamps (struct xe_gt * gt ,
89
- struct xe_reg lower_reg ,
90
- struct xe_reg upper_reg ,
91
- u64 * engine_ts ,
92
- u64 * cpu_ts ,
93
- u64 * cpu_delta ,
94
- __ktime_func_t cpu_clock )
88
+ hwe_read_timestamp (struct xe_hw_engine * hwe , u64 * engine_ts , u64 * cpu_ts ,
89
+ u64 * cpu_delta , __ktime_func_t cpu_clock )
95
90
{
96
- struct xe_mmio * mmio = & gt -> mmio ;
91
+ struct xe_mmio * mmio = & hwe -> gt -> mmio ;
97
92
u32 upper , lower , old_upper , loop = 0 ;
93
+ struct xe_reg upper_reg = RING_TIMESTAMP_UDW (hwe -> mmio_base ),
94
+ lower_reg = RING_TIMESTAMP (hwe -> mmio_base );
98
95
99
96
upper = xe_mmio_read32 (mmio , upper_reg );
100
97
do {
@@ -155,13 +152,8 @@ query_engine_cycles(struct xe_device *xe,
155
152
if (xe_force_wake_get (gt_to_fw (gt ), XE_FORCEWAKE_ALL ))
156
153
return - EIO ;
157
154
158
- __read_timestamps (gt ,
159
- RING_TIMESTAMP (hwe -> mmio_base ),
160
- RING_TIMESTAMP_UDW (hwe -> mmio_base ),
161
- & resp .engine_cycles ,
162
- & resp .cpu_timestamp ,
163
- & resp .cpu_delta ,
164
- cpu_clock );
155
+ hwe_read_timestamp (hwe , & resp .engine_cycles , & resp .cpu_timestamp ,
156
+ & resp .cpu_delta , cpu_clock );
165
157
166
158
xe_force_wake_put (gt_to_fw (gt ), XE_FORCEWAKE_ALL );
167
159
0 commit comments