diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-05 05:18:40 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-05 05:18:40 -0800 |
commit | f0472016a9c3afee3ca995226d815dd109015d1d (patch) | |
tree | 18ecfeda192246407352a64681a2fd81f3ad53e9 | |
parent | 938353c7e5f7e6dcefab803274f374eea77ac9e0 (diff) | |
parent | 46db33696556a79dcd6a69cd972d104d085147ac (diff) | |
download | display-f0472016a9c3afee3ca995226d815dd109015d1d.tar.gz |
Merge "sdm: Define DPPS control interface"
-rw-r--r-- | sdm/include/private/dpps_control_interface.h | 40 | ||||
-rw-r--r-- | sdm/include/private/extension_interface.h | 4 | ||||
-rw-r--r-- | sdm/libs/core/Android.mk | 3 | ||||
-rw-r--r-- | sdm/libs/core/comp_manager.cpp | 13 | ||||
-rw-r--r-- | sdm/libs/core/comp_manager.h | 2 | ||||
-rw-r--r-- | sdm/libs/core/display_base.cpp | 21 |
6 files changed, 71 insertions, 12 deletions
diff --git a/sdm/include/private/dpps_control_interface.h b/sdm/include/private/dpps_control_interface.h new file mode 100644 index 00000000..8a449079 --- /dev/null +++ b/sdm/include/private/dpps_control_interface.h @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2016, The Linux Foundation. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are permitted +* provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright notice, this list of +* conditions and the following disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its contributors may be used to +* endorse or promote products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef __DPPS_CONTROL_INTERFACE_H__ +#define __DPPS_CONTROL_INTERFACE_H__ + +namespace sdm { + +class DppsControlInterface { + public: + virtual ~DppsControlInterface() { } + virtual DisplayError On() = 0; + virtual DisplayError Off() = 0; +}; + +} // namespace sdm + +#endif // __DPPS_CONTROL_INTERFACE_H__ + diff --git a/sdm/include/private/extension_interface.h b/sdm/include/private/extension_interface.h index baf18a12..d8a37eb4 100644 --- a/sdm/include/private/extension_interface.h +++ b/sdm/include/private/extension_interface.h @@ -31,6 +31,7 @@ #include "partial_update_interface.h" #include "strategy_interface.h" #include "resource_interface.h" +#include "dpps_control_interface.h" namespace sdm { @@ -70,6 +71,9 @@ class ExtensionInterface { BufferAllocator *buffer_allocator, BufferSyncHandler *buffer_sync_handler) = 0; virtual DisplayError DestroyResourceExtn(ResourceInterface *interface) = 0; + virtual DisplayError CreateDppsControlExtn(DppsControlInterface **dpps_control_interface, + SocketHandler *socket_handler) = 0; + virtual DisplayError DestroyDppsControlExtn(DppsControlInterface *interface) = 0; protected: virtual ~ExtensionInterface() { } diff --git a/sdm/libs/core/Android.mk b/sdm/libs/core/Android.mk index c05b1e39..50f087d8 100644 --- a/sdm/libs/core/Android.mk +++ b/sdm/libs/core/Android.mk @@ -54,5 +54,6 @@ LOCAL_COPY_HEADERS = $(SDM_HEADER_PATH)/private/color_interface.h \ $(SDM_HEADER_PATH)/private/hw_info_types.h \ $(SDM_HEADER_PATH)/private/partial_update_interface.h \ $(SDM_HEADER_PATH)/private/resource_interface.h \ - $(SDM_HEADER_PATH)/private/strategy_interface.h + $(SDM_HEADER_PATH)/private/strategy_interface.h \ + $(SDM_HEADER_PATH)/private/dpps_control_interface.h include $(BUILD_COPY_HEADERS) diff --git a/sdm/libs/core/comp_manager.cpp b/sdm/libs/core/comp_manager.cpp index 509c53f4..c7515f42 100644 --- a/sdm/libs/core/comp_manager.cpp +++ b/sdm/libs/core/comp_manager.cpp @@ -51,11 +51,15 @@ DisplayError CompManager::Init(const HWResourceInfo &hw_res_info, if (extension_intf) { error = extension_intf->CreateResourceExtn(hw_res_info, &resource_intf_, buffer_allocator, buffer_sync_handler); + extension_intf->CreateDppsControlExtn(&dpps_ctrl_intf_, socket_handler); } else { error = ResourceDefault::CreateResourceDefault(hw_res_info, &resource_intf_); } if (error != kErrorNone) { + if (extension_intf) { + extension_intf->DestroyDppsControlExtn(dpps_ctrl_intf_); + } return error; } @@ -70,6 +74,7 @@ DisplayError CompManager::Deinit() { if (extension_intf_) { extension_intf_->DestroyResourceExtn(resource_intf_); + extension_intf_->DestroyDppsControlExtn(dpps_ctrl_intf_); } else { ResourceDefault::DestroyResourceDefault(resource_intf_); } @@ -534,4 +539,12 @@ DisplayError CompManager::SetCompositionState(Handle display_ctx, return display_comp_ctx->strategy->SetCompositionState(composition_type, enable); } +DisplayError CompManager::ControlDpps(bool enable) { + if (dpps_ctrl_intf_) { + return enable ? dpps_ctrl_intf_->On() : dpps_ctrl_intf_->Off(); + } + + return kErrorNone; +} + } // namespace sdm diff --git a/sdm/libs/core/comp_manager.h b/sdm/libs/core/comp_manager.h index 480ce43f..9f91eca1 100644 --- a/sdm/libs/core/comp_manager.h +++ b/sdm/libs/core/comp_manager.h @@ -72,6 +72,7 @@ class CompManager : public DumpImpl { DisplayError SetDetailEnhancerData(Handle display_ctx, const DisplayDetailEnhancerData &de_data); DisplayError SetCompositionState(Handle display_ctx, LayerComposition composition_type, bool enable); + DisplayError ControlDpps(bool enable); // DumpImpl method virtual void AppendDump(char *buffer, uint32_t length); @@ -110,6 +111,7 @@ class CompManager : public DumpImpl { ExtensionInterface *extension_intf_ = NULL; uint32_t max_layers_ = kMaxSDELayers; uint32_t max_sde_ext_layers_ = 0; + DppsControlInterface *dpps_ctrl_intf_ = NULL; }; } // namespace sdm diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index bfe20301..f75bf25c 100644 --- a/sdm/libs/core/display_base.cpp +++ b/sdm/libs/core/display_base.cpp @@ -1185,28 +1185,27 @@ DisplayError DisplayBase::InitializeColorModes() { DisplayError DisplayBase::HandleHDR(LayerStack *layer_stack) { DisplayError error = kErrorNone; - if (!color_mgr_) { - // TODO(user): Handle the case where color_mgr is not present - return kErrorNone; - } - if (!layer_stack->flags.hdr_present) { // HDR playback off - set prev mode if (hdr_playback_mode_) { hdr_playback_mode_ = false; - DLOGI("Setting color mode = %s", current_color_mode_.c_str()); - error = SetColorModeInternal(current_color_mode_); - // TODO(user): Enable DPPS + if (color_mgr_) { + DLOGI("Setting color mode = %s", current_color_mode_.c_str()); + error = SetColorModeInternal(current_color_mode_); + } + comp_manager_->ControlDpps(true); // Enable Dpps } } else { // hdr is present if (!hdr_playback_mode_ && !layer_stack->flags.animating) { // hdr is starting hdr_playback_mode_ = true; - DLOGI("Setting HDR color mode = %s", hdr_color_mode_.c_str()); - error = SetColorModeInternal(hdr_color_mode_); + if (color_mgr_) { + DLOGI("Setting HDR color mode = %s", hdr_color_mode_.c_str()); + error = SetColorModeInternal(hdr_color_mode_); + } + comp_manager_->ControlDpps(false); // Disable Dpps } - // TODO(user): Disable DPPS } return error; |