From 63c3768cf38c2d24e1e7c1ec99fece00365fc1a3 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 26 May 2023 17:23:54 +0100 Subject: [PATCH] panfrost: fix formatting of a couple of files that were missed Signed-off-by: Eric Engestrom Acked-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/ds/pan_pps_driver.cc | 43 +++++++++++++++++++++++++-------------- src/panfrost/ds/pan_pps_perf.cc | 37 +++++++++++++++++---------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/panfrost/ds/pan_pps_driver.cc b/src/panfrost/ds/pan_pps_driver.cc index 0453475..4ca44f4 100644 --- a/src/panfrost/ds/pan_pps_driver.cc +++ b/src/panfrost/ds/pan_pps_driver.cc @@ -20,8 +20,7 @@ #include #include -namespace pps -{ +namespace pps { PanfrostDriver::PanfrostDriver() { } @@ -30,12 +29,15 @@ PanfrostDriver::~PanfrostDriver() { } -uint64_t PanfrostDriver::get_min_sampling_period_ns() +uint64_t +PanfrostDriver::get_min_sampling_period_ns() { return 1000000; } -uint32_t find_id_within_group(uint32_t counter_id, const struct panfrost_perf_config *cfg) +uint32_t +find_id_within_group(uint32_t counter_id, + const struct panfrost_perf_config *cfg) { for (uint32_t cat_id = 0; cat_id < cfg->n_categories; ++cat_id) { const struct panfrost_perf_category *cat = &cfg->categories[cat_id]; @@ -74,7 +76,8 @@ PanfrostDriver::create_available_counters(const PanfrostPerf &perf) auto &pan_driver = PanfrostDriver::into(d); struct panfrost_perf *perf = pan_driver.perf->perf; uint32_t id_within_group = find_id_within_group(c.id, perf->cfg); - const auto counter = &perf->cfg->categories[c.group].counters[id_within_group]; + const auto counter = + &perf->cfg->categories[c.group].counters[id_within_group]; return int64_t(panfrost_perf_counter_read(counter, perf)); }); @@ -89,7 +92,8 @@ PanfrostDriver::create_available_counters(const PanfrostPerf &perf) return ret; } -bool PanfrostDriver::init_perfcnt() +bool +PanfrostDriver::init_perfcnt() { if (!dev) { dev = std::make_unique(drm_device.fd); @@ -103,12 +107,14 @@ bool PanfrostDriver::init_perfcnt() return true; } -void PanfrostDriver::enable_counter(const uint32_t counter_id) +void +PanfrostDriver::enable_counter(const uint32_t counter_id) { enabled_counters.push_back(counters[counter_id]); } -void PanfrostDriver::enable_all_counters() +void +PanfrostDriver::enable_all_counters() { enabled_counters.resize(counters.size()); for (size_t i = 0; i < counters.size(); ++i) { @@ -116,18 +122,21 @@ void PanfrostDriver::enable_all_counters() } } -void PanfrostDriver::enable_perfcnt(const uint64_t /* sampling_period_ns */) +void +PanfrostDriver::enable_perfcnt(const uint64_t /* sampling_period_ns */) { auto res = perf->enable(); if (!check(res, "Failed to enable performance counters")) { if (res == -ENOSYS) { - PERFETTO_FATAL("Please enable unstable ioctls with: modprobe panfrost unstable_ioctls=1"); + PERFETTO_FATAL( + "Please enable unstable ioctls with: modprobe panfrost unstable_ioctls=1"); } PERFETTO_FATAL("Please verify graphics card"); } } -bool PanfrostDriver::dump_perfcnt() +bool +PanfrostDriver::dump_perfcnt() { last_dump_ts = perfetto::base::GetBootTimeNs().count(); @@ -140,14 +149,16 @@ bool PanfrostDriver::dump_perfcnt() return true; } -uint64_t PanfrostDriver::next() +uint64_t +PanfrostDriver::next() { auto ret = last_dump_ts; last_dump_ts = 0; return ret; } -void PanfrostDriver::disable_perfcnt() +void +PanfrostDriver::disable_perfcnt() { perf->disable(); perf.reset(); @@ -157,12 +168,14 @@ void PanfrostDriver::disable_perfcnt() enabled_counters.clear(); } -uint32_t PanfrostDriver::gpu_clock_id() const +uint32_t +PanfrostDriver::gpu_clock_id() const { return perfetto::protos::pbzero::BUILTIN_CLOCK_BOOTTIME; } -uint64_t PanfrostDriver::gpu_timestamp() const +uint64_t +PanfrostDriver::gpu_timestamp() const { return perfetto::base::GetBootTimeNs().count(); } diff --git a/src/panfrost/ds/pan_pps_perf.cc b/src/panfrost/ds/pan_pps_perf.cc index e8d4a85..ddc8de9 100644 --- a/src/panfrost/ds/pan_pps_perf.cc +++ b/src/panfrost/ds/pan_pps_perf.cc @@ -2,14 +2,14 @@ #include #include -#include #include +#include -namespace pps -{ +namespace pps { PanfrostDevice::PanfrostDevice(int fd) - : ctx {ralloc_context(nullptr)} - , dev {reinterpret_cast(new struct panfrost_device())} + : ctx{ralloc_context(nullptr)}, + dev{reinterpret_cast( + new struct panfrost_device())} { assert(fd >= 0); panfrost_open_device(ctx, fd, dev); @@ -25,23 +25,23 @@ PanfrostDevice::~PanfrostDevice() } } -PanfrostDevice::PanfrostDevice(PanfrostDevice &&o) - : ctx {o.ctx} - , dev {o.dev} +PanfrostDevice::PanfrostDevice(PanfrostDevice &&o): ctx{o.ctx}, dev{o.dev} { o.ctx = nullptr; o.dev = nullptr; } -PanfrostDevice &PanfrostDevice::operator=(PanfrostDevice &&o) +PanfrostDevice & +PanfrostDevice::operator=(PanfrostDevice &&o) { std::swap(ctx, o.ctx); std::swap(dev, o.dev); return *this; } -PanfrostPerf::PanfrostPerf(const PanfrostDevice& dev) - : perf {reinterpret_cast(rzalloc(nullptr, struct panfrost_perf))} +PanfrostPerf::PanfrostPerf(const PanfrostDevice &dev) + : perf{reinterpret_cast( + rzalloc(nullptr, struct panfrost_perf))} { assert(perf); assert(dev.dev); @@ -56,31 +56,34 @@ PanfrostPerf::~PanfrostPerf() } } -PanfrostPerf::PanfrostPerf(PanfrostPerf &&o) - : perf {o.perf} +PanfrostPerf::PanfrostPerf(PanfrostPerf &&o): perf{o.perf} { o.perf = nullptr; } -PanfrostPerf &PanfrostPerf::operator=(PanfrostPerf &&o) +PanfrostPerf & +PanfrostPerf::operator=(PanfrostPerf &&o) { std::swap(perf, o.perf); return *this; } -int PanfrostPerf::enable() const +int +PanfrostPerf::enable() const { assert(perf); return panfrost_perf_enable(perf); } -void PanfrostPerf::disable() const +void +PanfrostPerf::disable() const { assert(perf); panfrost_perf_disable(perf); } -int PanfrostPerf::dump() const +int +PanfrostPerf::dump() const { assert(perf); return panfrost_perf_dump(perf); -- 2.7.4