pan/pps: Generalize timing related settings

This commit is contained in:
Christoph Pillmayer 2026-03-20 11:42:29 +01:00
parent 1afc465345
commit fd5b441d35

View file

@ -69,17 +69,22 @@ bool
PanfrostPerf::dump_perfcnt()
{
assert(perf);
last_dump_ts = perfetto::base::GetBootTimeNs().count();
int ret = pan_perf_dump(perf);
if (pan_perf_timestamp_supported(perf))
last_dump_ts = pan_perf_get_timestamp(perf);
else
last_dump_ts = perfetto::base::GetBootTimeNs().count();
return !!(ret >= 0);
}
uint64_t
PanfrostPerf::get_min_sampling_period_ns()
{
return 1000000;
assert(perf);
return pan_perf_get_min_sampling_period(perf);
}
void *
@ -196,19 +201,24 @@ PanfrostPerf::next()
uint32_t
PanfrostPerf::gpu_clock_id() const
{
return perfetto::protos::pbzero::BUILTIN_CLOCK_BOOTTIME;
assert(perf);
if (pan_perf_timestamp_supported(perf))
return perfetto::protos::pbzero::BUILTIN_CLOCK_MONOTONIC_RAW;
else
return perfetto::protos::pbzero::BUILTIN_CLOCK_BOOTTIME;
}
uint64_t
PanfrostPerf::gpu_timestamp() const
{
// TODO (panthor) This information is present in the dump
return perfetto::base::GetBootTimeNs().count();
}
bool
PanfrostPerf::cpu_gpu_timestamp(uint64_t &, uint64_t &) const
{
/* Not supported */
// TODO (panthor) Start using the appropriate IOCTL to get these values
return false;
}