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)
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

index 3fe2294..afe8755 100644 (file)
@@ -485,7 +485,9 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
       .EXT_attachment_feedback_loop_layout = true,
       .EXT_border_color_swizzle = device->rad_info.gfx_level >= GFX10,
       .EXT_buffer_device_address = true,
-      .EXT_calibrated_timestamps = RADV_SUPPORT_CALIBRATED_TIMESTAMPS,
+      .EXT_calibrated_timestamps = RADV_SUPPORT_CALIBRATED_TIMESTAMPS &&
+                                   !(device->rad_info.family == CHIP_RAVEN ||
+                                     device->rad_info.family == CHIP_RAVEN2),
       .EXT_color_write_enable = true,
       .EXT_conditional_rendering = true,
       .EXT_conservative_rasterization = device->rad_info.gfx_level >= GFX9,