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:
Rob Clark
2023-12-11 13:49:35 -08:00
committed by Eric Engestrom
parent 4377e9ea43
commit cb675c60a0
4 changed files with 9 additions and 22 deletions

View File

@@ -104,7 +104,7 @@
"description": "util: Provide a secure_getenv fallback for platforms without it", "description": "util: Provide a secure_getenv fallback for platforms without it",
"nominated": false, "nominated": false,
"nomination_type": 3, "nomination_type": 3,
"resolution": 1, "resolution": 4,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null
@@ -20014,7 +20014,7 @@
"description": "freedreno: De-duplicate 19.2MHz RBBM tick conversion", "description": "freedreno: De-duplicate 19.2MHz RBBM tick conversion",
"nominated": false, "nominated": false,
"nomination_type": 3, "nomination_type": 3,
"resolution": 4, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null

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 */ 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 static void
time_elapsed_accumulate_result(struct fd_acc_query *aq, time_elapsed_accumulate_result(struct fd_acc_query *aq,
struct fd_acc_query_sample *s, 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); 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 static void
time_elapsed_accumulate_result(struct fd_acc_query *aq, time_elapsed_accumulate_result(struct fd_acc_query *aq,
struct fd_acc_query_sample *s, struct fd_acc_query_sample *s,

View File

@@ -507,6 +507,13 @@ fd4_size2indextype(unsigned index_size)
return INDEX4_SIZE_32_BIT; 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 #ifdef __cplusplus
} }
#endif #endif