- Feb 10, 2023
-
-
Chavi Weingarten authored
1. Ignore display overlays since we don't want screen decorations included in the occlusion 2. Handle occluded region as separate Rects to ensure that disconnected Rects in a Region are not considered occluding in the disconnected area. Test: LayerTrustedPresentationListenerTest Bug: 256993331 Change-Id: Ib0a4b850e2aafb42e206b8728fcc9b6013171f3f
-
- Jan 31, 2023
-
-
Patrick Williams authored
* Removes redundant logic for determining whether or not SurfaceFlinger should request texture filtering. * Fixes an issue where ScreenCaptureOutput was using incorrect values for its layer stack projection space. Bug: 238348307 Test: atest TextureFilteringTest Change-Id: I4ece87321ee73d10b86a2c01d53717d337c11926
-
- Jan 25, 2023
-
-
John Reck authored
Bug: 241001465 Test: manual currently, flagged off Change-Id: I707281b9acaf6ea218f1d9ce888fc7cdbf1cf7c9
-
- Dec 21, 2022
-
-
Brian Lindahl authored
This allows the memory for the active buffer to be freed as soon as possible by purging it from HWC cache as soon as the next buffer is sent to the layer. Bug: 258196272 Test: atest OutputLayerUncacheBufferTest Change-Id: I96c24390de5757ac99b369119e9ba031afb0b042
-
- Dec 17, 2022
-
-
Brian Lindahl authored
When an app discards graphic buffers, for example when a MediaCodec disconnects from a surface, those buffers will be uncached and removed from HWC buffer slots. The active buffer, however, should still remain active until the next buffer is queued up. Bug: 262037933 Bug: 258196272 Test: atest OutputLayerUncacheBufferTest Test: atest VtsHalGraphicsComposer3_TargetTest Test: atest VtsHalGraphicsComposerV2_2TargetTest Change-Id: I7c4eefb17e8bad694d698f9ad6d1d289f4af8d2c
-
- Dec 15, 2022
-
-
Brian Lindahl authored
When buffers are discarded by SurfaceFlinger clients, the memory should be free'd immediately. This includes clearing references to them from within the implementation of Composer HAL, specifically in cache slots associated with the layer. Since there is no HAL API to clear the slot directly, prior to writing any other buffer to the layer, we set the layer's buffer multiple times to a placeholder buffer, using each of the slot numbers that need to be cleared. This replaces the reference to the client-discarded buffer inside Composer HAL with a reference to the placeholder buffer, causing the reference count to drop, allowing the buffer memory to be freed. Bug: 258196272 Test: atest OutputLayerUncacheBufferTest Change-Id: Id85482e8859490566f0eedbd8d8729c47a7349fb
-
- Dec 09, 2022
-
-
Brian Lindahl authored
Stop caching buffers inside SurfaceFlinger and remove the tight coupling between SurfaceFlinger's ClientCache and the Hardware Composer cache. This allows a better seperation of responsibility, where buffer cache management is not split between HwcSlotGenerator and HwcBufferCache, but is instead solely handled by HwcBufferCache. Note that FramebufferSurface and VirtualDisplaySurface no longer use HwcBufferCache, but instead use their own cache slot management that is solely based on BufferQueue slot numbers. Also do minor refactoring in FramebufferSurface to simplify code. Bug: 258196272 Test: started and stopped multiple YouTube videos on adt4 and verified no change in graphic buffer usage Test: atest HwcBufferCacheTest Test: atest OutputPrepareTest Change-Id: Ica7955ab4bc70e3c70207390e36dff73a2fc4949
-
- Nov 17, 2022
-
-
Carlos Martinez Romero authored
Bug: 233818658 Test: Manual Change-Id: Iff92fc56c43aefdb4fd978e837969f8ddc9c24f4
-
- Nov 11, 2022
-
-
Leon Scroggins III authored
On a multi-display device, it is helpful to know which display particular methods are called for. Add information to traces specifying the name and id of the display. The device still needs to specify different names for displays (see b/254851304), but the traces will now show the id, which is helpful until the device is updated, at which point the names will be immediately helpful. Output: - Store a string that combines the readable name and the DisplayId. This saves allocation costs for the various places where we add this info to the trace. - Print the name and id in present and postFramebuffer. Although postFramebuffer is called by present, future CLs will move it to a separate thread, and this allows tracking which call applies to which display. DisplaySettings: - Add a field with the display name and id. This allows SkiaRenderEngine to print them as well. SkiaRenderEngine: - Print the name and id in drawLayersInternal - Replace the outdated text for the function name referring to the class as "SkiaGL" with a simple call to __func__. Display: - Print the name and id in chooseClientCompositionStrategy, which may also run in another thread. Bug: 241285473 Test: manual; look at traces Change-Id: I3081c4e4a7b5874139af6b5dd74a6a8ab0ad8cf7
-
- Nov 09, 2022
-
-
Patrick Williams authored
Bug: 238643986 Test: presubmits Test: go/wm-smoke Change-Id: I6dbbcd5ce5070ec1d801dca55b5bb89fafe839cb
-
- Nov 03, 2022
-
-
Patrick Williams authored
This CL allows CE instances without TimeStats. This will be used by the short lived CE instances created in the upcoming renderScreenImpl refactor. Bug: 238643986 Test: presubmits Change-Id: I7f996f3ce660b335f6228069aa04bba617806b68
-
- Oct 31, 2022
-
-
Patrick Williams authored
This change allows multiple instances of CompositionEngine to use the same RenderEngine instance which enables creating new instances of CompositionEngine to run off the main thread. This will be used in the refactor of SurfaceFlinger::renderScreenImpl to generate LayerSettings via CompositionEngine. Bug: 238643986 Test: presubmits Change-Id: I0c8dc30e091578d0d77afb434a52038db6e82288
-
- Oct 13, 2022
-
-
Vishnu Nair authored
Make LayerFE a standalone class with no links back to Layer. Pass LayerSnapshot from Layer into LayerFE before CompositionEngine::present and back after. Bug: 238781169 Test: go/wm-smoke Test: presubmit Change-Id: I5395fb717a931f88e2bf26395acd21e8b308961e
-
- Oct 04, 2022
-
-
Chavi Weingarten authored
The current logic only checks if dirty is not empty, but doesn't account for no content changing. Instead use the same logic that's in beginFrame to compute mustRecompute and use that when determining if the display should queue a buffer. This fixes an issue where a Displays first few frames could be black until the content is loaded. Bug: 239888440 Test: First frame from screenrecord is no longer black Change-Id: Ibb568302bf2d50db167a1f9ca76a0f37e2c65bf5 (cherry picked from commit 09fa1d66)
-
- Sep 29, 2022
-
-
Vishnu Nair authored
Adds LayerMetadata to LayerSnapshots. LayerMetadata is only populated when CE enables the new feature flag and the feature flag will only be enabled in ARC++'s CE. This change is necessary to split LayerFE from the Layer class as ARC++'s LayerFE subclass accesses LayerMetadata. Bug: 238781169 Test: go/wm-smoke Test: presubmit Change-Id: Iae405707897eedf5af9025fe628c1cd60b596e10
-
- Sep 13, 2022
-
-
Vishnu Nair authored
First step in breaking CE dependencies with frontend. FE should provide a snapshot of the state for CE to consume. This cl updates the composition state based on whether visible regions are dirty before calling into composition engine. Test: presubmit Test: go/wm-smoke Bug: 238781169 Change-Id: I6efd71cf66d9e1cae163c98ad4ce3097e09848af
-
- Sep 09, 2022
-
-
joenchen authored
After SurfaceFlinger receives the brightness commands, the commands are sent to HWC until the next frame presents. However, no following frames are present after the power mode is set to off, and HWC cannot receive the last brightness commands. This change forces SurfaceFlinger to flush the staged brightness to HWC prior to execution of power off. Bug: 239908529 Test: suspend and resume repeatedly Change-Id: Ia8fb04399e757de16e06e6516d86bdfcfabd5a2e
-
- Aug 25, 2022
-
-
Chavi Weingarten authored
The current logic only checks if dirty is not empty, but doesn't account for no content changing. Instead use the same logic that's in beginFrame to compute mustRecompute and use that when determining if the display should queue a buffer. This fixes an issue where a Displays first few frames could be black until the content is loaded. Bug: 239888440 Test: First frame from screenrecord is no longer black Change-Id: Ibb568302bf2d50db167a1f9ca76a0f37e2c65bf5
-
- Aug 24, 2022
-
-
Patrick Williams authored
Bug: b/232535621 Test: atest librenderengine_test Test: atest SurfaceFlinger_test Change-Id: If036ab847024751b8da97d6ed856db447db19f6f
-
Brian Johnson authored
the behavior in Output::composeSurfaces(). Bug: 240293363 Test: atest libcompositionengine_test. Fixed tests, added CachedSetTest::renderWhitePointNoColorTransform Change-Id: Ic0317b34978c2ae8d5c057c0a39ed889b86b3da0 Merged-In: Ic0317b34978c2ae8d5c057c0a39ed889b86b3da0
-
- Aug 23, 2022
-
-
Brian Johnson authored
Plumb through Output::getSkipColorTransform() into CachedSet, to match the behavior in Output::composeSurfaces(). Bug: 240293363 Test: atest libcompositionengine_test. Fixed tests, added CachedSetTest::renderWhitePointNoColorTransform Change-Id: Ic0317b34978c2ae8d5c057c0a39ed889b86b3da0
-
- Aug 16, 2022
-
-
Patrick Williams authored
Replace Layer::prepareClientCompositionList with Layer::prepareClientComposition now that at most one layer is returned for any call. Also changes OutputLayer::getOverrideCompositionList to return an optional for the same reason. Output::generateClientCompositionRequest is updated to use buffer ids instead of strong pointers to buffers when determining whether or not override settings are redundant. This is done to avoid duplicate checks on whether or not overrideInfo has a non-null buffer. Change-Id: I777f6ba8c3ca38ea31773e6fcbacb65fad287b03 Bug: b/188891810 Test: atest libcompositionengine_test
-
- Aug 10, 2022
-
-
Dominik Laskowski authored
The corresponding backdoor has been removed, and dumpsys output has no practical use. Bug: 241285477 Test: m libcompositionengine_test Change-Id: I1291b6164d5ef6efa9f94498f90206684dacb779
-
- Aug 07, 2022
-
-
Krzysztof Kosiński authored
Bug: 241680050 Test: presubmit Change-Id: I78a3effb33021b79d451f5e9f32a7d96226bdc60
-
- May 26, 2022
-
-
Huihong Luo authored
Layers with SOLID_COLOR compostion type may cause fence leaks, and since these layers are not frequently used, skipping them should be ok. Bug: 230073351 Test: manual, examine logs Change-Id: I50c2488c4c5b891bf0415f1d4bd29a6e0c49be5b
-
- May 16, 2022
-
-
Dominik Laskowski authored
ftl::yield, which lifts T to std::future<T>, incurs the cost of allocating, ref counting, and locking the latter's shared state. Consolidate the existing std::future extensions into ftl::Future, and optimize ftl::yield by including static storage for T within. Bug: 232436803 Test: simpleperf (-31% cycles in postFramebuffer) Change-Id: I9a7ca7de17e7af10515de97d2f6a0dfa24e35d7a
-
Dominik Laskowski authored
Convert the unique_fd of RenderEngineResult (and futures thereof) into sp<Fence> such that postFramebuffer does not duplicate release/present fences. Remove a few copies of shared futures/pointers with std::move. Bug: 232436803 Test: simpleperf (-33% cycles in sys_dup) Change-Id: Ia7c6c8333a712441f3612fb5c720ea2932799636
-
- May 12, 2022
-
-
Robert Carr authored
As of recently we have begun speculating on the composition strategy in cases where we expect GL composition to be present. This enables us to gain back main thread time by running chooseCompositionStrategy (sometimes a long call to HWC) in parallel with GL composition itself. Currently this is only enabled when no geometry changes. Unfortunately this doesn't help us a lot, since most of the cases where we have jank and issues with SF runtime are around animations. In this CL we try and expand the heuristic to cover more cases, including app launch. Now we expect that if we are sending the same output layers to HWC in the same order, and all we have changed is geometry, then the composition strategy will remain stable. We implement by hashing a subset of the values sent to HWC and detecting changes. Test: Existing tests pass. Play with phone lots, no mispredictions Merged-In: I1f41e2cc67b1b55780e1bf6e837d766b4c186161 Bug: 230617082 Change-Id: I1f41e2cc67b1b55780e1bf6e837d766b4c186161
-
- May 10, 2022
-
-
Robert Carr authored
As of recently we have begun speculating on the composition strategy in cases where we expect GL composition to be present. This enables us to gain back main thread time by running chooseCompositionStrategy (sometimes a long call to HWC) in parallel with GL composition itself. Currently this is only enabled when no geometry changes. Unfortunately this doesn't help us a lot, since most of the cases where we have jank and issues with SF runtime are around animations. In this CL we try and expand the heuristic to cover more cases, including app launch. Now we expect that if we are sending the same output layers to HWC in the same order, and all we have changed is geometry, then the composition strategy will remain stable. We implement by hashing a subset of the values sent to HWC and detecting changes. Test: Existing tests pass. Play with phone lots, no mispredictions Bug: 230617082 Change-Id: I1f41e2cc67b1b55780e1bf6e837d766b4c186161
-
- May 06, 2022
-
-
Tianhao Yao authored
Update the enableBorder API in SurfaceComposerClient so that width and color can be specified for the border. The information propagates through the pipe all the way to the render engine so it can render the correct color and width for the border Test:go/wm-smoke. Test: LayerBorder_test Bug: 226529222 Change-Id: Id3ab853d5b4d6899a915f729b0d7be701cb5b167
-
- May 05, 2022
-
-
Matt Buckley authored
Currently we issue hints at the end of the frame reporting what happened that frame. However, this is often too late anyway and lacks critical information not known until after the frame completes, like gpu timing. By waiting until the next frame start and using those timings along with information about gpu duration, the new expected present time, and the new wakeup time, we can instead use those timings to predict the duration of the upcoming frame and signal in advance of a frame drop. This patch also changes how and where frame timing is done and measures gpu duration so we can predict if a cpu speedup can help gpu composition happen earlier, preventing a drop that way. Bug: b/195990840 Test: manual Change-Id: I5f0ae796198631fced503dce8e6c495885fb256a
-
- May 04, 2022
-
-
Tianhao Yao authored
Provide an API on SurfaceComposerClient::Transaction for enabling a border to be drawn for a specified hierarchy. The caller requests a border to be drawn at a certain Layer and all its children will be included when computing the visible region. The border will draw around the union of all the layers' visible regions, starting from the requested layer. Test: go/wm-smoke Test: LayerBorder_test Bug: 225977175 Change-Id: I7760b51b68cdf01bb9146ec91a270a9d63927995
-
- Apr 27, 2022
-
-
Alec Mouri authored
Introduce a debug sysprop, defaulted to false, to allow for rewriting the transfer function to sRGB when set to true. This is due to several considerations: 1. SurfaceFlinger has not color managed SMPTE 170M properly ever since color management was introduced in Android O, and was only fixed in Android 13. This means that some camera -> encoding -> storage -> playback flows may be incorrectly calibrated on some devices since SMPTE 170M was reinterpreted as sRGB for a long time. 2. BT. 1886 recommends a reference EOTF of gamma 2.4 with tuneable parameters to approximate a CRT on a non-CRT display. Because the framework doesn't support BT. 1886 and it's too late to add support, casting as sRGB is probably okay for now and matches old behavior. 3. Typical Rec. 709 content is graded assuming a dim surround, but phone displays are used in a wide range of viewing environments, which means that viewing Rec. 709 content in a bright environment may appear to have lower contrast. Decoding as sRGB will push the dark codes into lower luminance levels, which will improve contrast in those scenarios. Note that it's better to adjust contrast based on the ambient viewing environment, but again it's too late for Android 13 to improve the color pipeline in the GPU. Bug: 229442032 Test: Photos playback after recording a video Change-Id: I64fc8f2ea77f8e595333de36fb9da2979d8316ca
-
- Apr 21, 2022
-
-
ramindani authored
Source frame and bufferCrop calculations use the primaryDisplayRotationFlags using the projection space orientation just for the source crop calculation causes the unwanted source crop in a situation where bufferCrop and source frame are in different coordinate system. Using the same primaryDisplayRotationFlags in Source crop calculation will make all these calculations in line. Test: verified manually with provided test apk in the #comment1 on foldable, tablet and a phone and verified go/wm-smoke atest libsurfaceflinger_unittest atest libcompositionengine_test atest CompositionTest atest OutputLayerTest BUG: 204187592 Change-Id: I23c6dcfb39979fd67eb5e1d21c011476c630058b
-
- Apr 20, 2022
-
-
Dominik Laskowski authored
Dump display configuration (--displays) and composition state (--comp- displays) separately. Use consistent formatting. Remove noise, e.g. repetitive display modes, physical display state that is expectedly missing for virtual displays. Bug: 182939859 Test: dumpsys SurfaceFlinger --displays Test: dumpsys SurfaceFlinger --comp-displays Change-Id: I787eedb82d76c74363e653a648ae88699096cc47
-
- Apr 04, 2022
-
-
Vishnu Nair authored
Track number of frames we attempted to predict the composition strategy and the number of frames it was successful. This should only be used as a convenient way to debug locally. Composition strategy prediction hit and misses are also tracked via trace tags and can be extracted for metrics. Enable stats: adb shell su root dumpsys SurfaceFlinger --timestats -enable Dump stats: adb shell su root dumpsys SurfaceFlinger --timestats -dump -maxlayers 0 Clear stats: adb shell su root dumpsys SurfaceFlinger --timestats -clear Test: adb shell Bug: 220031739 Change-Id: Ifc35efa7ce110e82041f529b58acebfa1c325f36
-
Vishnu Nair authored
Asynchronously run ValidateDisplay to determine client composition strategy. If we can predict that the composition strategy will not change from frame to frame (for example by looking at whether the geometry of the layers is changing), the hwc call is run asynchronously with the gpu composition. If the result of the call is incorrectly predicted, the gpu composition is rerun. ValidateDisplay can take multiple milliseconds to complete and by making it non-blocking in cases where we can predict the strategy chosen by the hardware, we can jump start the client composition and shave valuable milliseconds from the frame time. This feature is disabled by default. Test: perfetto traces Bug: 220031739 Change-Id: Ia5f04f447455bba0bbebbe7642d8ade8313f381a
-
- Mar 31, 2022
-
-
Dominik Laskowski authored
Bug: 185536303 Test: Build Change-Id: Ia9aafc78565414815dfc14732ce85b06fa96e17b
-
- Mar 30, 2022
-
-
Sally Qi authored
- Disable dimming for screenshot layer Bug: 224860402 Test: check HDR vidoes when rotation, atest libcompositionengine_test Change-Id: Ib07a5af1d4e3e91737b3d5f3e5869c166759563f Merged-In: Ib07a5af1d4e3e91737b3d5f3e5869c166759563f
-
- Mar 29, 2022
-
-
Alec Mouri authored
If HWC is requesting that dimming happens after OETF is applied, then apply the dimming matrix as part of the display color transform Bug: 218954037 Test: Toggle client composition in adaptive color mode during HDR playback Change-Id: Ib72f3f4b6dfcced02fc330e64fa72546a18fb608 Merged-In: Ib72f3f4b6dfcced02fc330e64fa72546a18fb608
-