summaryrefslogtreecommitdiff
path: root/power-libperfmgr
diff options
context:
space:
mode:
authorJia-yi Chen <jychen@google.com>2019-05-29 08:13:52 -0700
committerJia-yi Chen <jychen@google.com>2019-05-29 12:45:11 -0700
commit8d5c9526f93c01fe6f542589497af8d580307761 (patch)
tree718dadb71a1686c5664704c96434b65e3257cc9b /power-libperfmgr
parent4dbe1544c1d8a770cf2dcdc61a95cccf1a47cdbf (diff)
downloadpixel-8d5c9526f93c01fe6f542589497af8d580307761.tar.gz
PowerHAL: add CAMERA_STREAMING_SECURE mode
Extend CAMERA_STREMING hint to add CAMERA_STREAMING_SECURE mode for secure use case. Bug: 131263055 Test: Boot and test on both typical & secure streaming modes Change-Id: Ifde1414e3535c8744990fe5b3b3e944ecff88ae7
Diffstat (limited to 'power-libperfmgr')
-rw-r--r--power-libperfmgr/CameraMode.h1
-rw-r--r--power-libperfmgr/Power.cpp19
2 files changed, 14 insertions, 6 deletions
diff --git a/power-libperfmgr/CameraMode.h b/power-libperfmgr/CameraMode.h
index 6558ce8c..ce8f0c95 100644
--- a/power-libperfmgr/CameraMode.h
+++ b/power-libperfmgr/CameraMode.h
@@ -22,6 +22,7 @@ enum CameraStreamingMode {
CAMERA_STREAMING,
CAMERA_STREAMING_1080P,
CAMERA_STREAMING_4K,
+ CAMERA_STREAMING_SECURE,
CAMERA_STREAMING_MAX
};
diff --git a/power-libperfmgr/Power.cpp b/power-libperfmgr/Power.cpp
index aca64ca4..4a7cc8e1 100644
--- a/power-libperfmgr/Power.cpp
+++ b/power-libperfmgr/Power.cpp
@@ -51,10 +51,11 @@ constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering";
constexpr char kPowerHalConfigPath[] = "/vendor/etc/powerhint.json";
static const std::map<enum CameraStreamingMode, std::string> kCamStreamingHint = {
- {CAMERA_STREAMING_OFF, "CAMERA_STREAMING_OFF"},
- {CAMERA_STREAMING, "CAMERA_STREAMING"},
- {CAMERA_STREAMING_1080P, "CAMERA_STREAMING_1080P"},
- {CAMERA_STREAMING_4K, "CAMERA_STREAMING_4K"}};
+ {CAMERA_STREAMING_OFF, "CAMERA_STREAMING_OFF"},
+ {CAMERA_STREAMING, "CAMERA_STREAMING"},
+ {CAMERA_STREAMING_1080P, "CAMERA_STREAMING_1080P"},
+ {CAMERA_STREAMING_4K, "CAMERA_STREAMING_4K"},
+ {CAMERA_STREAMING_SECURE, "CAMERA_STREAMING_SECURE"}};
Power::Power()
: mHintManager(nullptr),
@@ -84,6 +85,10 @@ Power::Power()
ALOGI("Initialize with CAMERA_STREAMING_4K on");
mHintManager->DoHint("CAMERA_STREAMING_4K");
mCameraStreamingMode = CAMERA_STREAMING_4K;
+ } else if (state == "CAMERA_STREAMING_SECURE") {
+ ALOGI("Initialize with CAMERA_STREAMING_SECURE on");
+ mHintManager->DoHint("CAMERA_STREAMING_SECURE");
+ mCameraStreamingMode = CAMERA_STREAMING_SECURE;
} else if (state == "SUSTAINED_PERFORMANCE") {
ALOGI("Initialize with SUSTAINED_PERFORMANCE on");
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
@@ -289,8 +294,10 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
if ((mCameraStreamingMode != CAMERA_STREAMING_OFF)) {
const auto modeValue = kCamStreamingHint.at(mCameraStreamingMode);
mHintManager->EndHint(modeValue);
- // Boost 1s for tear down
- mHintManager->DoHint("CAMERA_LAUNCH", std::chrono::seconds(1));
+ if ((mCameraStreamingMode != CAMERA_STREAMING_SECURE)) {
+ // Boost 1s for tear down if not secure streaming use case
+ mHintManager->DoHint("CAMERA_LAUNCH", std::chrono::seconds(1));
+ }
}
if (mode != CAMERA_STREAMING_OFF) {