summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index d406afff1f..0e3c47b682 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2533,7 +2533,7 @@ bool SurfaceFlinger::commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expe
}
updateCursorAsync();
- updateInputFlinger();
+ updateInputFlinger(vsyncId);
if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) {
// This will block and tracing should only be enabled for debugging.
@@ -3718,7 +3718,7 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) {
doCommitTransactions();
}
-void SurfaceFlinger::updateInputFlinger() {
+void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) {
if (!mInputFlinger || (!mUpdateInputInfo && mInputWindowCommands.empty())) {
return;
}
@@ -3730,6 +3730,8 @@ void SurfaceFlinger::updateInputFlinger() {
if (mUpdateInputInfo) {
mUpdateInputInfo = false;
updateWindowInfo = true;
+ mLastInputFlingerUpdateVsyncId = vsyncId;
+ mLastInputFlingerUpdateTimestamp = systemTime();
buildWindowInfos(windowInfos, displayInfos);
}
@@ -3759,7 +3761,9 @@ void SurfaceFlinger::updateInputFlinger() {
std::move(
inputWindowCommands.windowInfosReportedListeners),
/* forceImmediateCall= */ visibleWindowsChanged ||
- !inputWindowCommands.focusRequests.empty());
+ !inputWindowCommands.focusRequests.empty(),
+ mLastInputFlingerUpdateVsyncId,
+ mLastInputFlingerUpdateTimestamp);
} else {
// If there are listeners but no changes to input windows, call the listeners
// immediately.
@@ -6105,6 +6109,29 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp
result.append(mTimeStats->miniDump());
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);
+ 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) {