From: Kalyan Kondapally Date: Sun, 19 Feb 2017 02:56:28 +0000 (-0800) Subject: No need to call composition init function for every Connect call. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=bdce2da17fd45a03515dde4c80ecbb7c7d548b7d;p=android-x86%2Fexternal-IA-Hardware-Composer.git No need to call composition init function for every Connect call. Compositor only creates GPUResourceHandler in init function which should not be affected by any changes in Connect call. Move this to init, so we dont reinitialize GPUResourceHandler unnecessarily. Jira: None. Test: No regressions on Linux and Android. Signed-off-by: Kalyan Kondapally --- diff --git a/common/display/display.cpp b/common/display/display.cpp index e59d806..3dadf2a 100644 --- a/common/display/display.cpp +++ b/common/display/display.cpp @@ -60,6 +60,7 @@ bool Display::Initialize() { #endif frame_ = 0; flip_handler_.reset(new PageFlipEventHandler()); + compositor_.Init(); return true; } @@ -103,7 +104,6 @@ bool Display::Connect(const drmModeModeInfo &mode_info, return false; } - compositor_.Init(); flip_handler_->Init(refresh_, gpu_fd_, pipe_); dpms_mode_ = DRM_MODE_DPMS_ON; drmModeConnectorSetProperty(gpu_fd_, connector_, dpms_prop_, @@ -127,6 +127,8 @@ void Display::ShutDown() { dpms_mode_ = DRM_MODE_DPMS_OFF; drmModeConnectorSetProperty(gpu_fd_, connector_, dpms_prop_, DRM_MODE_DPMS_OFF); + previous_layers_.clear(); + previous_plane_state_.clear(); ScopedDrmAtomicReqPtr pset(drmModeAtomicAlloc()); if (!pset) {