Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
build
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
lf
build
Commits
eaf7a4bc
Commit
eaf7a4bc
authored
10 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
10 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use setPowerMode interface for HWC 1.4 and above"
parents
ddf4bbe8
5e825875
No related branches found
Branches containing commit
Tags
LF.BR.1.2.7-01200-8x09.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patch/LF.BR.1.2.3/gecko/bug-1122850-Use-setPowerMode-interface-for-HWC-1.4-and-above.patch
+80
-0
80 additions, 0 deletions
...50-Use-setPowerMode-interface-for-HWC-1.4-and-above.patch
with
80 additions
and
0 deletions
patch/LF.BR.1.2.3/gecko/bug-1122850-Use-setPowerMode-interface-for-HWC-1.4-and-above.patch
0 → 100644
+
80
−
0
View file @
eaf7a4bc
From 86e2d82048c059c184a313400c7884d4557c3750 Mon Sep 17 00:00:00 2001
From: Sushil Chauhan <sushilchauhan@codeaurora.org>
Date: Fri, 3 Oct 2014 11:59:32 -0700
Subject: [PATCH] Use setPowerMode interface for HWC 1.4 and above
For HWC version 1.4 and above, HAL does not support blank interface.
Hence, setPowerMode() should be used in place of blank().
Change-Id: I2135f65a909b81a5182d0e0f9d7d39e11bb5e11a
---
widget/gonk/libdisplay/GonkDisplayJB.cpp | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/widget/gonk/libdisplay/GonkDisplayJB.cpp b/widget/gonk/libdisplay/GonkDisplayJB.cpp
index 89a7bcf..638e6de 100644
--- a/widget/gonk/libdisplay/GonkDisplayJB.cpp
+++ b/widget/gonk/libdisplay/GonkDisplayJB.cpp
@@ -130,18 +130,27 @@
GonkDisplayJB::GonkDisplayJB()
mSTClient = stc;
mSTClient->perform(mSTClient.get(), NATIVE_WINDOW_SET_BUFFER_COUNT, 2);
mSTClient->perform(mSTClient.get(), NATIVE_WINDOW_SET_USAGE,
GRALLOC_USAGE_HW_FB |
GRALLOC_USAGE_HW_RENDER |
GRALLOC_USAGE_HW_COMPOSER);
mList = (hwc_display_contents_1_t *)malloc(sizeof(*mList) + (sizeof(hwc_layer_1_t)*2));
- if (mHwc)
+ if (mHwc) {
+#if ANDROID_VERSION >= 21
+ if (mHwc->common.version >= HWC_DEVICE_API_VERSION_1_4) {
+ mHwc->setPowerMode(mHwc, HWC_DISPLAY_PRIMARY, HWC_POWER_MODE_NORMAL);
+ } else {
+ mHwc->blank(mHwc, HWC_DISPLAY_PRIMARY, 0);
+ }
+#else
mHwc->blank(mHwc, HWC_DISPLAY_PRIMARY, 0);
+#endif
+ }
if (error == NO_ERROR) {
ALOGI("Starting bootanimation with (%d) format framebuffer", surfaceformat);
StartBootAnimation();
} else
ALOGW("Couldn't show bootanimation (%s)", strerror(-error));
}
@@ -168,21 +177,30 @@
GonkDisplayJB::SetEnabled(bool enabled)
autosuspend_disable();
mPowerModule->setInteractive(mPowerModule, true);
}
if (!enabled && mEnabledCallback) {
mEnabledCallback(enabled);
}
+#if ANDROID_VERSION >= 21
+ if (mHwc->common.version >= HWC_DEVICE_API_VERSION_1_4) {
+ mHwc->setPowerMode(mHwc, HWC_DISPLAY_PRIMARY,
+ (enabled ? HWC_POWER_MODE_NORMAL : HWC_POWER_MODE_OFF));
+ } else {
+ mHwc->blank(mHwc, HWC_DISPLAY_PRIMARY, !enabled);
+ }
+#else
if (mHwc && mHwc->blank) {
mHwc->blank(mHwc, HWC_DISPLAY_PRIMARY, !enabled);
} else if (mFBDevice && mFBDevice->enableScreen) {
mFBDevice->enableScreen(mFBDevice, enabled);
}
+#endif
if (enabled && mEnabledCallback) {
mEnabledCallback(enabled);
}
if (!enabled) {
autosuspend_enable();
mPowerModule->setInteractive(mPowerModule, false);
--
2.1.2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment