summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2017-11-09 15:08:31 -0500
committerGerrit - the friendly Code Review server <code-review@localhost>2017-11-15 08:35:52 -0800
commita699e79e10ce3456597b542341129fb92dad042e (patch)
tree14d9870dc298b0e48183959a4bf9388456d0df2c
parentb2a2ac954485d5850d5258de40e5ca13490d9049 (diff)
downloaddisplay-a699e79e10ce3456597b542341129fb92dad042e.tar.gz
hwc2: Add support for disabling external animation
CRs-Fixed: 2141089 Change-Id: I8ef40d359d0076ee02e08b11a9f270db8ad62897
-rw-r--r--common.mk7
-rw-r--r--sdm/libs/hwc2/Android.mk4
-rw-r--r--sdm/libs/hwc2/hwc_display.cpp1
-rw-r--r--sdm/libs/hwc2/hwc_display.h5
-rw-r--r--sdm/libs/hwc2/hwc_session.h14
-rw-r--r--sdm/libs/hwc2/hwc_session_services.cpp10
6 files changed, 41 insertions, 0 deletions
diff --git a/common.mk b/common.mk
index 83d06c63..c003fdef 100644
--- a/common.mk
+++ b/common.mk
@@ -1,5 +1,8 @@
#Common headers
display_top := $(call my-dir)
+display_config_version := $(shell \
+ if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
+ then echo DISPLAY_CONFIG_1_1; fi)
#Common C flags
common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
@@ -10,6 +13,10 @@ ifeq ($(TARGET_IS_HEADLESS), true)
LOCAL_CLANG := false
endif
+ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
+ common_flags += -DDISPLAY_CONFIG_1_1
+endif
+
ifeq ($(TARGET_USES_COLOR_METADATA), true)
common_flags += -DUSE_COLOR_METADATA
endif
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