powerstats: update display state residency configs

Bug: 291861112
Test: vts-tradefed run vts -m VtsHalPowerStatsTargetTest
Change-Id: I242666ccdd116891ebf34671afb67d1f504ee79e
Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
Darren Hsu 2023-10-31 16:50:56 +08:00
parent d11bf74374
commit b50e598270

View file

@ -32,26 +32,43 @@ using aidl::android::hardware::power::stats::EnergyConsumerType;
using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
void addDisplay(std::shared_ptr<PowerStats> p) {
// Add display residency stats
std::vector<std::string> states = {
// Add display residency stats for inner display
std::vector<std::string> inner_states = {
"Off",
"LP: 1440x3120@30",
"On: 1440x3120@60",
"On: 1440x3120@90",
"HBM: 1440x3120@60",
"HBM: 1440x3120@90"};
"LP: 2152x2076@1",
"LP: 2152x2076@30",
"On: 2152x2076@1",
"On: 2152x2076@10",
"On: 2152x2076@60",
"On: 2152x2076@120",
"HBM: 2152x2076@60",
"HBM: 2152x2076@120"};
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
"Display",
"Inner Display",
"/sys/class/backlight/panel0-backlight/state",
states));
inner_states));
// Add display residency stats for outer display
std::vector<std::string> outer_states = {
"Off",
"LP: 1080x2424@30",
"On: 1080x2424@60",
"On: 1080x2424@120",
"HBM: 1080x2424@60",
"HBM: 1080x2424@120"};
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
"Outer Display",
"/sys/class/backlight/panel1-backlight/state",
outer_states));
// Add display energy consumer
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
p,
EnergyConsumerType::DISPLAY,
"Display",
{"VSYS_PWR_DISPLAY"}));
{"VSYS_PWR_DISPLAY"}));// VSYS_PWR_DISPLAY = inner + outer
}
int main() {