Mesa (main): intel/pps: provide accurate min sampling period

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 28 10:43:17 UTC 2021


Module: Mesa
Branch: main
Commit: 43d5b55bc1691e9d3a4fdb24086fa3d626d4974c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=43d5b55bc1691e9d3a4fdb24086fa3d626d4974c

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Thu Oct 28 11:13:00 2021 +0300

intel/pps: provide accurate min sampling period

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13571>

---

 src/intel/ds/intel_pps_driver.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/intel/ds/intel_pps_driver.cc b/src/intel/ds/intel_pps_driver.cc
index 5406292a218..6c79acd0ad0 100644
--- a/src/intel/ds/intel_pps_driver.cc
+++ b/src/intel/ds/intel_pps_driver.cc
@@ -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)



More information about the mesa-commit mailing list