summaryrefslogtreecommitdiff
path: root/libhwc2.1/pixel-display.cpp
diff options
context:
space:
mode:
authorlinpeter <linpeter@google.com>2021-04-14 00:10:13 +0800
committerlinpeter <linpeter@google.com>2021-06-03 16:18:17 +0800
commitff7ef118bddc84c2bc60097285e7cdd5dd157c04 (patch)
tree24a9355f350998732727b70a566cf71cfc9ff30d /libhwc2.1/pixel-display.cpp
parent11b37232ff5e6e36d92da85894ff2fd150375912 (diff)
libhwc2.1: pixel-display V2 interface implement
Bug: 184768835 Bug: 185087460 test: test lhbm function call Change-Id: I924d162713d95954855c706287f10f8cb696f763
Diffstat (limited to 'libhwc2.1/pixel-display.cpp')
-rw-r--r--libhwc2.1/pixel-display.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/libhwc2.1/pixel-display.cpp b/libhwc2.1/pixel-display.cpp
index f79967f..2ee58ef 100644
--- a/libhwc2.1/pixel-display.cpp
+++ b/libhwc2.1/pixel-display.cpp
@@ -91,6 +91,33 @@ ndk::ScopedAStatus Display::getLbeState(LbeState *_aidl_return) {
}
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
+
+ndk::ScopedAStatus Display::isLhbmSupported(bool *_aidl_return) {
+ if (mDevice) {
+ *_aidl_return = mDevice->isLhbmSupported();
+ return ndk::ScopedAStatus::ok();
+ }
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Display::setLhbmState(bool enabled) {
+ if (mDevice && mDevice->isLhbmSupported()) {
+ int32_t ret = mDevice->setLhbmState(enabled);
+ if (!ret)
+ return ndk::ScopedAStatus::ok();
+ else if (ret == TIMED_OUT)
+ return ndk::ScopedAStatus::fromExceptionCode(STATUS_TIMED_OUT);
+ }
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Display::getLhbmState(bool *_aidl_return) {
+ if (mDevice && mDevice->isLhbmSupported()) {
+ *_aidl_return = mDevice->getLhbmState();
+ return ndk::ScopedAStatus::ok();
+ }
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
} // namespace display
} // namespace pixel
} // namespace hardware