Merge "powerstats: use display VRR power stats on specific devices" into 24D1-dev am: 8819c05d14
Original change: https://googleplex-android-review.googlesource.com/c/device/google/caimito/+/26552978 Change-Id: I996cb32a6dd48c5f8e75e3d5b10767e86e8a1c20 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
e0096ab48e
2 changed files with 2 additions and 64 deletions
|
@ -33,38 +33,6 @@ 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
|
||||
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: 960x2142@1",
|
||||
"LP: 960x2142@30",
|
||||
"On: 960x2142@1",
|
||||
"On: 960x2142@30",
|
||||
"On: 960x2142@60",
|
||||
"On: 960x2142@120",
|
||||
"HBM: 960x2142@60",
|
||||
"HBM: 960x2142@120",
|
||||
"LP: 1280x2856@1",
|
||||
"LP: 1280x2856@30",
|
||||
"On: 1280x2856@1",
|
||||
"On: 1280x2856@30",
|
||||
"On: 1280x2856@60",
|
||||
"On: 1280x2856@120",
|
||||
"HBM: 1280x2856@60",
|
||||
"HBM: 1280x2856@120"};
|
||||
|
||||
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
|
||||
"Display",
|
||||
"/sys/class/backlight/panel0-backlight/state",
|
||||
states));
|
||||
}
|
||||
|
||||
// Add display energy consumer
|
||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
||||
p,
|
||||
|
@ -81,6 +49,7 @@ int main() {
|
|||
|
||||
std::shared_ptr<PowerStats> p = ndk::SharedRefBase::make<PowerStats>();
|
||||
|
||||
addDisplayVrr(p, "Display");
|
||||
addZumaProCommonDataProviders(p);
|
||||
addDisplay(p);
|
||||
|
||||
|
|
|
@ -33,38 +33,6 @@ 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
|
||||
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: 1008x2244@1",
|
||||
"LP: 1008x2244@30",
|
||||
"On: 1008x2244@1",
|
||||
"On: 1008x2244@30",
|
||||
"On: 1008x2244@60",
|
||||
"On: 1008x2244@120",
|
||||
"HBM: 1008x2244@60",
|
||||
"HBM: 1008x2244@120",
|
||||
"LP: 1344x2992@1",
|
||||
"LP: 1344x2992@30",
|
||||
"On: 1344x2992@1",
|
||||
"On: 1344x2992@30",
|
||||
"On: 1344x2992@60",
|
||||
"On: 1344x2992@120",
|
||||
"HBM: 1344x2992@60",
|
||||
"HBM: 1344x2992@120"};
|
||||
|
||||
p->addStateResidencyDataProvider(std::make_unique<DisplayStateResidencyDataProvider>(
|
||||
"Display",
|
||||
"/sys/class/backlight/panel0-backlight/state",
|
||||
states));
|
||||
}
|
||||
|
||||
// Add display energy consumer
|
||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
||||
p,
|
||||
|
@ -81,6 +49,7 @@ int main() {
|
|||
|
||||
std::shared_ptr<PowerStats> p = ndk::SharedRefBase::make<PowerStats>();
|
||||
|
||||
addDisplayVrr(p, "Display");
|
||||
addZumaProCommonDataProviders(p);
|
||||
addDisplay(p);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue