drm_hwcomposer: Don't erase displays in the internal layer at hotplug
ResourceManager is managing displays via bind/unbind/finalize calls.
Additional erasing causes issues when transitioning from headless
mode to real display and vice versa, where the display must remain.
Fixes SurfaceFlinger crash when disconnecting the primary display.
Change-Id: I39d0237f8e55417b11f0ba2e0c9b93e2e0ac7e26
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/hwc3/DrmHwcThree.cpp b/hwc3/DrmHwcThree.cpp
index fb14bc9..dffb907 100644
--- a/hwc3/DrmHwcThree.cpp
+++ b/hwc3/DrmHwcThree.cpp
@@ -145,7 +145,6 @@
DEBUG_FUNC();
if (!connected) {
composer_resources_->RemoveDisplay(display_id);
- Displays().erase(display_id);
return;
}
@@ -153,7 +152,6 @@
/* Cleanup existing display resources */
CleanDisplayResources(display_id);
composer_resources_->RemoveDisplay(display_id);
- Displays().erase(display_id);
}
composer_resources_->AddPhysicalDisplay(display_id);
}