Ignore callbacks from the non-active hardware composer
Ignore callbacks from the non-active hardware composer so we don't get
e.g. duplicate vsync callbacks, one from each composer.
Bug: None
Test: Manually confirmed with logs we're now ignoring callbacks on the
non-active composer.
Change-Id: I8b475d6283d86c64ff96b41e78528bce8c6ff1d3
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 1c99036..d2b26c2 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -60,9 +60,8 @@
// ---------------------------------------------------------------------------
-HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger, bool useVrComposer)
- : mFlinger(flinger),
- mAdapter(),
+HWComposer::HWComposer(bool useVrComposer)
+ : mAdapter(),
mHwcDevice(),
mDisplayData(2),
mFreeDisplaySlots(),
@@ -211,7 +210,7 @@
}
void HWComposer::invalidate(const std::shared_ptr<HWC2::Display>& /*display*/) {
- mFlinger->repaintEverything();
+ mEventHandler->onInvalidateReceived(this);
}
void HWComposer::vsync(const std::shared_ptr<HWC2::Display>& display,
@@ -257,7 +256,7 @@
snprintf(tag, sizeof(tag), "HW_VSYNC_%1u", disp);
ATRACE_INT(tag, ++mVSyncCounts[disp] & 1);
- mEventHandler->onVSyncReceived(disp, timestamp);
+ mEventHandler->onVSyncReceived(this, disp, timestamp);
}
status_t HWComposer::allocateVirtualDisplay(uint32_t width, uint32_t height,