From 10202aafeee34bbd9147e41ca52b8fbe62545b4a Mon Sep 17 00:00:00 2001 From: Darren Hsu Date: Wed, 4 May 2022 15:11:59 +0800 Subject: [PATCH] powerstats: update display state residency stats Bug: 227285142 Bug: 227401938 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: I8720575722f8a3574052b241f472549b507cf215 Signed-off-by: Darren Hsu --- powerstats/service.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/powerstats/service.cpp b/powerstats/service.cpp index 32515ee..159a427 100644 --- a/powerstats/service.cpp +++ b/powerstats/service.cpp @@ -35,26 +35,22 @@ void addDisplay(std::shared_ptr p) { // Add display residency stats std::vector states = { "Off", - "LP: 1080x2340@30", - "On: 1080x2340@60", - "On: 1080x2340@90", - "HBM: 1080x2340@60", - "HBM: 1080x2340@90"}; + "LP: 1080x2400@30", + "On: 1080x2400@60", + "On: 1080x2400@90", + "HBM: 1080x2400@60", + "HBM: 1080x2400@90"}; p->addStateResidencyDataProvider(std::make_unique("Display", "/sys/class/backlight/panel0-backlight/state", states)); // Add display energy consumer - /* - * TODO(b/167216667): Add correct display power model here. Must read from display rail - * and include proper coefficients for display states. - */ p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(p, - EnergyConsumerType::DISPLAY, "display", {"PPVAR_VSYS_PWR_DISP"}, "Display", - {{"LP: 1080x2340@30", 1}, - {"On: 1080x2340@60", 2}, - {"On: 1080x2340@90", 3}})); + EnergyConsumerType::DISPLAY, "display", {"VSYS_PWR_DISPLAY"}, "Display", + {{"LP: 1080x2400@30", 1}, + {"On: 1080x2400@60", 2}, + {"On: 1080x2400@90", 3}})); } int main() {