mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
freedreno: Fix timestamp conversion
The kernel returns the 19.2MHz RBBM counter, same as what is used for timestamp queries. So it needs to be converted the same way. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
This commit is contained in:
parent
2284d1c42f
commit
659e557676
1 changed files with 4 additions and 4 deletions
|
|
@ -141,8 +141,7 @@ fd_screen_get_timestamp(struct pipe_screen *pscreen)
|
|||
if (screen->has_timestamp) {
|
||||
uint64_t n;
|
||||
fd_pipe_get_param(screen->pipe, FD_TIMESTAMP, &n);
|
||||
assert(screen->max_freq > 0);
|
||||
return n * 1000000000 / screen->max_freq;
|
||||
return ticks_to_ns(n);
|
||||
} else {
|
||||
int64_t cpu_time = os_time_get_nano();
|
||||
return cpu_time + screen->cpu_gpu_time_delta;
|
||||
|
|
@ -1113,10 +1112,11 @@ fd_screen_create(int fd,
|
|||
screen->max_freq = 0;
|
||||
} else {
|
||||
screen->max_freq = val;
|
||||
if (fd_pipe_get_param(screen->pipe, FD_TIMESTAMP, &val) == 0)
|
||||
screen->has_timestamp = true;
|
||||
}
|
||||
|
||||
if (fd_pipe_get_param(screen->pipe, FD_TIMESTAMP, &val) == 0)
|
||||
screen->has_timestamp = true;
|
||||
|
||||
screen->dev_id = fd_pipe_dev_id(screen->pipe);
|
||||
|
||||
if (fd_pipe_get_param(screen->pipe, FD_GPU_ID, &val)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue