radv: disable calibrated timestamps on raven/raven2
authorChia-I Wu <olvaffe@gmail.com>
Tue, 6 Jun 2023 23:25:37 +0000 (16:25 -0700)
committerMarge Bot <emma+marge@anholt.net>
Sat, 10 Jun 2023 07:02:08 +0000 (07:02 +0000)
commit5ae953b5e97831a1bc3db9f24b06bd916f89e76f
tree2b5bca50a5d06e6acb7646d75c5453e7b0a888b3
parente1d948b6a247a7c5d05c90a05b47e5675738a417
radv: disable calibrated timestamps on raven/raven2

amdgpu enables gfxoff by default and the feature resets the RLC clock
counter on idle on raven/raven2.  Querying AMDGPU_INFO_TIMESTAMP does
not work as expected on those platforms.

There was an attempt in amdgpu to read from the TSC register instead,
but it did not work without a firmware update[1].  Another possible
solution is to disable the clock counter reset by clearing
AMD_PG_SUPPORT_RLC_SMU_HS, but that causes a 0.2W increase of power
consumption on idle which is undesirable.

The clock counter reset affects vkCmdWriteTimestamp as well.  The spec
is vague on whether that is allowed or not.  The WG is aware of the
issue[2] but never really addresses it.

[1] https://lists.freedesktop.org/archives/amd-gfx/2023-May/093731.html
[2] https://github.com/KhronosGroup/Vulkan-Docs/issues/216

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23481>
src/amd/vulkan/radv_physical_device.c