powerstats: update display resolution setting

Since runtime resolution switching is enabled, the specific device
supports to run QHD displays at lower FHD resolutions. So we should
support both QHD/FHD resolution settings in PowerStats HAL.

Bug: 232313626
Test: dump power stats at QHD/FHD resolutions
Change-Id: I46a45c078da146a8ecbeb49af4765771a2c0b651
Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
Darren Hsu 2022-05-23 17:06:23 +08:00
parent 6d769090c0
commit 3c30a321f7
2 changed files with 22 additions and 16 deletions

View file

@ -38,15 +38,18 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
// Add display residency stats // Add display residency stats
std::vector<std::string> states = { std::vector<std::string> states = {
"Off", "Off",
"LP: 1440x3120@1",
"LP: 1440x3120@10",
"LP: 1440x3120@30", "LP: 1440x3120@30",
"On: 1440x3120@10",
"On: 1440x3120@60", "On: 1440x3120@60",
"On: 1440x3120@90",
"On: 1440x3120@120", "On: 1440x3120@120",
"HBM: 1440x3120@60", "HBM: 1440x3120@60",
"HBM: 1440x3120@90", "HBM: 1440x3120@120",
"HBM: 1440x3120@120"}; "LP: 1080x2340@30",
"On: 1080x2340@10",
"On: 1080x2340@60",
"On: 1080x2340@120",
"HBM: 1080x2340@60",
"HBM: 1080x2340@120"};
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>( p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
"Display", "Display",
@ -55,16 +58,19 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
// Add display energy consumer // Add display energy consumer
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer( p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(
p, EnergyConsumerType::DISPLAY, "display", {"PPVAR_VSYS_PWR_DISP"}, "Display", p, EnergyConsumerType::DISPLAY, "display", {"VSYS_PWR_DISPLAY"}, "Display",
{{"LP: 1440x3120@1", 1}, {{"LP: 1440x3120@30", 1},
{"LP: 1440x3120@10", 2}, {"On: 1440x3120@10", 2},
{"LP: 1440x3120@30", 3}, {"On: 1440x3120@60", 3},
{"On: 1440x3120@60", 4}, {"On: 1440x3120@120", 4},
{"On: 1440x3120@90", 5}, {"HBM: 1440x3120@60", 5},
{"On: 1440x3120@120", 6}, {"HBM: 1440x3120@120", 6},
{"HBM: 1440x3120@60", 7}, {"LP: 1080x2340@30", 7},
{"HBM: 1440x3120@90", 8}, {"On: 1080x2340@10", 8},
{"HBM: 1440x3120@120", 9}})); {"On: 1080x2340@60", 9},
{"On: 1080x2340@120", 10},
{"HBM: 1080x2340@60", 11},
{"HBM: 1080x2340@120", 12}}));
} }
void addUwb(std::shared_ptr<PowerStats> p) { void addUwb(std::shared_ptr<PowerStats> p) {

View file

@ -49,7 +49,7 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
// Add display energy consumer // Add display energy consumer
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer( p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(
p, EnergyConsumerType::DISPLAY, "display", {"PPVAR_VSYS_PWR_DISP"}, "Display", p, EnergyConsumerType::DISPLAY, "display", {"VSYS_PWR_DISPLAY"}, "Display",
{{"LP: 1080x2400@30", 1}, {{"LP: 1080x2400@30", 1},
{"On: 1080x2400@60", 2}, {"On: 1080x2400@60", 2},
{"On: 1080x2400@90", 3}, {"On: 1080x2400@90", 3},