From f4b06927d10dd54f3be86f038ec757abd69f8dc8 Mon Sep 17 00:00:00 2001 From: Darren Hsu Date: Tue, 23 Jan 2024 17:39:10 +0800 Subject: [PATCH] powerstats: use display MRR state residency data provider Bug: 321871755 Test: vts-tradefed run vts -m VtsHalPowerStatsTargetTest Change-Id: I20b31f4c3f0ece92dc8bf5788edf414fd4023169 Signed-off-by: Darren Hsu --- powerstats/caiman/service.cpp | 24 +----------------------- powerstats/komodo/service.cpp | 24 +----------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/powerstats/caiman/service.cpp b/powerstats/caiman/service.cpp index c891a781..9228fead 100644 --- a/powerstats/caiman/service.cpp +++ b/powerstats/caiman/service.cpp @@ -33,29 +33,7 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer; void addDisplay(std::shared_ptr p) { // Add display residency stats - std::vector states = { - "Off", - "LP: 960x2142@1", - "LP: 960x2142@30", - "On: 960x2142@1", - "On: 960x2142@30", - "On: 960x2142@60", - "On: 960x2142@120", - "HBM: 960x2142@60", - "HBM: 960x2142@120", - "LP: 1280x2856@1", - "LP: 1280x2856@30", - "On: 1280x2856@1", - "On: 1280x2856@30", - "On: 1280x2856@60", - "On: 1280x2856@120", - "HBM: 1280x2856@60", - "HBM: 1280x2856@120"}; - - p->addStateResidencyDataProvider(std::make_unique( - "Display", - "/sys/class/backlight/panel0-backlight/state", - states)); + addDisplayMrr(p); // Add display energy consumer p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer( diff --git a/powerstats/komodo/service.cpp b/powerstats/komodo/service.cpp index 76bfa41e..9228fead 100644 --- a/powerstats/komodo/service.cpp +++ b/powerstats/komodo/service.cpp @@ -33,29 +33,7 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer; void addDisplay(std::shared_ptr p) { // Add display residency stats - std::vector states = { - "Off", - "LP: 1008x2244@1", - "LP: 1008x2244@30", - "On: 1008x2244@1", - "On: 1008x2244@30", - "On: 1008x2244@60", - "On: 1008x2244@120", - "HBM: 1008x2244@60", - "HBM: 1008x2244@120", - "LP: 1344x2992@1", - "LP: 1344x2992@30", - "On: 1344x2992@1", - "On: 1344x2992@30", - "On: 1344x2992@60", - "On: 1344x2992@120", - "HBM: 1344x2992@60", - "HBM: 1344x2992@120"}; - - p->addStateResidencyDataProvider(std::make_unique( - "Display", - "/sys/class/backlight/panel0-backlight/state", - states)); + addDisplayMrr(p); // Add display energy consumer p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(