summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2019-08-21 18:40:34 -0500
committerPraneeth Bajjuri2019-08-21 15:14:45 -0500
commita159904323b3a4e7bb2a968ef34201ecb741cc2e (patch)
tree4f01316550a360e098b31a1166f335a0b1ca8886
parent4b03e692d337eafd0b1254bd30fa235f103409a2 (diff)
downloadplatform-hardware-interfaces-d-pie-core-release.tar.gz
platform-hardware-interfaces-d-pie-core-release.tar.xz
platform-hardware-interfaces-d-pie-core-release.zip
graphics: hwc2on1adapter: Buffer hotplug event after display creationd-pie-core-release
If the HWC2 hotplug callback has not registered we buffer this event then return, but do so too early leading to no display being created. Buffer the event and return after creating the display so when the callback is registered we have a display for this hotplug event. If the external display is already attached at the boot time our HWC1 will send the hotplug event before the displays have registered in the HWC2 layer, causing the event to get missed. The result is just a blank external display. Change-Id: I134b5473e545b3bc238e8c0f10d0e5fe2831222c Signed-off-by: Andrew F. Davis <afd@ti.com> Tested-by: Vishal Mahaveer <vishalm@ti.com>
-rw-r--r--graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
index 6551a99a..6145e3f0 100644
--- a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
+++ b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
@@ -2591,13 +2591,6 @@ void HWC2On1Adapter::hwc1Hotplug(int hwc1DisplayId, int connected) {
2591 2591
2592 std::unique_lock<std::recursive_timed_mutex> lock(mStateMutex); 2592 std::unique_lock<std::recursive_timed_mutex> lock(mStateMutex);
2593 2593
2594 // If the HWC2-side callback hasn't been registered yet, buffer this until
2595 // it is registered
2596 if (mCallbacks.count(Callback::Hotplug) == 0) {
2597 mPendingHotplugs.emplace_back(hwc1DisplayId, connected);
2598 return;
2599 }
2600
2601 hwc2_display_t displayId = UINT64_MAX; 2594 hwc2_display_t displayId = UINT64_MAX;
2602 if (mHwc1DisplayMap.count(hwc1DisplayId) == 0) { 2595 if (mHwc1DisplayMap.count(hwc1DisplayId) == 0) {
2603 if (connected == 0) { 2596 if (connected == 0) {
@@ -2626,6 +2619,13 @@ void HWC2On1Adapter::hwc1Hotplug(int hwc1DisplayId, int connected) {
2626 mDisplays.erase(displayId); 2619 mDisplays.erase(displayId);
2627 } 2620 }
2628 2621
2622 // If the HWC2-side callback hasn't been registered yet, buffer this until
2623 // it is registered
2624 if (mCallbacks.count(Callback::Hotplug) == 0) {
2625 mPendingHotplugs.emplace_back(hwc1DisplayId, connected);
2626 return;
2627 }
2628
2629 const auto& callbackInfo = mCallbacks[Callback::Hotplug]; 2629 const auto& callbackInfo = mCallbacks[Callback::Hotplug];
2630 2630
2631 // Call back without the state lock held 2631 // Call back without the state lock held