diff options
author | Naseer Ahmed <naseer@codeaurora.org> | 2017-11-09 15:08:31 -0500 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-11-15 08:35:52 -0800 |
commit | a699e79e10ce3456597b542341129fb92dad042e (patch) | |
tree | 14d9870dc298b0e48183959a4bf9388456d0df2c /sdm/libs | |
parent | b2a2ac954485d5850d5258de40e5ca13490d9049 (diff) | |
download | display-a699e79e10ce3456597b542341129fb92dad042e.tar.gz |
hwc2: Add support for disabling external animation
CRs-Fixed: 2141089
Change-Id: I8ef40d359d0076ee02e08b11a9f270db8ad62897
Diffstat (limited to 'sdm/libs')
-rw-r--r-- | sdm/libs/hwc2/Android.mk | 4 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.cpp | 1 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.h | 5 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_session.h | 14 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_session_services.cpp | 10 |
5 files changed, 34 insertions, 0 deletions
diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk index 9db57abc..bd33aff0 100644 --- a/sdm/libs/hwc2/Android.mk +++ b/sdm/libs/hwc2/Android.mk @@ -21,6 +21,10 @@ LOCAL_SHARED_LIBRARIES := libsdmcore libqservice libbinder libhardware li libsdmutils libc++ liblog libgrallocutils libui libgpu_tonemapper \ libhidlbase libhidltransport vendor.display.config@1.0_vendor +ifeq ($(display_config_version), DISPLAY_CONFIG_1_1) +LOCAL_SHARED_LIBRARIES += vendor.display.config@1.1_vendor +endif + LOCAL_SRC_FILES := hwc_session.cpp \ hwc_session_services.cpp \ hwc_display.cpp \ diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index 2255c45c..54a9c9b5 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -457,6 +457,7 @@ void HWCDisplay::BuildLayerStack() { metadata_refresh_rate_ = 0; auto working_primaries = ColorPrimaries_BT709_5; bool secure_display_active = false; + layer_stack_.flags.animating = animating_; // Add one layer for fb target // TODO(user): Add blit target layers diff --git a/sdm/libs/hwc2/hwc_display.h b/sdm/libs/hwc2/hwc_display.h index b3257f9c..1fe43af4 100644 --- a/sdm/libs/hwc2/hwc_display.h +++ b/sdm/libs/hwc2/hwc_display.h @@ -210,6 +210,10 @@ class HWCDisplay : public DisplayEventHandler { float* out_max_luminance, float* out_max_average_luminance, float* out_min_luminance); + virtual HWC2::Error SetDisplayAnimating(bool animating) { + animating_ = animating; + return HWC2::Error::None; + } protected: // Maximum number of layers supported by display manager. @@ -299,6 +303,7 @@ class HWCDisplay : public DisplayEventHandler { DisplayClass display_class_; uint32_t geometry_changes_ = GeometryChanges::kNone; bool skip_validate_ = false; + bool animating_ = false; }; inline int HWCDisplay::Perform(uint32_t operation, ...) { diff --git a/sdm/libs/hwc2/hwc_session.h b/sdm/libs/hwc2/hwc_session.h index fe695153..84abd7b1 100644 --- a/sdm/libs/hwc2/hwc_session.h +++ b/sdm/libs/hwc2/hwc_session.h @@ -20,7 +20,12 @@ #ifndef __HWC_SESSION_H__ #define __HWC_SESSION_H__ +#ifdef DISPLAY_CONFIG_1_1 +#include <vendor/display/config/1.1/IDisplayConfig.h> +#else #include <vendor/display/config/1.0/IDisplayConfig.h> +#endif + #include <core/core_interface.h> #include <utils/locker.h> @@ -35,7 +40,11 @@ namespace sdm { +#ifdef DISPLAY_CONFIG_1_1 +using vendor::display::config::V1_1::IDisplayConfig; +#else using ::vendor::display::config::V1_0::IDisplayConfig; +#endif using ::android::hardware::Return; // Create a singleton uevent listener thread valid for life of hardware composer process. @@ -211,6 +220,11 @@ class HWCSession : hwc2_device_t, HWCUEventListener, IDisplayConfig, public qCli Return<int32_t> setCameraLaunchStatus(uint32_t on) override; Return<void> displayBWTransactionPending(displayBWTransactionPending_cb _hidl_cb) override; + // Methods from ::android::hardware::display::config::V1_1::IDisplayConfig follow. +#ifdef DISPLAY_CONFIG_1_1 + Return<int32_t> setDisplayAnimating(uint64_t display_id, bool animating) override; +#endif + // QClient methods virtual android::status_t notifyCallback(uint32_t command, const android::Parcel *input_parcel, android::Parcel *output_parcel); diff --git a/sdm/libs/hwc2/hwc_session_services.cpp b/sdm/libs/hwc2/hwc_session_services.cpp index 64ac57c2..0fbba4d0 100644 --- a/sdm/libs/hwc2/hwc_session_services.cpp +++ b/sdm/libs/hwc2/hwc_session_services.cpp @@ -506,4 +506,14 @@ Return<void> HWCSession::displayBWTransactionPending(displayBWTransactionPending return Void(); } +#ifdef DISPLAY_CONFIG_1_1 +// Methods from ::vendor::hardware::display::config::V1_1::IDisplayConfig follow. +Return<int32_t> HWCSession::setDisplayAnimating(uint64_t display_id, bool animating ) { + SEQUENCE_WAIT_SCOPE_LOCK(locker_[display_id]); + return CallDisplayFunction(static_cast<hwc2_device_t *>(this), display_id, + &HWCDisplay::SetDisplayAnimating, animating); +} +#endif + + } // namespace sdm |