summaryrefslogtreecommitdiff
path: root/services/surfaceflinger
AgeCommit message (Collapse)Author
2025-09-18[SP 2025-09-01] Don't blur too many layersbanksia-dev Alec Mouri
An application requesting lots and lots of blurs: a. Enables pixel stealing by measuring how long it takes to perform a blur across windows b. Probably isn't very valid anyways. So, just arbitrarily pick an upper bound for blur requests that a display is allowed to manage (10), and disable everything else. Arbitrarily, pick the 10 "front-most" blurs to be respected. Bug: 399120953 Flag: EXEMPT security Test: Security PoC no longer PoCs (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:fbcb9ae5eb45e2273be05d5366b47bd8436c1718) Merged-In: Ie7195eb852b52aff2f58da8bd095d8684baceef6 Change-Id: Ie7195eb852b52aff2f58da8bd095d8684baceef6
2025-04-15Fix build break in 25Q2-release Vishnu Nair
Bug: 277076451 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5013ab8640c7cbd8fdf89f133b4fa9184576e26f) Merged-In: I5f9fb4e011abb383c51b0fc03553947f325c20ae Change-Id: I5f9fb4e011abb383c51b0fc03553947f325c20ae
2025-04-15Include color layers in input list to fix tapjacking vulnerability Wenhui Yang
We can use this to compute occlusion more accurately in inputdispatcher. Bug: 277076451 Test: app-debug.apk in the bug Test: go/wm-smoke Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1f0301b3f1061cb89d9628bbb1d2b4594f4f29dc) Merged-In: I1e155bcf4a6a7ff1b49338ec21bb0e9ee05a54c8 Change-Id: I1e155bcf4a6a7ff1b49338ec21bb0e9ee05a54c8
2025-03-24Merge "Remove spurious std::move()." into main Treehugger Robot
2025-03-24Remove spurious std::move(). Anton Ivanov
Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: I2cfc6969291d207c73608c0c045d1eec70852278
2025-03-24Merge "Add border API to surface control" into main Cairn Overturf
2025-03-21Merge "Detect secure layers and start lazy HDCP activation" into main Huihong Luo
2025-03-21Merge "Remove HDCP vsync hack" into main Huihong Luo
2025-03-21Merge "Revert^2 "Use TransactionState in SurfaceFlinger."" into main Treehugger Robot
2025-03-21Detect secure layers and start lazy HDCP activation Huihong Luo
Layer snapshots are traversed to check for secure layers, then trigger HWC to start HDCP activation when a secure layer is detected. Flag: com.android.graphics.surfaceflinger.flags.hdcp_negotiation Bug: 372902990 Bug: 375340594 Test: manual Change-Id: Ie52159043f94d7cdb079d7c48c47764017a979f5
2025-03-21Merge "end2end: OWNERS" into main Treehugger Robot
2025-03-21Remove HDCP vsync hack Huihong Luo
New HDCP hal api will be used. Bug: 402406598 Flag: EXEMPT bugfix Test: manual Change-Id: I361c032d2b373a122e24194883c9fee9c6a262b2
2025-03-21end2end: OWNERS Lloyd Pique
Set up a more local set of OWNERS for more dedicated reviews. Flag: TEST_ONLY Bug: 372735083 Test: None Ignore-AOSP-First: Test code not yet in AOSP Change-Id: Ib9249f4534dcc167800081b97294a2697bf5d5a5
2025-03-21Merge "Remove ScopedAddToTraversalPath" into main Treehugger Robot
2025-03-20Merge "Revert "Turn off synthetic VSYNC when adjusting thread scheduling for ↵ Treehugger Robot
performance"" into main
2025-03-20Remove ScopedAddToTraversalPath Patrick Williams
ScopedAddToTraversalPath is an RAII wrapper that copies the existing traversal path, modifies it, and then restores the modified properties from the copy when deleted. It's simpler to make the child path a copy and not modify the parent. Bug: 403312802 Flag: EXEMPT refactor Test: presubmits Change-Id: I8f06ed557f29444be6df51c1c8ea60958a82ee95
2025-03-20Merge "[SF] Backdoor to update the WorkDuration" into main Ram Indani
2025-03-20Revert "Turn off synthetic VSYNC when adjusting thread scheduling for ↵ ELIYAZ MOMIN (xWF)
performance" This reverts commit bac7071aa3b1ae72f90b904b9af61b5c74ba9265. Reason for revert: Droidmonitor created revert due to Jank regression b/404073995. Change-Id: Id57f5cda7a34f4598a82d86d7290d5b1c57f1315
2025-03-20Merge "surfaceflinger formatting" into main Daniel Zheng
2025-03-20[SF] Backdoor to update the WorkDuration ramindani
Test: atest libsurfaceflinger_unittest Test: Verified with a trace that work duration updates after backdoor call. BUG: 398872242 Flag: EXEMPT Backdoor implementation. Change-Id: Icea9bebbb3366df09643dbe40fd7c986461262b8
2025-03-20Revert^2 "Use TransactionState in SurfaceFlinger." Anton Ivanov
This reverts commit 4f8b4f371947dce3abece1c0d64af0b5c990e0c2. Reason for revert: Rolling forward with fix for use-after-move in SurfaceFlinger::setTransactionState Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: I66d45b1e125dcb50cbe7a3cfcefa8eaa02705419
2025-03-19surfaceflinger formatting Daniel Zheng
no functionality changes here. just some clang-tidy formatting Flag: EXEMPT refactor Test: th Change-Id: I25cd53c40d4fde1edb29f4b8fee28df6f4b66235
2025-03-19Add border API to surface control YCairn Overturf
See go/sf-box-shadows-api for more details Bug: b/367464660 Flag: com.android.window.flags.enable_border_settings Test: atest SurfaceFlinger_test Change-Id: I1190edb97693004d9f46058fd0165451470a65b3
2025-03-18Introduce surfaceflinger_end2end_tests Lloyd Pique
Introduces a minimal surfaceflinger_end2end_test target, which will work by controlling both the "front-end" of surfaceFlinger via the libgui ISurfaceComposer.aidl interface, as well the "back-end" of surfaceflinger via the hardware Composer3 IComposer.aidl interface. There is only a minimal implementation for everything. To start out, the test registers a simple "fake" composer3 backend service that asserts if SurfaceFlinger actually uses it to create a client interface, and otherwise the initial test just tries to connect to the front end service. The main purpose of this CL is to introduce all the main framework classes, and otherwise set up the build target. For now this fails, with SurfaceFlinger establishing a connection to the service, but the test process aborts in the stub to create the client interface. SurfaceFlinger doesn't crash, but is in a bad state. The AndroidTest.xml file however brings the target back to a normal working state with tear-down commands meant for this purpose. Flag: TEST_ONLY Bug: 372735083 Test: atest surfaceflinger_end2end_tests Change-Id: I78be88a3eb3df9b6c700f78bdef66f9dc71399c7
2025-03-18Merge "Prune logic from buffer stuffing recovery using UIDs" into main Melody Hsu
2025-03-18Merge "Revert "Use TransactionState in SurfaceFlinger."" into main Treehugger Robot
2025-03-17Revert "Use TransactionState in SurfaceFlinger." Anton Ivanov
This reverts commit ed63243743079eb4531cb4a9e5ed4dccb7965d6d. Reason for revert: Droidmonitor created revert due to Jank regression b/403375000. Change-Id: I558338084124764026028b21667b45afb73b9e06
2025-03-17Prune logic from buffer stuffing recovery using UIDs Melody Hsu
Buffer stuffing recovery was initially implemented using UIDs and sending events to subscribed clients. A different, simpler approach using callbacks when blocked on dequeueBuffer has since been favored (change-id I24e34591e809aebd7626657c6340faed323227ad) and leaves the initial UID event subscription logic obsolete. Leaving this code causes issues since the logic attempts to update an event that is part of union, causing issues in other events that do not hold onto the current object. This is a partial revert of change-id I38f0eb3d6ef1331e07d6022fa3a0e16c556ba06f Bug: b/294922229 Test: presubmit Flag: EXEMPT, code cleanup Change-Id: I53f653550c58376c8d82a491ecf0aebdeeafbc0d
2025-03-17Merge "Print display ids of Virtual Displays too" into main Pierre Barbier de Reuille
2025-03-17Merge "Avoid copying Transaction objects unneccessarily." into main Anton Ivanov
2025-03-17Print display ids of Virtual Displays too Pierre Barbier de Reuille
This impact the output of `dumpsys SurfaceFlinger --display-id`. Note: this will output the ids of the same displays than `dumpsys SurfaceFlinger --displays`. Similar to that command, phyical displays will be enumerated first. Fix: 403588742 Flag: EXEMPT (small change in dumpsys) Test: build and run with an overlay Change-Id: I176b0894c3dd4fc2ecd30809ed117b87464f8d85
2025-03-15Merge "Silience compiler errors from clang-r563880" into main Yi Kong
2025-03-14Merge "Turn off synthetic VSYNC when adjusting thread scheduling for ↵ Dennis Kiilerich
performance" into main
2025-03-14SF: Fix libcompositionengine_test Expectations around display IDs Gil Dekel
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/native/+/31654940 seems to have introduced a regression in libcompositionengine_test around CompositionEngineTest SetUp(). This CL fixes this issue. Flag: EXEMPT bugfix Bug: 403479642 Test: libcompositionengine_test Change-Id: Ic8c05895f084faaffb2d228d2630ce995df572bd
2025-03-14Avoid copying Transaction objects unneccessarily. Anton Ivanov
Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: Ibd9d64bd7d41adbf5af0dacd660b6aaed6bc8741
2025-03-14Turn off synthetic VSYNC when adjusting thread scheduling for performance Dennis Kiilerich
* This CL explicitly sets synthetic VSYNC state based on the new power state. Before, the synthetic VSYNC state was assumed based on the previous power state and in some cases was not set explicitly. * The previous behaviour of enabling synthetic VSYNC if the only display is DOZE_SUSPEND is preserved. * This also fixes a hypothetical gap where it would not optimise for performance if there were a display that needed it, while the primary display was DOZE_SUSPEND. Bug: 342681202 Bug: 241285876 Flag: android.companion.virtualdevice.flags.correct_virtual_display_power_state Test: manually tested with flag on/off using Android Auto Projected Change-Id: I181aefad586ad7b1732c837b67a01d61939d1d3e
2025-03-14Merge "Introduce a dependency monitor for fences" into main Alec Mouri
2025-03-13Silience compiler errors from clang-r563880 Yi Kong
frameworks/native/services/surfaceflinger/PowerAdvisor/SessionManager.h:71:17: error: private field 'mUid' is not used [-Werror,-Wunused-private-field] 71 | const uid_t mUid; | ^ Test: presubmit Flag: EXEMPT, code cleanup Change-Id: I544c912fea01c999d2a835a158441b6ed81deba0
2025-03-13Merge "getSupportedRefreshRates same as legacy on MRR" into main Rachel Lee
2025-03-13Introduce a dependency monitor for fences Alec Mouri
This allows for userspace logging for a buffer and read/write dependencies on the buffer. Hook up SF to the dependency monitor. Right now this _does_ emit logs in SF when the primary display is powered down, which is likely indicative of SF being sloppy about release fences in situations where tearing won't be noticeable, but I did verify that manually making screenshotting forget to merge GPU work into a layer's release fence, which has been one way SF's torn the screen, triggers logcat, which is ultimately what we want. Bug: 360932099 Flag: com.android.graphics.surfaceflinger.flags.monitor_buffer_fences Test: manually remove screenshot fence handling and check logs Change-Id: Ica391dfa8a4f2924bb72664b9d9399e4ad9e1747
2025-03-13Merge changes from topic "make-displayid-opaque" into main Gil Dekel
* changes: SF: Remove PhysicalDisplayId::getPort() SF: Remove *DisplayId::tryCast and DisplayId::isVirtual() SF: Remove *DisplayId::tryCast usage from ScreenCaptureOutput SF: Remove *DisplayId::tryCast usage from VirtualDisplaySurface SF: Remove *DisplayId::tryCast usage from Output
2025-03-13Merge "SF: Remove multithreaded_present flag" into main Dominik Laskowski
2025-03-13SF: Remove PhysicalDisplayId::getPort() Gil Dekel
Work towards DisplayId opaqueness by eliminating call-sites to APIs that parse the display ID values directly. This CL removes PhysicalDisplayId::getPort from the PhysicalDislayId interface entirely. The only call-sites that are dependant on port are replaced with getting the port info via StaticDisplayInfo. Flag: com.android.graphics.surfaceflinger.flags.stable_edid_ids Bug: 390689635 Test: libsurfaceflinger_unittest Change-Id: I92ea4850b158f9c49dff9166a9b61565ad4537d7
2025-03-13SF: Remove *DisplayId::tryCast and DisplayId::isVirtual() Gil Dekel
Work towards DisplayId opaqueness by eliminating call-sites to APIs that parse the display ID values directly. This CL removes *DisplayId::tryCast from the DislayId interface entirely and replaces it with SF APIs that check for the existence of the displays before casting. This removes direct dependency on ID value bits. It also removes DisplayId::isVirtual(). Flag: com.android.graphics.surfaceflinger.flags.stable_edid_ids Bug: 390690584 Bug: 390689313 Test: libsurfaceflinger_unittest Change-Id: I918a6b361784e41165837234b82eed027dc46673
2025-03-13SF: Remove multithreaded_present flag Dominik Laskowski
Change (and rename) CompositionEnginePresentTest.worksAsExpected to avoid an assumption that would now break the test. Bug: 380251940 Flag: EXEMPT removing multithreaded_present Test: presubmit Change-Id: Ifbcbfc7d82e64d909a6e4d310f34bcb6578d1e1f
2025-03-13Merge "Use TransactionState in SurfaceFlinger." into main Treehugger Robot
2025-03-12getSupportedRefreshRates same as legacy on MRR Rachel Lee
For MRR devices, change the getSupportedRefreshRates logic to return the same refresh rates as what would be seen in the getSupportedRefreshRatesLegacy API. This is ensures the CTS will pass. Test: run cts-on-gsi -m CtsDisplayTestCases -t android.display.cts.DisplayTest#testGetSupportedRefreshRates Test: cts on git_main Bug: 401485115 Bug: 384427341 Flag: EXEMPT BUG_FIX Change-Id: Iab15c2804932785fed8e40fb7331b4ae8ea9de66
2025-03-11Merge "Force snapshot update when requested transform changes from invalid ↵ Treehugger Robot
to valid" into main
2025-03-11Merge "Use power mode of all independent displays to control power ↵ Treehugger Robot
optimisations." into main
2025-03-11Use TransactionState in SurfaceFlinger. Anton Ivanov
Eliminates code duplication and unnecessary copies of state components. Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: Ic57f3203d94f41cd1a97014a546c1852d9b5f390