diff options
author | Joshua Duong <joshuaduong@google.com> | 2024-03-14 15:31:45 +0000 |
---|---|---|
committer | Joshua Duong <joshuaduong@google.com> | 2024-03-14 16:18:19 +0000 |
commit | 0d4184f656b0607f94b6066f396656526f0835b1 (patch) | |
tree | 6c88f13a0d4943739c1d4982c3d252b1aaf8da87 | |
parent | c1e544c5748c143c405293350978b0db9b495165 (diff) | |
download | goldfish-opengl-0d4184f656b0607f94b6066f396656526f0835b1.tar.gz |
Fix multi-display flickering.
There was a change in surfaceflinger that asks hwc to setColorTransform
for each display when displays are added/changed/removed. For some
reason, we were falling back to client composition when the display had
color transform set. Removing that fallback fixes the flickering.
Bug: 324295392
Test: Boot gcar image, see no flickering.
Change-Id: I5765cef42b892455d6ba7637382bfa069f37bbfb
-rw-r--r-- | system/hwc3/HostFrameComposer.cpp | 2 | ||||
-rw-r--r-- | system/hwc3/VsyncThread.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/system/hwc3/HostFrameComposer.cpp b/system/hwc3/HostFrameComposer.cpp index 2a88b756..018df722 100644 --- a/system/hwc3/HostFrameComposer.cpp +++ b/system/hwc3/HostFrameComposer.cpp @@ -404,7 +404,7 @@ HWC3::Error HostFrameComposer::validateDisplay(Display* display, DisplayChanges* // If one layer requires a fall back to the client composition type, all // layers will fall back to the client composition type. bool fallBackToClient = - (!hostCompositionV1 && !hostCompositionV2) || display->hasColorTransform(); + (!hostCompositionV1 && !hostCompositionV2); std::unordered_map<Layer*, Composition> changes; if (!fallBackToClient) { diff --git a/system/hwc3/VsyncThread.cpp b/system/hwc3/VsyncThread.cpp index 3976130b..0ec1b23e 100644 --- a/system/hwc3/VsyncThread.cpp +++ b/system/hwc3/VsyncThread.cpp @@ -53,7 +53,10 @@ HWC3::Error VsyncThread::start(int32_t vsyncPeriodNanos) { mThread = std::thread([this]() { threadLoop(); }); - const std::string name = "display_" + std::to_string(mDisplayId) + "_vsync_thread"; + // Truncate to 16 chars (15 + null byte) to satisfy pthread_setname_np max name length + // requirement. + const std::string name = + std::string("display_" + std::to_string(mDisplayId) + "_vsync_thread").substr(15); int ret = pthread_setname_np(mThread.native_handle(), name.c_str()); if (ret != 0) { |