radv: report timestampPeriod correctly
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 14 Apr 2017 17:00:26 +0000 (20:00 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 14 Apr 2017 20:15:55 +0000 (23:15 +0300)
The kernel returns frequency in kHz, so to convert to nanosecond
interval that Vulkan uses the dividend should be 1000000.0 and not
100000.0.

This fixes the GPU graph in DOOM and matches the amdgpu-pro blob.

Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_radeon_winsys.h

index 8783ad4e1ba5ec6ea43cd6ab8a92d2155fa04eee..62514983649546fee3e5de6da3ca5dfca07a231f 100644 (file)
@@ -653,7 +653,7 @@ void radv_GetPhysicalDeviceProperties(
                .storageImageSampleCounts                 = VK_SAMPLE_COUNT_1_BIT,
                .maxSampleMaskWords                       = 1,
                .timestampComputeAndGraphics              = false,
-               .timestampPeriod                          = 100000.0 / pdevice->rad_info.clock_crystal_freq,
+               .timestampPeriod                          = 1000000.0 / pdevice->rad_info.clock_crystal_freq,
                .maxClipDistances                         = 8,
                .maxCullDistances                         = 8,
                .maxCombinedClipAndCullDistances          = 8,
index 9f2430f75debf5762d49b5dc6a6d55efedbab0ee..f6bab7410d34c89903c103d0615e12cc163273fd 100644 (file)
@@ -95,7 +95,7 @@ struct radeon_info {
        uint32_t                    compute_rings;
        uint32_t                    vce_fw_version;
        uint32_t                    vce_harvest_config;
-       uint32_t                    clock_crystal_freq;
+       uint32_t                    clock_crystal_freq; /* in kHz */
 
        /* Kernel info. */
        uint32_t                    drm_major; /* version */