intel: common: express timestamps units in frequency
Rather than storing the period as a double that looses some precision. Also fixes the Gen9LP timestamp frequency which is no 19200123 but 19200000 as pointed by Ville : https://lists.freedesktop.org/archives/intel-gfx/2017-April/125126.html Finally add the Cannonlake timestamp frequency. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
e5743ee014
commit
c77d98ef32
|
@ -36,7 +36,7 @@ static const struct gen_device_info gen_device_info_i965 = {
|
||||||
.urb = {
|
.urb = {
|
||||||
.size = 256,
|
.size = 256,
|
||||||
},
|
},
|
||||||
.timebase_scale = 80,
|
.timestamp_frequency = 12500000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_g4x = {
|
static const struct gen_device_info gen_device_info_g4x = {
|
||||||
|
@ -52,7 +52,7 @@ static const struct gen_device_info gen_device_info_g4x = {
|
||||||
.urb = {
|
.urb = {
|
||||||
.size = 384,
|
.size = 384,
|
||||||
},
|
},
|
||||||
.timebase_scale = 80,
|
.timestamp_frequency = 12500000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_ilk = {
|
static const struct gen_device_info gen_device_info_ilk = {
|
||||||
|
@ -67,7 +67,7 @@ static const struct gen_device_info gen_device_info_ilk = {
|
||||||
.urb = {
|
.urb = {
|
||||||
.size = 1024,
|
.size = 1024,
|
||||||
},
|
},
|
||||||
.timebase_scale = 80,
|
.timestamp_frequency = 12500000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_snb_gt1 = {
|
static const struct gen_device_info gen_device_info_snb_gt1 = {
|
||||||
|
@ -92,7 +92,7 @@ static const struct gen_device_info gen_device_info_snb_gt1 = {
|
||||||
[MESA_SHADER_GEOMETRY] = 256,
|
[MESA_SHADER_GEOMETRY] = 256,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.timebase_scale = 80,
|
.timestamp_frequency = 12500000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_snb_gt2 = {
|
static const struct gen_device_info gen_device_info_snb_gt2 = {
|
||||||
|
@ -117,7 +117,7 @@ static const struct gen_device_info gen_device_info_snb_gt2 = {
|
||||||
[MESA_SHADER_GEOMETRY] = 256,
|
[MESA_SHADER_GEOMETRY] = 256,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.timebase_scale = 80,
|
.timestamp_frequency = 12500000,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GEN7_FEATURES \
|
#define GEN7_FEATURES \
|
||||||
|
@ -127,7 +127,7 @@ static const struct gen_device_info gen_device_info_snb_gt2 = {
|
||||||
.has_llc = true, \
|
.has_llc = true, \
|
||||||
.has_pln = true, \
|
.has_pln = true, \
|
||||||
.has_surface_tile_offset = true, \
|
.has_surface_tile_offset = true, \
|
||||||
.timebase_scale = 80
|
.timestamp_frequency = 12500000
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_ivb_gt1 = {
|
static const struct gen_device_info gen_device_info_ivb_gt1 = {
|
||||||
GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
|
GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
|
||||||
|
@ -300,7 +300,7 @@ static const struct gen_device_info gen_device_info_hsw_gt3 = {
|
||||||
.max_tes_threads = 504, \
|
.max_tes_threads = 504, \
|
||||||
.max_gs_threads = 504, \
|
.max_gs_threads = 504, \
|
||||||
.max_wm_threads = 384, \
|
.max_wm_threads = 384, \
|
||||||
.timebase_scale = 80
|
.timestamp_frequency = 12500000
|
||||||
|
|
||||||
static const struct gen_device_info gen_device_info_bdw_gt1 = {
|
static const struct gen_device_info gen_device_info_bdw_gt1 = {
|
||||||
GEN8_FEATURES, .gt = 1,
|
GEN8_FEATURES, .gt = 1,
|
||||||
|
@ -398,7 +398,7 @@ static const struct gen_device_info gen_device_info_chv = {
|
||||||
.max_tcs_threads = 336, \
|
.max_tcs_threads = 336, \
|
||||||
.max_tes_threads = 336, \
|
.max_tes_threads = 336, \
|
||||||
.max_cs_threads = 56, \
|
.max_cs_threads = 56, \
|
||||||
.timebase_scale = 1000000000.0 / 12000000.0, \
|
.timestamp_frequency = 12000000, \
|
||||||
.urb = { \
|
.urb = { \
|
||||||
.size = 384, \
|
.size = 384, \
|
||||||
.min_entries = { \
|
.min_entries = { \
|
||||||
|
@ -423,7 +423,7 @@ static const struct gen_device_info gen_device_info_chv = {
|
||||||
.max_tes_threads = 112, \
|
.max_tes_threads = 112, \
|
||||||
.max_gs_threads = 112, \
|
.max_gs_threads = 112, \
|
||||||
.max_cs_threads = 6 * 6, \
|
.max_cs_threads = 6 * 6, \
|
||||||
.timebase_scale = 1000000000.0 / 19200123.0, \
|
.timestamp_frequency = 19200000, \
|
||||||
.urb = { \
|
.urb = { \
|
||||||
.size = 192, \
|
.size = 192, \
|
||||||
.min_entries = { \
|
.min_entries = { \
|
||||||
|
@ -595,6 +595,7 @@ static const struct gen_device_info gen_device_info_glk_2x6 = {
|
||||||
.max_tcs_threads = 432, \
|
.max_tcs_threads = 432, \
|
||||||
.max_tes_threads = 624, \
|
.max_tes_threads = 624, \
|
||||||
.max_cs_threads = 56, \
|
.max_cs_threads = 56, \
|
||||||
|
.timestamp_frequency = 19200000, \
|
||||||
.urb = { \
|
.urb = { \
|
||||||
.size = 256, \
|
.size = 256, \
|
||||||
.min_entries = { \
|
.min_entries = { \
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define GEN_DEVICE_INFO_H
|
#define GEN_DEVICE_INFO_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intel hardware information and quirks
|
* Intel hardware information and quirks
|
||||||
|
@ -159,7 +160,7 @@ struct gen_device_info
|
||||||
* corresponded to 80 nanoseconds.
|
* corresponded to 80 nanoseconds.
|
||||||
*
|
*
|
||||||
* Since Gen9 the numbers aren't so round, with a a frequency of 12MHz for
|
* Since Gen9 the numbers aren't so round, with a a frequency of 12MHz for
|
||||||
* SKL (or scale factor of 83.33333333) and a frequency of 19200123Hz for
|
* SKL (or scale factor of 83.33333333) and a frequency of 19200000Hz for
|
||||||
* BXT.
|
* BXT.
|
||||||
*
|
*
|
||||||
* For simplicty to fit with the current code scaling by a single constant
|
* For simplicty to fit with the current code scaling by a single constant
|
||||||
|
@ -174,7 +175,7 @@ struct gen_device_info
|
||||||
* E.g. with crude testing on my system using the 'correct' scale factor I'm
|
* E.g. with crude testing on my system using the 'correct' scale factor I'm
|
||||||
* seeing a drift of ~2 milliseconds per second.
|
* seeing a drift of ~2 milliseconds per second.
|
||||||
*/
|
*/
|
||||||
double timebase_scale;
|
uint64_t timestamp_frequency;
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
};
|
};
|
||||||
|
|
|
@ -868,7 +868,7 @@ void anv_GetPhysicalDeviceProperties(
|
||||||
.storageImageSampleCounts = VK_SAMPLE_COUNT_1_BIT,
|
.storageImageSampleCounts = VK_SAMPLE_COUNT_1_BIT,
|
||||||
.maxSampleMaskWords = 1,
|
.maxSampleMaskWords = 1,
|
||||||
.timestampComputeAndGraphics = false,
|
.timestampComputeAndGraphics = false,
|
||||||
.timestampPeriod = devinfo->timebase_scale,
|
.timestampPeriod = 1000000000ull / devinfo->timestamp_frequency,
|
||||||
.maxClipDistances = 8,
|
.maxClipDistances = 8,
|
||||||
.maxCullDistances = 8,
|
.maxCullDistances = 8,
|
||||||
.maxCombinedClipAndCullDistances = 8,
|
.maxCombinedClipAndCullDistances = 8,
|
||||||
|
|
|
@ -47,7 +47,7 @@ brw_timebase_scale(struct brw_context *brw, uint64_t gpu_timestamp)
|
||||||
{
|
{
|
||||||
const struct gen_device_info *devinfo = &brw->screen->devinfo;
|
const struct gen_device_info *devinfo = &brw->screen->devinfo;
|
||||||
|
|
||||||
return (double)gpu_timestamp * devinfo->timebase_scale;
|
return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* As best we know currently, the Gen HW timestamps are 36bits across
|
/* As best we know currently, the Gen HW timestamps are 36bits across
|
||||||
|
|
Loading…
Reference in New Issue