From 0d4184f656b0607f94b6066f396656526f0835b1 Mon Sep 17 00:00:00 2001 From: Joshua Duong Date: Thu, 14 Mar 2024 15:31:45 +0000 Subject: 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 --- system/hwc3/HostFrameComposer.cpp | 2 +- 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 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) { -- cgit v1.2.3