diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h index b4a286a0..251e195c 100644 --- a/sdm/include/utils/debug.h +++ b/sdm/include/utils/debug.h @@ -64,6 +64,7 @@ class Debug { static int GetSimulationFlag(); static int GetHDMIResolution(); static int GetIdleTimeoutMs(); + static int GetBootAnimLayerCount(); static bool IsRotatorDownScaleDisabled(); static bool IsDecimationDisabled(); static int GetMaxPipesPerMixer(DisplayType display_type); diff --git a/sdm/libs/hwc/hwc_display_primary.cpp b/sdm/libs/hwc/hwc_display_primary.cpp index 5cf1b56c..a9c7e671 100755 --- a/sdm/libs/hwc/hwc_display_primary.cpp +++ b/sdm/libs/hwc/hwc_display_primary.cpp @@ -97,14 +97,17 @@ int HWCDisplayPrimary::Init() { return HWCDisplay::Init(); } -void HWCDisplayPrimary::ProcessBootAnimCompleted() { - char value[PROPERTY_VALUE_MAX]; +void HWCDisplayPrimary::ProcessBootAnimCompleted(hwc_display_contents_1_t *list) { + uint32_t numBootUpLayers = 0; - // Applying default mode after bootanimation is finished - property_get("init.svc.bootanim", value, "running"); - if (!strncmp(value, "stopped", strlen("stopped"))) { + numBootUpLayers = static_cast(Debug::GetBootAnimLayerCount()); + + if (numBootUpLayers == 0) { + numBootUpLayers = 2; + } + + if (list->numHwLayers > numBootUpLayers) { boot_animation_completed_ = true; - // one-shot action check if bootanimation completed then apply default display mode. if (display_intf_) display_intf_->ApplyDefaultDisplayMode(); @@ -116,7 +119,7 @@ int HWCDisplayPrimary::Prepare(hwc_display_contents_1_t *content_list) { DisplayError error = kErrorNone; if (!boot_animation_completed_) - ProcessBootAnimCompleted(); + ProcessBootAnimCompleted(content_list); if (display_paused_) { MarkLayersForGPUBypass(content_list); diff --git a/sdm/libs/hwc/hwc_display_primary.h b/sdm/libs/hwc/hwc_display_primary.h index e30d2004..37737179 100644 --- a/sdm/libs/hwc/hwc_display_primary.h +++ b/sdm/libs/hwc/hwc_display_primary.h @@ -55,7 +55,7 @@ class HWCDisplayPrimary : public HWCDisplay { HWCDisplayPrimary(CoreInterface *core_intf, hwc_procs_t const **hwc_procs); void SetMetaDataRefreshRateFlag(bool enable); virtual DisplayError SetDisplayMode(uint32_t mode); - void ProcessBootAnimCompleted(); + void ProcessBootAnimCompleted(hwc_display_contents_1_t *content_list); void SetQDCMSolidFillInfo(bool enable, uint32_t color); void ToggleCPUHint(bool set); void ForceRefreshRate(uint32_t refresh_rate); diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp index 003be5a2..d0d21ee9 100644 --- a/sdm/libs/utils/debug.cpp +++ b/sdm/libs/utils/debug.cpp @@ -59,6 +59,13 @@ int Debug::GetIdleTimeoutMs() { return value; } +int Debug::GetBootAnimLayerCount() { + int value = 0; + debug_.debug_handler_->GetProperty("sdm.boot_anim_layer_count", &value); + + return value; +} + bool Debug::IsRotatorDownScaleDisabled() { int value = 0; debug_.debug_handler_->GetProperty("sdm.debug.rotator_downscale", &value);