powerstats: use display MRR state residency data provider
Bug: 322717818 Test: vts-tradefed run vts -m VtsHalPowerStatsTargetTest Change-Id: I67e9659e37bd34100a6be5d6352f4dc6341d628b Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
parent
c956bde435
commit
04a4c33897
1 changed files with 17 additions and 10 deletions
|
@ -34,6 +34,12 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
|||
|
||||
void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||
// Add display residency stats
|
||||
struct stat buffer;
|
||||
if (!stat("/sys/class/drm/card0/device/primary-panel/time_in_state", &buffer)) {
|
||||
// time_in_state exists
|
||||
addDisplayMrr(p);
|
||||
} else {
|
||||
// time_in_state doesn't exist
|
||||
std::vector<std::string> states = {
|
||||
"Off",
|
||||
"LP: 1080x2400@30",
|
||||
|
@ -45,6 +51,7 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
|
|||
"Display",
|
||||
"/sys/class/backlight/panel0-backlight/state",
|
||||
states));
|
||||
}
|
||||
|
||||
// Add display energy consumer
|
||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue