summaryrefslogtreecommitdiff
path: root/libs/gui
AgeCommit message (Collapse)Author
2025-04-18Revert "Delay initialization of a ConsumerBase instance to construction of a ↵ Anton Ivanov
sp/wp." This reverts commit 4efd0d936e2a2bfd9a46432270d7960062265c7b. Reason for revert: Caused b/409264080 Bug: 393217449 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:39266357b892a5b1f1d0a232d9706e512615b08d) Merged-In: Ia41cc9c08ce48d67f7b06b50adf6c573e4325482 Change-Id: Ia41cc9c08ce48d67f7b06b50adf6c573e4325482
2025-04-07Revert "Ensure Choreographer is held as sp<> in SurfaceControl." Anton Ivanov
This reverts commit 9045666047d55134c2e4f0108a88b5799653003e. Reason for revert: Supsected cause for b/405669080 Test: presubmit Flag: EXEMPT refactor Bug: 405669080 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ade9b0ca6046beae913335000cdd398ac4381bb9) Merged-In: I96c45abfe8446c924e9ea31f822e040134e87db9 Change-Id: I96c45abfe8446c924e9ea31f822e040134e87db9
2025-03-24Merge "Add border API to surface control" into main Cairn Overturf
2025-03-21Merge "Revert^2 "Use TransactionState in SurfaceFlinger."" into main Treehugger Robot
2025-03-21Merge "Ensure libgui classes that are held by sp<> are only constructed with ↵ Treehugger Robot
sp<>::make." into main
2025-03-20Merge "Surface: Add 'isBufferOwned' call" into main Jim Shargo
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-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-18Ensure libgui classes that are held by sp<> are only constructed with ↵ Anton Ivanov
sp<>::make. Exception is SurfaceComposerClient, which is widely references in vendor code. Test: presubmit Flag: EXEMPT refactor Bug: 393217449 Change-Id: Ib1039a1f7bc5676d32a4067361f131fc79efad4d
2025-03-18Merge changes I60d42f38,I25857739 into main Treehugger Robot
* changes: Ensure Choreographer is held as sp<> in SurfaceControl. Harden construction sites of android::StrongPointer in frameworks/native
2025-03-18Merge "Revert^2 "Explicitly include libgui as a shared library in ↵ Treehugger Robot
libgui_test."" into main
2025-03-17Revert^2 "Explicitly include libgui as a shared library in libgui_test." Anton Ivanov
This reverts commit d6198bed29ffb56054490820e73ee30a718930d1. Reason for revert: Removed flag defines from Android.bp that caused linker errors. Verified libgui_test behaves identically with and without this revert on cf_x86_64_auto-next-userdebug Change-Id: Ibbbd201253fa09c18491bffca0b540c2c13df8d3
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-17Ensure Choreographer is held as sp<> in SurfaceControl. Anton Ivanov
Test: ChoreographerTests pass Flag: EXEMPT refactor Bug: 393217449 Change-Id: I60d42f383d4b73b60de1a7a1bbeec5170b805ebb
2025-03-17Harden construction sites of android::StrongPointer in frameworks/native Anton Ivanov
Test: presubmit Flag: EXEMPT refactor Bug: 393217449 Change-Id: I25857739af659a52d2e33fc0e05799959f4024ab
2025-03-17Merge "Remove flags from cppflags of libgui_test." into main Treehugger Robot
2025-03-17Merge "Avoid copying Transaction objects unneccessarily." into main Anton Ivanov
2025-03-14Avoid copying Transaction objects unneccessarily. Anton Ivanov
Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: Ibd9d64bd7d41adbf5af0dacd660b6aaed6bc8741
2025-03-14Merge "Use EXPECT_NEAR for float value in tests" into main Arpit Singh
2025-03-14Surface: Add 'isBufferOwned' call Jim Shargo
Camera's StreamSplitter keeps track of buffers and won't attach them if they're already owned. This allows us to keep that behavior as we move over from IGBP to surfaces. Ideally, I think, IGBPs should fail to attach the same buffer multiple times. Even if not, this call should probably be to the IGBP instead of the Surface for more accuracy. But this replicates the old behavior. Bug: 340933206 Flag: com.android.graphics.libgui.flags.wb_stream_splitter Test: new test Change-Id: Idbb200202012c9eae2668616dcff277c925c3907
2025-03-14Merge "Revert "libgui: Make bq_gl_fence_cleanup a bugfix flag"" into main Jim Shargo
2025-03-14Use EXPECT_NEAR for float value in tests Arpit Singh
These tests use EXPECT_EQ to match int and float, this CL changes it to use EXPECT_NEAR with EPSILON. Test: atest libgui_test Bug: 245989146 Flag: TEST_ONLY Change-Id: If65beb5de6a897cef34e1dca8e400bcfe4c8c8ab
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-13Revert "libgui: Make bq_gl_fence_cleanup a bugfix flag" Jim Shargo
This reverts commit 95c4948d177ab27c6aa1cba7319d2d8ddf3cf64d. Reason for revert: Turns out you can't do this >:( Change-Id: Ib267951ab8956f834a4a2c8bc0a45f134531f5c1
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-13Merge "BufferQueues: Always respect setMaxDequeuedBufferCount" into main Jim Shargo
2025-03-13Merge "Use TransactionState in SurfaceFlinger." into main Treehugger Robot
2025-03-12Remove flags from cppflags of libgui_test. Anton Ivanov
Also fix tests that depend on them. Rationale: libgui_test currently suffers from ODR violations due to a) including statically built sources of libgui via the defaults, and b) loading libgui at runtime via transitive shared library dependency. The flags set via cppflags affect only a), and this blocks fixing the ODR violation, which would be done by removing a) and standardizing on b). Since flags can be in different stagges of rollout, tests need to be resilient to encountering either value of the flags. Flag: EXEMPT refactor Test: presubmit Bug: 399711310 Change-Id: I3780eae83facf272f885dc0187c64c13d58e4cdf
2025-03-12Merge "Refactor InputTransferToken equality" into main Treehugger Robot
2025-03-12Refactor InputTransferToken equality Patrick Williams
Bug: 361588984 Flag: EXEMPT refactor Test: presubmits Change-Id: Ib5c8b5e342fddfea7672320e6adc7197b210bf9a
2025-03-11BufferQueues: Always respect setMaxDequeuedBufferCount Jim Shargo
For some reason, this wouldn't be respected if no buffers had been queued. This could lead to surprising behavior of a (with unlimited buffers, essentially unbounded) buffers being dequeued for new BQs. This is flag gated to capture potential issues, since I'm worried about chesterton's fence. Bug: 399328309 Flag: com.android.graphics.libgui.flags.bq_always_use_max_dequeued_buffer_count Test: new tests Change-Id: I756eb4f621f6eec1a5bb43a490305018ec69c477
2025-03-11Merge "Revert "Explicitly include libgui as a shared library in ↵ Liana Kazanova (xWF)
libgui_test."" into main
2025-03-11Revert "Explicitly include libgui as a shared library in libgui_test." Liana Kazanova (xWF)
This reverts commit 36127e6b23fd3c66d7055478b96f23ae88f7a1a1. Reason for revert: DroidMonitor: Potential culprit for http://b/402507915 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: I12af47f3ae45e9f9f0b4891f716121b959dc6f44
2025-03-11Merge "Explicitly include libgui as a shared library in libgui_test." into main Anton Ivanov
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
2025-03-11Merge changes I13283720,Iddd8f902 into main Jim Shargo
* changes: BufferItemConsumer: Add/expose methods BufferQueue: Fix deadlock in setMaxAcquiredBufferCount
2025-03-10Explicitly include libgui as a shared library in libgui_test. Anton Ivanov
Currently, libgui is compiled statically into the test binary by virtue of `src` attribute of `libgui-defaults`, and also loaded as a shared library by transitive dependency. This leads to double-delete and use-after-delete issues in the test on global mutexes defined by android::Singleton<>. Flag: EXEMPT refactor Test: presubmit Bug: 399711310 Change-Id: I31408237f345632bfd8f2d2ac880dfac53e75ae4
2025-03-10BufferItemConsumer: Add/expose methods Jim Shargo
Removes unneccessary flag surrounding releaseBuffer, which is flag gated everywhere else. Adds attachBuffer, which wraps IGBP's version of the same method, allowing users to attach a buffer to the consumer. Bug: 393639203 Flag: EXEMPT covered elsewhere Test: new tests Change-Id: I13283720f0f91380301d1aca180c4681c16997d7
2025-03-10BufferQueue: Fix deadlock in setMaxAcquiredBufferCount Jim Shargo
Uncovered this while testing. The deadlock happens when: - ConsumerBase::setMaxAcquiredBufferCount locks itself - Calls IGBC::setMaxAcquiredBufferCount, which can call ConsumerListener::onBuffersReleased - Which, in ConsumerBase, will take the lock again Instead of this, we add a callback to be called instead of the IConsumerListener. This callback is called on the same stack, with the lock held, so that we can resolve everything atomically. Bug: b/393639203 Flag: EXEMPT small cleanup Test: new test Change-Id: Iddd8f902d1fd0aeed6aac095eaa6c0b870ffff70
2025-03-07Fix render thread priority for allocateBuffers “Shadman
Increase the prio for the thread allocateBuffer runs on so we don't cause the main RT prio thread wait as long during frame draws. Bug: 399701430 Test: app launch test Flag: com.android.graphics.libgui.flags.allocate_buffer_priority Change-Id: Ic56697866f1f58c6c5575909da9e1ecd95a3cb06
2025-03-06Merge "Introduce TransactionState." into main Treehugger Robot
2025-03-05Introduce TransactionState. Anton Ivanov
Encapsulate all the data inside transaction that we need to pass into SurfaceFlinger. This will remove some duplicate parcelling logic and clean up the interface into SF. Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: Ia6fab8539e48900700524a127cbcbbebd9acaf7a
2025-03-05Merge "Indicate optimization policy to SurfaceFlinger from DisplayManager" ↵ Treehugger Robot
into main
2025-03-05Merge "Provide classes that logically make up a transaction with == and !=." ↵ Treehugger Robot
into main
2025-03-05Merge "Remove com.android.graphics.libgui.flags.Flags.edgeExtensionShader" ↵ Marzia Favaro
into main
2025-03-04Indicate optimization policy to SurfaceFlinger from DisplayManager Dennis Kiilerich
DisplayManager's never-blank concept is translated in VirtualDisplayAdapter to be a power-optimised display (instead of a performance optimised display) in the downstream components. This concept indicates that these displays typically depend on another display's presence and activeness to be continually rendered and shown. The display they depend on instead optimises for performance when it is on, meaning that all the related displays have good performance. For cases where power optimisation information is not available (calls to DisplayControl#createVirtualDisplay(String, boolean) and SurfaceComposerClient::createVirtualDisplay), the power optimisation state is defaulted to optimise for power since these are system calls and this preserves the previous behaviour. Bug: 342681202 Flag: EXEMPT refactor Test: Flashed build on test device, ran Android Auto Projected Change-Id: I6a9fdf7c4be080e2f4df6734def8a4fbefde5742
2025-03-03Provide classes that logically make up a transaction with == and !=. Anton Ivanov
Primarily this change is intended to support writing test assertions. As a side effect, make some improvements to encapsulation of members. Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: I51352c78ccfcb0fc6bff655593d7d31771516668
2025-03-02Merge "Delay initialization of a ConsumerBase instance to construction of a ↵ Anton Ivanov
sp/wp." into main
2025-02-28Merge "BufferQueues: clean up constructors for GLConsumer and CpuConsumer" ↵ Jim Shargo
into main
2025-02-28Remove com.android.graphics.libgui.flags.Flags.edgeExtensionShader Marzia Favaro
Bug: 398776229 Test: N/A Flag: EXEMPT removing flag Change-Id: Ic24daf4beb4bf7897cc3c0fd3afcf7361cac336c