sdm: add check for disabling external animation
In current design the flag passed from clients is used to
disable external animation. Refine this flag to two parts,
one is to indicate whether animation is present, another
is to check the system property and disable external
animation. So other functions can know the presence of
animation layers if necessary.
CRs-fixed: 1019601
Change-Id: Ib6ffb7a28d6935b86bc93abc82049b77b3ddcd08
diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h
index 415a010..a0d8967 100644
--- a/sdm/include/utils/debug.h
+++ b/sdm/include/utils/debug.h
@@ -76,6 +76,7 @@
static bool IsScalarDisabled();
static bool IsUbwcTiledFrameBuffer();
static bool IsAVRDisabled();
+ static bool IsExtAnimDisabled();
static bool GetProperty(const char *property_name, char *value);
static bool SetProperty(const char *property_name, const char *value);
diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp
index b4dfe6e..b40884e 100644
--- a/sdm/libs/hwc/hwc_display.cpp
+++ b/sdm/libs/hwc/hwc_display.cpp
@@ -109,6 +109,8 @@
s3d_format_hwc_to_sdm_.insert(std::pair<int, LayerBufferS3DFormat>(HAL_3D_TOP_BOTTOM,
kS3dFormatTopBottom));
+ disable_animation_ = Debug::IsExtAnimDisabled();
+
return 0;
}
@@ -737,9 +739,11 @@
// framebuffer layer throughout animation and do not allow framework to do eglswapbuffer on
// framebuffer target. So graphics doesn't close the release fence fd of framebuffer target,
// Hence close the release fencefd of framebuffer target here.
- if (layer->composition == kCompositionGPUTarget && animating_) {
- close(hwc_layer.releaseFenceFd);
- hwc_layer.releaseFenceFd = -1;
+ if (disable_animation_) {
+ if (layer->composition == kCompositionGPUTarget && animating_) {
+ close(hwc_layer.releaseFenceFd);
+ hwc_layer.releaseFenceFd = -1;
+ }
}
}
diff --git a/sdm/libs/hwc/hwc_display.h b/sdm/libs/hwc/hwc_display.h
index e68c1d9..27f1faa 100644
--- a/sdm/libs/hwc/hwc_display.h
+++ b/sdm/libs/hwc/hwc_display.h
@@ -207,6 +207,7 @@
bool secure_display_active_ = false;
bool skip_prepare_ = false;
bool solid_fill_enable_ = false;
+ bool disable_animation_ = false;
uint32_t solid_fill_color_ = 0;
LayerRect display_rect_;
std::map<int, LayerBufferS3DFormat> s3d_format_hwc_to_sdm_;
diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp
index 62a8b70..cf60a37 100644
--- a/sdm/libs/utils/debug.cpp
+++ b/sdm/libs/utils/debug.cpp
@@ -154,6 +154,13 @@
return (value == 1);
}
+bool Debug::IsExtAnimDisabled() {
+ int value = 0;
+ debug_.debug_handler_->GetProperty("sys.disable_ext_animation", &value);
+
+ return (value == 1);
+}
+
bool Debug::GetProperty(const char* property_name, char* value) {
if (debug_.debug_handler_->GetProperty(property_name, value) != kErrorNone) {
return false;