diff --git a/src/panfrost/perf/pan_perf.c b/src/panfrost/perf/pan_perf.c index 4e3db68db54..a6010c88cb8 100644 --- a/src/panfrost/perf/pan_perf.c +++ b/src/panfrost/perf/pan_perf.c @@ -111,3 +111,24 @@ pan_perf_dump(struct pan_perf *perf) { return pan_kmod_perf_dump(perf->session); } + +uint64_t +pan_perf_get_timestamp(const struct pan_perf *perf) +{ + return perf->session->data_ts; +} + +bool +pan_perf_timestamp_supported(const struct pan_perf *perf) +{ + return perf->session->data_ts_supported; +} + +uint64_t +pan_perf_get_min_sampling_period(const struct pan_perf *perf) +{ + if (pan_arch(perf->dev->props.gpu_id) < 10) + return 1000000; + else + return 500000; +} diff --git a/src/panfrost/perf/pan_perf.h b/src/panfrost/perf/pan_perf.h index 7cbc4a9a20c..752a0db1a1d 100644 --- a/src/panfrost/perf/pan_perf.h +++ b/src/panfrost/perf/pan_perf.h @@ -95,6 +95,12 @@ void pan_perf_finish(struct pan_perf *perf); int pan_perf_dump(struct pan_perf *perf); +uint64_t pan_perf_get_timestamp(const struct pan_perf *perf); + +bool pan_perf_timestamp_supported(const struct pan_perf *perf); + +uint64_t pan_perf_get_min_sampling_period(const struct pan_perf *perf); + #if defined(__cplusplus) } // extern "C" #endif