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>
(cherry picked from commit 2284d1c42f
)
This commit is contained in:

committed by
Eric Engestrom

parent
4377e9ea43
commit
cb675c60a0
@@ -104,7 +104,7 @@
|
||||
"description": "util: Provide a secure_getenv fallback for platforms without it",
|
||||
"nominated": false,
|
||||
"nomination_type": 3,
|
||||
"resolution": 1,
|
||||
"resolution": 4,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
@@ -20014,7 +20014,7 @@
|
||||
"description": "freedreno: De-duplicate 19.2MHz RBBM tick conversion",
|
||||
"nominated": false,
|
||||
"nomination_type": 3,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user