summaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_gpu_info.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-07-10 16:01:28 +0200
committerMarek Olšák <[email protected]>2017-07-17 10:56:59 -0400
commit3d1a576fa607b5df05cbfe286ef9821ba387344d (patch)
tree2eaa7dcfb7e68d471c17fca706b6174eed85dfb9 /src/amd/common/ac_gpu_info.c
parentd0963ef0843456f3c5ef0ae0926e11f10fa606fe (diff)
ac/gpu_info: if clock crystal frequency is 0, print an error and set 1
During bring-up, this is often 0. Prevent automatic disablement of ARB_timer_query and demotion of the OpenGL version to 3.2 by setting a non-zero frequency. Print an error message instead. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd/common/ac_gpu_info.c')
-rw-r--r--src/amd/common/ac_gpu_info.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 3f39a089ecb..ced7183cf64 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -260,6 +260,10 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
info->has_userptr = true;
info->num_render_backends = amdinfo->rb_pipes;
info->clock_crystal_freq = amdinfo->gpu_counter_freq;
+ if (!info->clock_crystal_freq) {
+ fprintf(stderr, "amdgpu: clock crystal frequency is 0, timestamps will be wrong\n");
+ info->clock_crystal_freq = 1;
+ }
info->tcc_cache_line_size = 64; /* TC L2 line size on GCN */
if (info->chip_class == GFX9) {
info->num_tile_pipes = 1 << G_0098F8_NUM_PIPES(amdinfo->gb_addr_cfg);