Fix "invalid buffer slot" hardware composer error
For virtual displays we weren't calling setClientTargetSlotCount(),
leading to "invalid buffer slot" errors from the hardware composer
service.
Bug: 69814692
Test: Observed the "invalid buffer slot" errors are gone.
Change-Id: I2268acd7d59dcbe2a943ddf388d88632a8b81b5d
(cherry picked from commit 8f1110776981bf35d5952532f99f32d9420dc017)
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp
index bcba35f..814b55e 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp
@@ -617,9 +617,11 @@
// For use by Device
void Display::setConnected(bool connected) {
- if (!mIsConnected && connected && mType == DisplayType::Physical) {
+ if (!mIsConnected && connected) {
mComposer.setClientTargetSlotCount(mId);
- loadConfigs();
+ if (mType == DisplayType::Physical) {
+ loadConfigs();
+ }
}
mIsConnected = connected;
}