Loading libs/ui/Gralloc5.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -343,14 +343,17 @@ status_t Gralloc5Mapper::validateBufferSize(buffer_handle_t bufferHandle, uint32 return BAD_VALUE; } } { auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle); if (static_cast<BufferUsage>(usage) != value) { ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage, static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER))); return BAD_VALUE; } } // TODO: This can false-positive fail if the allocator adjusted the USAGE bits internally // Investigate further & re-enable or remove, but for now ignoring usage should be OK (void)usage; // { // auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle); // if (static_cast<BufferUsage>(usage) != value) { // ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage, // static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER))); // return BAD_VALUE; // } // } { auto value = getStandardMetadata<StandardMetadataType::STRIDE>(mMapper, bufferHandle); if (stride != value) { Loading services/inputflinger/dispatcher/InputDispatcher.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -5659,14 +5659,6 @@ void InputDispatcher::dumpDispatchStateLocked(std::string& dump) const { } else { dump += INDENT "Displays: <none>\n"; } dump += INDENT "Window Infos:\n"; dump += StringPrintf(INDENT2 "vsync id: %" PRId64 "\n", mWindowInfosVsyncId); dump += StringPrintf(INDENT2 "timestamp (ns): %" PRId64 "\n", mWindowInfosTimestamp); dump += "\n"; dump += StringPrintf(INDENT2 "max update delay (ns): %" PRId64 "\n", mMaxWindowInfosDelay); dump += StringPrintf(INDENT2 "max update delay vsync id: %" PRId64 "\n", mMaxWindowInfosDelayVsyncId); dump += "\n"; if (!mGlobalMonitorsByDisplay.empty()) { for (const auto& [displayId, monitors] : mGlobalMonitorsByDisplay) { Loading Loading @@ -6708,15 +6700,6 @@ void InputDispatcher::onWindowInfosChanged(const gui::WindowInfosUpdate& update) for (const auto& [displayId, handles] : handlesPerDisplay) { setInputWindowsLocked(handles, displayId); } mWindowInfosVsyncId = update.vsyncId; mWindowInfosTimestamp = update.timestamp; int64_t delay = systemTime() - update.timestamp; if (delay > mMaxWindowInfosDelay) { mMaxWindowInfosDelay = delay; mMaxWindowInfosDelayVsyncId = update.vsyncId; } } // Wake up poll loop since it may need to make new input dispatching choices. mLooper->wake(); Loading services/inputflinger/dispatcher/InputDispatcher.h +0 −5 Original line number Diff line number Diff line Loading @@ -204,11 +204,6 @@ private: const IdGenerator mIdGenerator; int64_t mWindowInfosVsyncId GUARDED_BY(mLock); int64_t mWindowInfosTimestamp GUARDED_BY(mLock); int64_t mMaxWindowInfosDelay GUARDED_BY(mLock) = -1; int64_t mMaxWindowInfosDelayVsyncId GUARDED_BY(mLock) = -1; // With each iteration, InputDispatcher nominally processes one queued event, // a timeout, or a response from an input consumer. // This method should only be called on the input dispatcher's own thread. Loading services/surfaceflinger/SurfaceFlinger.cpp +14 −29 Original line number Diff line number Diff line Loading @@ -2547,7 +2547,7 @@ bool SurfaceFlinger::commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expe } updateCursorAsync(); updateInputFlinger(vsyncId); updateInputFlinger(vsyncId, frameTime); if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) { // This will block and tracing should only be enabled for debugging. Loading Loading @@ -3740,7 +3740,7 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) { doCommitTransactions(); } void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId, TimePoint frameTime) { if (!mInputFlinger || (!mUpdateInputInfo && mInputWindowCommands.empty())) { return; } Loading @@ -3752,8 +3752,6 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { if (mUpdateInputInfo) { mUpdateInputInfo = false; updateWindowInfo = true; mLastInputFlingerUpdateVsyncId = vsyncId; mLastInputFlingerUpdateTimestamp = systemTime(); buildWindowInfos(windowInfos, displayInfos); } Loading @@ -3775,17 +3773,17 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { inputWindowCommands = std::move(mInputWindowCommands), inputFlinger = mInputFlinger, this, visibleWindowsChanged]() { visibleWindowsChanged, vsyncId, frameTime]() { ATRACE_NAME("BackgroundExecutor::updateInputFlinger"); if (updateWindowInfo) { mWindowInfosListenerInvoker ->windowInfosChanged(std::move(windowInfos), std::move(displayInfos), ->windowInfosChanged(gui::WindowInfosUpdate{std::move(windowInfos), std::move(displayInfos), vsyncId.value, frameTime.ns()}, std::move( inputWindowCommands.windowInfosReportedListeners), /* forceImmediateCall= */ visibleWindowsChanged || !inputWindowCommands.focusRequests.empty(), mLastInputFlingerUpdateVsyncId, mLastInputFlingerUpdateTimestamp); !inputWindowCommands.focusRequests.empty()); } else { // If there are listeners but no changes to input windows, call the listeners // immediately. Loading Loading @@ -6152,27 +6150,14 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp result.append("\n"); result.append("Window Infos:\n"); StringAppendF(&result, " input flinger update vsync id: %" PRId64 "\n", mLastInputFlingerUpdateVsyncId.value); StringAppendF(&result, " input flinger update timestamp (ns): %" PRId64 "\n", mLastInputFlingerUpdateTimestamp); auto windowInfosDebug = mWindowInfosListenerInvoker->getDebugInfo(); StringAppendF(&result, " max send vsync id: %" PRId64 "\n", windowInfosDebug.maxSendDelayVsyncId.value); StringAppendF(&result, " max send delay (ns): %" PRId64 " ns\n", windowInfosDebug.maxSendDelayDuration); StringAppendF(&result, " unsent messages: %" PRIu32 "\n", windowInfosDebug.pendingMessageCount); result.append("\n"); if (int64_t unsentVsyncId = mWindowInfosListenerInvoker->getUnsentMessageVsyncId().value; unsentVsyncId != -1) { StringAppendF(&result, " unsent input flinger update vsync id: %" PRId64 "\n", unsentVsyncId); StringAppendF(&result, " unsent input flinger update timestamp (ns): %" PRId64 "\n", mWindowInfosListenerInvoker->getUnsentMessageTimestamp()); result.append("\n"); } if (uint32_t pendingMessages = mWindowInfosListenerInvoker->getPendingMessageCount(); pendingMessages != 0) { StringAppendF(&result, " pending input flinger calls: %" PRIu32 "\n", mWindowInfosListenerInvoker->getPendingMessageCount()); result.append("\n"); } } mat4 SurfaceFlinger::calculateColorMatrix(float saturation) { Loading services/surfaceflinger/SurfaceFlinger.h +1 −4 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ private: void updateLayerHistory(const frontend::LayerSnapshot& snapshot); frontend::Update flushLifecycleUpdates() REQUIRES(kMainThreadContext); void updateInputFlinger(VsyncId); void updateInputFlinger(VsyncId vsyncId, TimePoint frameTime); void persistDisplayBrightness(bool needsComposite) REQUIRES(kMainThreadContext); void buildWindowInfos(std::vector<gui::WindowInfo>& outWindowInfos, std::vector<gui::DisplayInfo>& outDisplayInfos); Loading Loading @@ -1259,9 +1259,6 @@ private: VsyncId mLastCommittedVsyncId; VsyncId mLastInputFlingerUpdateVsyncId; nsecs_t mLastInputFlingerUpdateTimestamp; // If blurs should be enabled on this device. bool mSupportsBlur = false; std::atomic<uint32_t> mFrameMissedCount = 0; Loading Loading
libs/ui/Gralloc5.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -343,14 +343,17 @@ status_t Gralloc5Mapper::validateBufferSize(buffer_handle_t bufferHandle, uint32 return BAD_VALUE; } } { auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle); if (static_cast<BufferUsage>(usage) != value) { ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage, static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER))); return BAD_VALUE; } } // TODO: This can false-positive fail if the allocator adjusted the USAGE bits internally // Investigate further & re-enable or remove, but for now ignoring usage should be OK (void)usage; // { // auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle); // if (static_cast<BufferUsage>(usage) != value) { // ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage, // static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER))); // return BAD_VALUE; // } // } { auto value = getStandardMetadata<StandardMetadataType::STRIDE>(mMapper, bufferHandle); if (stride != value) { Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -5659,14 +5659,6 @@ void InputDispatcher::dumpDispatchStateLocked(std::string& dump) const { } else { dump += INDENT "Displays: <none>\n"; } dump += INDENT "Window Infos:\n"; dump += StringPrintf(INDENT2 "vsync id: %" PRId64 "\n", mWindowInfosVsyncId); dump += StringPrintf(INDENT2 "timestamp (ns): %" PRId64 "\n", mWindowInfosTimestamp); dump += "\n"; dump += StringPrintf(INDENT2 "max update delay (ns): %" PRId64 "\n", mMaxWindowInfosDelay); dump += StringPrintf(INDENT2 "max update delay vsync id: %" PRId64 "\n", mMaxWindowInfosDelayVsyncId); dump += "\n"; if (!mGlobalMonitorsByDisplay.empty()) { for (const auto& [displayId, monitors] : mGlobalMonitorsByDisplay) { Loading Loading @@ -6708,15 +6700,6 @@ void InputDispatcher::onWindowInfosChanged(const gui::WindowInfosUpdate& update) for (const auto& [displayId, handles] : handlesPerDisplay) { setInputWindowsLocked(handles, displayId); } mWindowInfosVsyncId = update.vsyncId; mWindowInfosTimestamp = update.timestamp; int64_t delay = systemTime() - update.timestamp; if (delay > mMaxWindowInfosDelay) { mMaxWindowInfosDelay = delay; mMaxWindowInfosDelayVsyncId = update.vsyncId; } } // Wake up poll loop since it may need to make new input dispatching choices. mLooper->wake(); Loading
services/inputflinger/dispatcher/InputDispatcher.h +0 −5 Original line number Diff line number Diff line Loading @@ -204,11 +204,6 @@ private: const IdGenerator mIdGenerator; int64_t mWindowInfosVsyncId GUARDED_BY(mLock); int64_t mWindowInfosTimestamp GUARDED_BY(mLock); int64_t mMaxWindowInfosDelay GUARDED_BY(mLock) = -1; int64_t mMaxWindowInfosDelayVsyncId GUARDED_BY(mLock) = -1; // With each iteration, InputDispatcher nominally processes one queued event, // a timeout, or a response from an input consumer. // This method should only be called on the input dispatcher's own thread. Loading
services/surfaceflinger/SurfaceFlinger.cpp +14 −29 Original line number Diff line number Diff line Loading @@ -2547,7 +2547,7 @@ bool SurfaceFlinger::commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expe } updateCursorAsync(); updateInputFlinger(vsyncId); updateInputFlinger(vsyncId, frameTime); if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) { // This will block and tracing should only be enabled for debugging. Loading Loading @@ -3740,7 +3740,7 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) { doCommitTransactions(); } void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId, TimePoint frameTime) { if (!mInputFlinger || (!mUpdateInputInfo && mInputWindowCommands.empty())) { return; } Loading @@ -3752,8 +3752,6 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { if (mUpdateInputInfo) { mUpdateInputInfo = false; updateWindowInfo = true; mLastInputFlingerUpdateVsyncId = vsyncId; mLastInputFlingerUpdateTimestamp = systemTime(); buildWindowInfos(windowInfos, displayInfos); } Loading @@ -3775,17 +3773,17 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) { inputWindowCommands = std::move(mInputWindowCommands), inputFlinger = mInputFlinger, this, visibleWindowsChanged]() { visibleWindowsChanged, vsyncId, frameTime]() { ATRACE_NAME("BackgroundExecutor::updateInputFlinger"); if (updateWindowInfo) { mWindowInfosListenerInvoker ->windowInfosChanged(std::move(windowInfos), std::move(displayInfos), ->windowInfosChanged(gui::WindowInfosUpdate{std::move(windowInfos), std::move(displayInfos), vsyncId.value, frameTime.ns()}, std::move( inputWindowCommands.windowInfosReportedListeners), /* forceImmediateCall= */ visibleWindowsChanged || !inputWindowCommands.focusRequests.empty(), mLastInputFlingerUpdateVsyncId, mLastInputFlingerUpdateTimestamp); !inputWindowCommands.focusRequests.empty()); } else { // If there are listeners but no changes to input windows, call the listeners // immediately. Loading Loading @@ -6152,27 +6150,14 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp result.append("\n"); result.append("Window Infos:\n"); StringAppendF(&result, " input flinger update vsync id: %" PRId64 "\n", mLastInputFlingerUpdateVsyncId.value); StringAppendF(&result, " input flinger update timestamp (ns): %" PRId64 "\n", mLastInputFlingerUpdateTimestamp); auto windowInfosDebug = mWindowInfosListenerInvoker->getDebugInfo(); StringAppendF(&result, " max send vsync id: %" PRId64 "\n", windowInfosDebug.maxSendDelayVsyncId.value); StringAppendF(&result, " max send delay (ns): %" PRId64 " ns\n", windowInfosDebug.maxSendDelayDuration); StringAppendF(&result, " unsent messages: %" PRIu32 "\n", windowInfosDebug.pendingMessageCount); result.append("\n"); if (int64_t unsentVsyncId = mWindowInfosListenerInvoker->getUnsentMessageVsyncId().value; unsentVsyncId != -1) { StringAppendF(&result, " unsent input flinger update vsync id: %" PRId64 "\n", unsentVsyncId); StringAppendF(&result, " unsent input flinger update timestamp (ns): %" PRId64 "\n", mWindowInfosListenerInvoker->getUnsentMessageTimestamp()); result.append("\n"); } if (uint32_t pendingMessages = mWindowInfosListenerInvoker->getPendingMessageCount(); pendingMessages != 0) { StringAppendF(&result, " pending input flinger calls: %" PRIu32 "\n", mWindowInfosListenerInvoker->getPendingMessageCount()); result.append("\n"); } } mat4 SurfaceFlinger::calculateColorMatrix(float saturation) { Loading
services/surfaceflinger/SurfaceFlinger.h +1 −4 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ private: void updateLayerHistory(const frontend::LayerSnapshot& snapshot); frontend::Update flushLifecycleUpdates() REQUIRES(kMainThreadContext); void updateInputFlinger(VsyncId); void updateInputFlinger(VsyncId vsyncId, TimePoint frameTime); void persistDisplayBrightness(bool needsComposite) REQUIRES(kMainThreadContext); void buildWindowInfos(std::vector<gui::WindowInfo>& outWindowInfos, std::vector<gui::DisplayInfo>& outDisplayInfos); Loading Loading @@ -1259,9 +1259,6 @@ private: VsyncId mLastCommittedVsyncId; VsyncId mLastInputFlingerUpdateVsyncId; nsecs_t mLastInputFlingerUpdateTimestamp; // If blurs should be enabled on this device. bool mSupportsBlur = false; std::atomic<uint32_t> mFrameMissedCount = 0; Loading