diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h index 415a0103..a0d8967f 100644 --- a/sdm/include/utils/debug.h +++ b/sdm/include/utils/debug.h @@ -76,6 +76,7 @@ class Debug { 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 b4dfe6eb..b40884ed 100644 --- a/sdm/libs/hwc/hwc_display.cpp +++ b/sdm/libs/hwc/hwc_display.cpp @@ -109,6 +109,8 @@ int HWCDisplay::Init() { s3d_format_hwc_to_sdm_.insert(std::pair(HAL_3D_TOP_BOTTOM, kS3dFormatTopBottom)); + disable_animation_ = Debug::IsExtAnimDisabled(); + return 0; } @@ -737,9 +739,11 @@ int HWCDisplay::PostCommitLayerStack(hwc_display_contents_1_t *content_list) { // 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 e68c1d9f..27f1faae 100644 --- a/sdm/libs/hwc/hwc_display.h +++ b/sdm/libs/hwc/hwc_display.h @@ -207,6 +207,7 @@ class HWCDisplay : public DisplayEventHandler { 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 s3d_format_hwc_to_sdm_; diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp index 62a8b704..cf60a37e 100644 --- a/sdm/libs/utils/debug.cpp +++ b/sdm/libs/utils/debug.cpp @@ -154,6 +154,13 @@ bool Debug::IsAVRDisabled() { 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;