intel/pps: provide accurate min sampling period

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>
This commit is contained in:
Lionel Landwerlin
2021-10-28 11:13:00 +03:00
parent 3dda80fcf6
commit 43d5b55bc1
+7 -1
View File
@@ -26,9 +26,15 @@
namespace pps
{
// The HW sampling period is programmed using period_exponent following this
// formula:
// sample_period = timestamp_period * 2^(period_exponent + 1)
// So our minimum sampling period is twice the timestamp period
uint64_t IntelDriver::get_min_sampling_period_ns()
{
return 500000;
return (2.f * perf->devinfo.timestamp_frequency) / 1000000000ull;
}
void IntelDriver::enable_counter(uint32_t counter_id)