diff options
author | Vinoth Jayaram <c_vinoja@codeaurora.org> | 2020-07-06 17:37:03 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-07-08 00:34:12 -0700 |
commit | 97cd61330667628b1365cc4b2e9285832c18a623 (patch) | |
tree | 5d76d8e4854c4ed7bd13e0f75291abc9ba2154a0 | |
parent | 4629b4eadcfd2994d566a3999f275a38365431a8 (diff) |
display: Added APIs based on IComposer 2.4
Added Composer_V2.4 APIs to handle VTS failures,
SetAutoLowLatencyMode
GetSupportedContentTypes
SetContentType
Change-Id: Ic0ca966aef2e44657312c55bc6156f86eceeb033
-rw-r--r-- | sdm/libs/hwc2/hwc_session.cpp | 36 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_session.h | 11 |
2 files changed, 43 insertions, 4 deletions
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp index 8a51ea78..2cd107bf 100644 --- a/sdm/libs/hwc2/hwc_session.cpp +++ b/sdm/libs/hwc2/hwc_session.cpp @@ -1158,6 +1158,33 @@ int32_t HWCSession::GetDozeSupport(hwc2_device_t *device, hwc2_display_t display return HWC2_ERROR_NONE; } +int32_t HWCSession::SetAutoLowLatencyMode(hwc2_device_t *device, hwc2_display_t display, bool on) { + if (!device || display >= HWCCallbacks::kNumDisplays) { + return HWC2_ERROR_BAD_DISPLAY; + } + return HWC2_ERROR_UNSUPPORTED; +} + +int32_t HWCSession::GetSupportedContentTypes(hwc2_device_t *device, hwc2_display_t display, + uint32_t *count, uint32_t *contentTypes) { + contentTypes = {}; + if (!device || display >= HWCCallbacks::kNumDisplays) { + return HWC2_ERROR_BAD_DISPLAY; + } + return HWC2_ERROR_NONE; +} + +int32_t HWCSession::SetContentType(hwc2_device_t *device, hwc2_display_t display, + int32_t type) { + if (!device || display >= HWCCallbacks::kNumDisplays) { + return HWC2_ERROR_BAD_DISPLAY; + } + if (type == UINT32(composer_V2_4::IComposerClient::ContentType::NONE)) { + return HWC2_ERROR_NONE; + } + return HWC2_ERROR_UNSUPPORTED; +} + int32_t HWCSession::ValidateDisplay(hwc2_device_t *device, hwc2_display_t display, uint32_t *out_num_types, uint32_t *out_num_requests) { // out_num_types and out_num_requests will be non-NULL @@ -1327,6 +1354,12 @@ hwc2_function_pointer_t HWCSession::GetFunction(struct hwc2_device *device, case HWC2::FunctionDescriptor::SetActiveConfigWithConstraints: return AsFP<HWC2_PFN_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS> (HWCSession::SetActiveConfigWithConstraints); + case HWC2::FunctionDescriptor::SetAutoLowLatencyMode: + return AsFP<HWC2_PFN_SET_AUTO_LOW_LATENCY_MODE>(HWCSession::SetAutoLowLatencyMode); + case HWC2::FunctionDescriptor::GetSupportedContentTypes: + return AsFP<HWC2_PFN_GET_SUPPORTED_CONTENT_TYPES>(HWCSession::GetSupportedContentTypes); + case HWC2::FunctionDescriptor::SetContentType: + return AsFP<HWC2_PFN_SET_CONTENT_TYPE>(HWCSession::SetContentType); default: DLOGD("Unknown/Unimplemented function descriptor: %d (%s)", int_descriptor, to_string(descriptor).c_str()); @@ -3306,7 +3339,7 @@ int32_t HWCSession::GetDisplayCapabilities(hwc2_device_t *device, hwc2_display_t if (!outCapabilities) { *outNumCapabilities = 0; if (isBuiltin) { - *outNumCapabilities = 3; + *outNumCapabilities = 4; } return HWC2_ERROR_NONE; } else { @@ -3320,6 +3353,7 @@ int32_t HWCSession::GetDisplayCapabilities(hwc2_device_t *device, hwc2_display_t outCapabilities[index++] = HWC2_DISPLAY_CAPABILITY_DOZE; } outCapabilities[index++] = HWC2_DISPLAY_CAPABILITY_BRIGHTNESS; + outCapabilities[index++] = UINT32(HwcDisplayCapability::PROTECTED_CONTENTS); *outNumCapabilities = index; } return HWC2_ERROR_NONE; diff --git a/sdm/libs/hwc2/hwc_session.h b/sdm/libs/hwc2/hwc_session.h index 50b79bcc..f1b054aa 100644 --- a/sdm/libs/hwc2/hwc_session.h +++ b/sdm/libs/hwc2/hwc_session.h @@ -43,14 +43,16 @@ #include "hwc_socket_handler.h" #include "hwc_display_event_handler.h" #include "hwc_buffer_sync_handler.h" - +#include <android/hardware/graphics/composer/2.4/IComposerClient.h> namespace sdm { - using ::android::hardware::Return; using ::android::hardware::hidl_string; using android::hardware::hidl_handle; using ::android::hardware::hidl_vec; +namespace composer_V2_4 = ::android::hardware::graphics::composer::V2_4; +using HwcDisplayCapability = composer_V2_4::IComposerClient::DisplayCapability; + int32_t GetDataspaceFromColorMode(ColorMode mode); typedef DisplayConfig::DisplayType DispType; @@ -230,7 +232,10 @@ class HWCSession : hwc2_device_t, HWCUEventListener, public qClient::BnQClient, int32_t int_enabled); static int32_t GetDozeSupport(hwc2_device_t *device, hwc2_display_t display, int32_t *out_support); - + static int32_t SetAutoLowLatencyMode(hwc2_device_t *device, hwc2_display_t display, bool on); + static int32_t GetSupportedContentTypes(hwc2_device_t *device, hwc2_display_t display, + uint32_t *count, uint32_t *contentTypes); + static int32_t SetContentType(hwc2_device_t *device, hwc2_display_t display,int32_t type); static Locker locker_[HWCCallbacks::kNumDisplays]; static Locker power_state_[HWCCallbacks::kNumDisplays]; static Locker display_config_locker_; |