freedreno: De-duplicate 19.2MHz RBBM tick conversion

The 19.2MHz always-on counter is universal across generations, so
de-duplicate.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
This commit is contained in:
Rob Clark
2023-12-11 13:49:35 -08:00
committed by Marge Bot
parent e6249f97f1
commit 2284d1c42f
3 changed files with 7 additions and 20 deletions

View File

@@ -206,16 +206,6 @@ timestamp_pause(struct fd_acc_query *aq, struct fd_batch *batch) assert_dt
OUT_RELOC(ring, query_sample(aq, start)); /* srcC */
}
static uint64_t
ticks_to_ns(uint32_t ts)
{
/* This is based on the 19.2MHz always-on rbbm timer.
*
* TODO we should probably query this value from kernel..
*/
return ts * (1000000000 / 19200000);
}
static void
time_elapsed_accumulate_result(struct fd_acc_query *aq,
struct fd_acc_query_sample *s,

View File

@@ -267,16 +267,6 @@ record_timestamp(struct fd_ringbuffer *ring, struct fd_bo *bo, unsigned offset)
OUT_RING(ring, 0x00000000);
}
static uint64_t
ticks_to_ns(uint64_t ts)
{
/* This is based on the 19.2MHz always-on rbbm timer.
*
* TODO we should probably query this value from kernel..
*/
return ts * (1000000000 / 19200000);
}
static void
time_elapsed_accumulate_result(struct fd_acc_query *aq,
struct fd_acc_query_sample *s,

View File

@@ -507,6 +507,13 @@ fd4_size2indextype(unsigned index_size)
return INDEX4_SIZE_32_BIT;
}
/* Convert 19.2MHz RBBM always-on timer ticks to ns */
static inline uint64_t
ticks_to_ns(uint64_t ts)
{
return ts * (1000000000 / 19200000);
}
#ifdef __cplusplus
}
#endif