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:
parent
d11bf74374
commit
b50e598270
1 changed files with 27 additions and 10 deletions
|
@ -32,26 +32,43 @@ using aidl::android::hardware::power::stats::EnergyConsumerType;
|
||||||
using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
||||||
|
|
||||||
void addDisplay(std::shared_ptr<PowerStats> p) {
|
void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||||
// Add display residency stats
|
// Add display residency stats for inner display
|
||||||
std::vector<std::string> states = {
|
std::vector<std::string> inner_states = {
|
||||||
"Off",
|
"Off",
|
||||||
"LP: 1440x3120@30",
|
"LP: 2152x2076@1",
|
||||||
"On: 1440x3120@60",
|
"LP: 2152x2076@30",
|
||||||
"On: 1440x3120@90",
|
"On: 2152x2076@1",
|
||||||
"HBM: 1440x3120@60",
|
"On: 2152x2076@10",
|
||||||
"HBM: 1440x3120@90"};
|
"On: 2152x2076@60",
|
||||||
|
"On: 2152x2076@120",
|
||||||
|
"HBM: 2152x2076@60",
|
||||||
|
"HBM: 2152x2076@120"};
|
||||||
|
|
||||||
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
|
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
|
||||||
"Display",
|
"Inner Display",
|
||||||
"/sys/class/backlight/panel0-backlight/state",
|
"/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
|
// Add display energy consumer
|
||||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
||||||
p,
|
p,
|
||||||
EnergyConsumerType::DISPLAY,
|
EnergyConsumerType::DISPLAY,
|
||||||
"Display",
|
"Display",
|
||||||
{"VSYS_PWR_DISPLAY"}));
|
{"VSYS_PWR_DISPLAY"}));// VSYS_PWR_DISPLAY = inner + outer
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue