summaryrefslogtreecommitdiff
path: root/libs/nativewindow/include/system
Commit message (Collapse)AuthorAgeFilesLines
* Support HIGH_INTERACTIVE category in nativeRachel Lee2024-01-021-1/+10
| | | | | | | | | | | | | This is mainly to be used by toolkit to send the touch interaction to SF (in effort to handle touch signal in toolkit instead of SF). The HighInteractive category is similar to Heuristic layer type but will be considered in touch boost logic. Bug: 315071842 Test: atest libsurfaceflinger_unittest Test: atest CtsSurfaceControlTestsStaging Change-Id: I97a94fa970e165424757e4537468fbeda4226a72
* Add frame rate compatibility GTE logicRachel Lee2023-11-291-1/+6
| | | | | | | Bug: 306080972 Test: atest libsurfaceflinger_unittest Test: atest SetFrameRateTest Change-Id: I65551be0f96fd7d4137e49259436e1a9c74bfe90
* native: Rename frame rate selection strategiesRachel Lee2023-11-221-11/+15
| | | | | | | | | | | SELF -> PROPAGATE (default) DO_NOT_PROPAGATE -> SELF No behavioral changes. Test: atest libsurfaceflinger_unittest Bug: 309687765 Change-Id: I055d827a45ecc7f566375425c42e745a41b751f9
* Logic for selection strategy "DoNotPropagate"Rachel Lee2023-11-211-1/+14
| | | | | | | | | | | | This logic is for the new FrameRateSelectionStrategy::DoNotPropagate. The default behavior ("Self") is to propagate parent vote to children that has no votes, but if a layer has "DoNotPropagate", it will not propagate its vote to children. Bug: 309687765 Test: atest libsurfaceflinger_unittest Test: atest CtsSurfaceControlTestsStaging Change-Id: I284b639f2b1902c5e9d3dcd08ceaf3f76b73451e
* Plumb new frameRateSelectionStrategy valueRachel Lee2023-09-181-0/+20
| | | | | | | | | | | This new value will allow a parent layer to override the frame rate specifications of all its descendants. This CL only plumbs the value from Transaction to Layer. Bug: 297418260 Test: atest CtsSurfaceControlTestsStaging Test: atest libsurfaceflinger_unittest Change-Id: Ibbda6ff6c143e931240178d89306822b4cce9669
* Add setFrameRateCategory surface APIRachel Lee2023-08-221-0/+36
| | | | | | | Bug: 284911776 Test: atest CtsSurfaceControlTestsStaging Test: atest libsurfaceflinger_unittest Change-Id: Ia804a63198ff096d1e5ffedf6046a0350963b8ed
* SF: improve RenderThread jank classificaionAdy Abraham2023-06-081-5/+26
| | | | | | | | | | | Mark UI frames that didn't make it to their expected presentation due to RenderThread animations as dropped. Screenshot from Perfetto: https://screenshot.googleplex.com/3pQuNaDYAhHLYu7 Bug: 210605870 Test: manual Change-Id: Ibc91bcaac2f9296ec0bddd5deebb4289c5b5bf7e
* SF: use TextureView hint when selecting the refresh rateAdy Abraham2023-05-091-6/+5
| | | | | | | | | | | | SF would only try to heuristically calculate the frame rate of a layer when TextureView is updating. This fixes a bug where SF tries to heuristically calculate the frame rate for UI animations but fails due to long frames. Bug: 280249265 Test: Playing a video on Facebook and observe refresh rate Test: go/cb-pcmark Change-Id: Ic98484b8313f1e8e6ad01297b63bb64da6d4a6dd
* SF: fix FrameTimelineInfo association to buffersAdy Abraham2023-01-231-2/+3
| | | | | | | | | Store a mapping between a frame number and the FrameTimelineInfo and apply the correct FrameTimelineInfo on the transaction. Test: TBD Bug: 255875655 Change-Id: I4206984be8e5a91c5dc15b74688575d97fbb5357
* Remove internal display related methodsHuihong Luo2022-09-261-8/+27
| | | | | | | | | | | | | | | | | | | | | SurfaceFlinger and SurfaceComposerClient simply return the first connected display as internal display, which is not really correct. In particular,in the case of dual display for foldable devices, both displays are marked as Internal determined by calling into HWC2 IComposerClient::getDisplayConnectionType(). Therefore, the concept of internal/external/primary displays is removed from SurfaceFlinger, and the display manager is the better place to handle the logics. flatland is modified to take an extra argument to specify display id, and error occurs if no display is specified in case of multi-display. Bug: 241285477 Bug: 242763577 Bug: 74619554 Test: atest libgui_test libsurfaceflinger_unittest SurfaceFlinger_test Change-Id: Ib6c7e502ef3269c2c60a4e5388e5ac75275f87ed
* SurfaceFlinger: Remove usage of window types to implement policyAndy Labrada2022-07-061-0/+5
| | | | | | | | | | Native side for a new API, setFrameRateDefault, where policy implementation logic is made using setFrameRateDefault instead of checking window types. To test the implementation of this API, SurfaceFlinger property use_content_detection_for_refresh_rate should be set to 1. Bug: 192291754 Test: atest LayerHistoryTest Test: added logs and verified status bar window gets no vote, wallpaper gets min vote and other windows get heuristic vote when use_content_detection_for_refresh_rate is set to 1 Change-Id: I736ac1bd82644b1fd8164f3be33f086934d27487
* SF: Fix feedback loop with refresh rate overlayDominik Laskowski2022-04-041-0/+18
| | | | | | | | | | | | | | | | | | | RefreshRateOverlay was refactored to use transactions instead of APIs internal to SF. A side effect is that the overlay layer feeds back into the frame rate detection and idle heuristics, which causes oscillation that trends to the high refresh rate. The transaction to setFrameRate failed to apply, as the NoVote argument was invalid. Make it valid, such that LayerHistory::summarize skips the overlay layer. Do not reset the idle timer for solely NO_VOTE transactions. Bug: 221081400 Test: flame is not stuck at 90 Hz when overlay is enabled. Test: Same with sf.debug.show_refresh_rate_overlay_spinner Test: SetFrameRateTest Change-Id: I6322c1c487672b602a0f974e8ecf445633dcc3a1
* Add frame timeline method to ASurfaceControl NDK.Rachel Lee2021-12-091-4/+5
| | | | | | | | Bug: 198192003 Test: atest ASurfaceControlTest perfetto trace Change-Id: I04310bd9190cfc227ff5ba892c7187d3b8a20463
* Update ANativeWindow_getNextFrameId docs to specify API contractPablo Gamito2021-09-061-1/+4
| | | | | | | We rely on frame ids starting at 1, with 0 being invalid/uninitialize, and incrementing for each frame chronologically for as long as the underlying surface doesn't change. Test: N/A Change-Id: I90e9593b7ae852bcc90c5c17bc4969c7d827b2d9
* Make frame number type consistentPablo Gamito2021-09-061-2/+2
| | | | | | | The frame numbers are ultimately stored as uint64_t so to avoid any implementation dependent casting we make sure all direct and indirect references to this value are stored as uint64_t Test: Existing tests Change-Id: Id00ff8fceeb6adff3dbb63746920c1010aada09d
* SF: increase the number of buffers for SurfaceViewAdy Abraham2021-06-171-7/+1
| | | | | | | | | | | | | | | 3 buffers are not sufficient for most apps to render at high refresh rates. This change increases the maxAcquiredBufferCount on the buffer queue for all surfaces, and removes the hwui-specific extra buffer allocations. All Surfaces connected to SurfaceFlinger will have now enough buffers to account for configured 'debug.sf.late.app.duration' value. Test: Run backpressure based game on 60Hz and 120Hz and collect traces Bug: 188553729 Change-Id: Ib8fda5db3f48c3bfc6fbf07167b4313674512cee
* Add a better getLastQueuedBufferJohn Reck2021-05-191-0/+26
| | | | | | | | | | Avoid obfuscation via a matrix that's not necessarily useful or in the desired origin of the caller. Instead return the source data, which is also a lot smaller than the matrix is... Bug: 183553027 Test: atest android.view.cts.PixelCopyTest (+new testBufferQueueCrop) Change-Id: I1f7b5981405b2f20293bce9119414fc7780b8eb6
* setFrameRate: Make shouldBeSeamless an enumMarin Shalamanov2021-03-241-2/+2
| | | | | | | | | | | | | | Change the shouldBeSeamless parameter to an enum in order to make the API easier to understand. This changes - SurfaceControl.setFrameRate - Surface.setFrameRate - ANativeWindow_setFrameRateWithChangeStrategy - ASurfaceTransaction_setFrameRateWithChangeStrategy Bug: 179116474 Test: atest SetFrameRateTest Change-Id: I28a8863ea77101f90b878fbda5f00d98e075b7cc
* SurfaceFlinger: expose vsync id extra buffersAdy Abraham2021-02-051-0/+6
| | | | | | | | | | Expose a function for clients to call and query the number of extra buffers needed when vsync id is passed with the buffer. Test: launch an app and observe systrace Test: SF unit tests Bug: 178148035 Change-Id: Icbeec66073feeae9768f0dcc45831b26144ab6f6
* Add inputEventId to SurfaceFrameSiarhei Vishniakou2021-01-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SurfaceFrame will now be aware of the id of the input event that caused the current frame. The flow of input event id is inputflinger -> app -> surfaceflinger. Here, we are adding the 'inputEventId' parameter to the 'setFrameTimelineVsync' call. This call will now be responsible for setting two pieces of information: the vsync id, and the input event id. Since it will no longer be limited to the vsync id, we rename this call to "setFrameTimelineInfo". Once the inputEventId is stored in SurfaceFrame, we will add a binder call to send the frame timing information to inputflinger (separate, future CL). This will allow input to reconstruct the entire sequence of events (at what time was input event getting processed in system_server, app, and surfaceflinger) and will provide the ability to measure end-to-end touch latency. In a separate change, we will also add ATRACE calls to allow manual / script-based latency analysis for local debugging. We will now know which input event is being processed in surfaceflinger. Bug: 169866723 Bug: 129481165 Design doc: https://docs.google.com/document/d/1G3bLaZYSmbe6AKcL-6ZChvrw_B_LXEz29Z6Ed9QoYXY/edit# Test: atest WMShellUnitTests SurfaceParcelable_test libgui_test IPC_test SurfaceFlinger_test Change-Id: If7e0eee82603b38b396b53ad7ced660973efcb50 Merged-In: If7e0eee82603b38b396b53ad7ced660973efcb50
* Add shouldBeSeamless to setFrameRateMarin Shalamanov2020-11-161-2/+2
| | | | | | | | | | | | | | | | This CL adds a new parameter shouldBeSeamless to the existing setFrameRate APIs. This parameter indicates whether the desired refresh rate should be achieved only seamlessly or also switches with visual interruptions for the user are allowed. The default value of the new parameter is "true". Test: atest RefreshRateConfigsTest Test: atest SetFrameRateTest Test: atest libsurfaceflinger_unittest Test: atest libgui_test Bug: 161776961 Change-Id: I0df16e09f77c8c198fd3733fb581a2aaadfed685
* SurfaceFlinger: Shared timeline plumbingAdy Abraham2020-09-161-0/+7
| | | | | | | | | | | Add plumbing to get shared timeline data from Surface Flinger to HWUI and back. Bug: 162890382 Bug: 162888881 Test: SF unit tests Change-Id: Ifb76e6bf28d43c051e6c8ff568437ec9a106b865
* Add hook for intercepting queryJohn Reck2020-05-071-0/+35
| | | | | | Bug: 143555869 Test: verified no kgsl maps in RenderThread Change-Id: Ifac5869cd6b29570286f8fd2aa641701f77fde94
* Merge "[ANativeWindow] Apply remaining API feedback"TreeHugger Robot2020-02-191-0/+11
|\
| * [ANativeWindow] Apply remaining API feedbackAlec Mouri2020-02-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * move ANativeWindow_getFrameId to a platform api, as native_window_get_frame_timestamps is not stable and therefore the associated api surface is not complete enough to be stable. * Adjust documentation for returned errors. In most cases errors aren't returned in practice. In the case of ANativeWindow_setDequeueTimeout the errors are enumerated explicitly. Bug: 148962594 Test: builds Change-Id: I1ff5113d91fdcfc4679b2862af72fbf811171253
* | Add compatibility param to setFrameRate() apiSteven Thomas2020-02-181-2/+4
|/ | | | | | | | | | | | | | | | | | | Add a compatiblity param to the setFrameRate() api, so the system has more info to decide the device frame rate when there are multiple competing preferences. I also changed the plumbing for setFrameRate() to go directly to surface flinger, instead of through buffer queue. We're trying to avoid changes to buffer queue code, to avoid disturbing the prebuilts. Bug: 137287430 Test: Added new cts tests to verify behavior of the compatibility param. cts-tradefed run commandAndExit cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.SetFrameRateTest Test: /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test --gtest_filter='SetFrameRateTest.*' Change-Id: Ibe75a778fb459d4138a1446c1b38b44798b56a99
* [ANativeWindow] Add getLastQueuedBuffer apiAlec Mouri2020-02-131-0/+31
| | | | | | | Bug: 137012798 Bug: 148962594 Test: builds Change-Id: I3dcf6741c8d5dc62b7ae13d5cf5dc56173f95660
* [ANativeWindow] Add ANativeWindow_allocateBuffers stable abi.Alec Mouri2020-01-231-0/+1
| | | | | | Bug: 137012798 Test: builds Change-Id: Ibe2afe83d48adb583bfbda088376fcf402050814
* [ANativeWindow] Support interception methods in apexAlec Mouri2020-01-231-4/+8
| | | | | | | | This is to support HWUI's ReliableSurface. Test: builds Test: Hook up with HWUI and manually verify with settings app Change-Id: I3a1d75dbd993dde1771930ad25212d8e4e7d94a0
* Add plumbing for upcoming setFrameRate() apiSteven Thomas2020-01-161-1/+6
| | | | | | | | | | | | | Add plumbing from the app to surface flinger for the ANativeWindow_setFrameRate() and ASurfaceTransaction_setFrameRate() api calls we'll be adding soon. We don't do anything in surface flinger with this data yet. Bug: 143912624 Test: Added a new test, SetFrameRateTest. Change-Id: I1cab87f3ce5afca4591a39d8e7a42cb1e86a368f
* [ANativeWindow] Increase precision for duration queries.Alec Mouri2019-09-061-3/+9
| | | | | | | | | Use perform() instead in query() to retrieve dequeue/queue durations for nanosecond resolution. Bug: 137012798 Test: atest Change-Id: I894a8784f3321d4ab6f538d7e7fc1457de26f289
* [ANativeWindow] Add stub for ANativeWindow_setDequeueTimeoutAlec Mouri2019-09-061-0/+1
| | | | | | | | | HWUI and media both require setting a dequeue timeout so that dequeue calls don't hang. Bug: 137012798 Test: libnativewindow_test Change-Id: Ic85b07096d490918ae4a722516b8c4b6cb0ab678
* [ANativeWindow] Add apex stub for getLastDequeueStartTimeAlec Mouri2019-09-061-1/+1
| | | | | | | | | | | | Also adding private query64 hook so that timing queries can have nanosecond precision. Otherwise with a 32-bit width we can only have millisecond precision for timestamps and microsecond precision for time intervals, and really we shouldn't need to be less precise if we can help it. Bug: 137012798 Test: libnativewindow_test Change-Id: I62233a588eee80f7ea70b74824c8e47461a3be81
* [ANativeWindow] Add test infrastructure for apex apisAlec Mouri2019-08-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * Add ANativeWindow_getLastDequeueDuration as proof of concept * Add ANativeWindowTest harness * apex/ include directory for code living in apex modules, so that vndk or system apis aren't pulled in * TEST_MAPPING configuration for presubmit Note that we're not piggybacking off of the existing Surface_test harness, as those tests assume that the libgui Surface is The ANativeWindow surface implementation, which means that those tests may test implementation details that the harness defined in this change should not attempt to test. Further, if an alternative implementation is provided (e.g. an ANativeWindow -> BLAST adapter), we should be able to parameterize the tests here. For now, however, we'll keep the assumption that Surface is the only relevant surface implementation so that nonzero tests may be written. Bug: 137012161 Bug: 137012798 Test: libnativewindow_test Change-Id: I0dddc348563ba95530fb1bd04bde66080755a91d
* BufferQueue: handle consumer driven size for pre-rotationYiwei Zhang2019-06-271-34/+49
| | | | | | | | | | | | | | | | | This change adds an option for the producer to set auto pre-rotation on the buffers to be allocated. When auto pre-rotation is enabled, if the current buffer size is driven by the consumer and there's 90 or 270 degree rotation specified in the transform hint currently used by the producer, then the dimension of the buffers to be allocated will be additionally swapped upon buffers pre-allocaton or dequeueBuffer. Auto prerotaion will be cached at Surface producer side, and will be reset to false upon Surface disconnection. Bug: 129422697 Test: atest libgui_test:SurfaceTest#DequeueWithConsumerDrivenSize Change-Id: I01ddf3e00d5951935e557d18932ea9869f36b5d6
* Adding HDR10+ metadata support for media APIValerie Hau2018-11-261-2/+24
| | | | | | Bug: 118343714 Test: build, boot, run libgui_test Change-Id: Ifa5ccb31083d920f1162ea892de0be047f5b88a1
* swapchain: add query for MaxBufferCountYiwei Zhang2018-02-081-0/+5
| | | | | | | | | | | | | The current vkCreateSwapchainKHR use the hard coded maxImageCount from GetPhysicalDeviceSurfaceCapabilitiesKHR, which results in possible conflicts with the maxBufferCount set by BufferQueueConsumer. Thus add a query to grab the consumer set maxBufferCount into maxImageCount of surface capability. Test: adb shell setprop debug.hwui.renderer skiavk Test: open Play store search and click on apps Bug: b/71894146 Change-Id: Iba75d977b13a849b62e6c4f259f7ca519ac26db8
* [NDK] Expose NDK API to set buffers data space for P.Peiyong Lin2018-02-071-0/+5
| | | | | | | | | | | Previously, ANativeWindow_setBuffersDataSpace is only available in VNDK. This patch exposes it in NDK so that display mode for NativeWindow buffer can be set through NDK. The API will remain available in VNDK of NativeWindow since VNDK is the super set of NDK. BUG: 62482961 Test: bit CtsGraphicsTestCases:.ANativeWindowTest Change-Id: I576c4b87296e168d4b7360c437a32bbbbff690a5
* Add plumbing for HDR metadataCourtney Goeltzenleuchter2018-01-041-0/+38
| | | | | | | | | | | | Allow a ANativeWindow client to send HDR metadata to SurfaceFlinger. The metadata can be queried with BufferLayerConsumer::getCurrentHdrMetadata. Written by Courtney. Updated by olv@. Bug: 63710530 Test: builds Change-Id: I23192d4750950664b57863a533bffd72397255b4
* libgui: support 64-bit BQ consumer usageChia-I Wu2017-08-081-4/+10
| | | | | | | | | | | | | Add NATIVE_WINDOW_GET_CONSUMER_USAGE64. Support 64-bit consumer usage flags in BufferItemConsumer and GLConsumer. In H2BGraphicBufferProducer::getConsumerUsage, however, we will issue a warning and return 32-bit consumer usage. We will need a HIDL interface version bump to fix it. Bug: 35215313 Test: manual Change-Id: I1f8884a7db71bbdb269d05b94443ddec2ff46f8a
* use 64-bits usage bits almost everywhereMathias Agopian2017-05-261-78/+38
| | | | | | | | | Revert "Revert "use 64-bits usage bits almost everywhere"" This reverts commit 1671de0068de40f57288628d4b757a1c84962a62. Test: manual, build Bug: 33350696 Bug: 38466700 Change-Id: Ia2f51b97137dba754b1938dfb1e235f4babc8a88
* Revert "use 64-bits usage bits almost everywhere"Guang Zhu2017-05-211-38/+78
| | | | | | | | Bug: 38466700 This reverts commit 175d98757d7d9003d4f64756cf4c2b366ba77e97. Change-Id: I5f08a4ca91511775cd52250d10a0220b258b8368
* use 64-bits usage bits almost everywhereMathias Agopian2017-05-191-78/+38
| | | | | Test: manual, build Bug: 33350696 Change-Id: Ida33c2a902155044651158467bb99d664e958c41
* fix circular dependency libnativewindow <-> libuiMathias Agopian2017-05-101-1/+0
| | | | | | | Bug: 37647680 Bug: 37648355 Test: compile, manual Change-Id: Ib13fe0ad32d6b4ebfc726003ffb65cb5887e24f9
* fix circular dependency libnativewindow <-> libuiMathias Agopian2017-05-091-19/+0
| | | | | | Bug: 37647680 Bug: 37648355 Test: compile, manual Change-Id: I9631beea52e23ebb519411f943c6f5062aedd2e5
* BufferQueue: plumbing mConsumerIsProtectedJiwen 'Steve' Cai2017-05-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This replaces current logic in BufferQueue that uses GRALLOC_USAGE_PROTECTED to indicate whether an ANativeWindow is capable of handling hardware protected gralloc buffers. Current logic is problematic as it enforces producer to use protected buffer no matter whether producer side is capable of writing into a protected buffer. This new solution, however, introduces a new NATIVE_WINDOW_* flag that consumer can set on IGraphicBufferConsumer to indicate its capacity, which can then be queried by producer via Surface::query (or IGraphicBufferProducer::query). When consumer is capable of reading protected buffer (e.g. a protected GL context), the producer can generate either a protected or unprotected buffer. When consumer is not capable of reading protected buffer, the producer should only generate unprotected buffer. Bug: 35726763 Test: videoplayer-nodrm-protected.apk and videoplayer-drm-protected.apk both works. Change-Id: I1bf6814c9f1f81f9e04f0e89646b0733ff1a4758
* egl: Differentiate pending vs invalid timestamps.Brian Anderson2017-04-111-0/+8
| | | | | | | Test: adb shell /data/nativetest/libgui_test/libgui_test --gtest_filter=*GetFrameTimestamps* Change-Id: Iaa418ff1753a4339bfefaa68a6b03e8c96366a87
* egl: Avoid use of retire as presentBrian Anderson2017-04-111-0/+6
| | | | | | | | | | | | | Retire fences from HWC1 are implemented inconsitently, so present emulation doesn't always work well. This patch disables present for all HWC1 based devices. Test: adb shell /data/nativetest/libgui_test/libgui_test --gtest_filter=*GetFrameTimestamps* Bug: 36730849, 36887025 Change-Id: I1eba2f8490c2f6feced2a36d1efc4cd66be7da40
* VNDK ANativeWindow API - step 2Mathias Agopian2017-03-271-152/+9
| | | | | | | | | | | | | | The vndk API is a superset of the NDK API. Prior to this, vendor would have access to system/window.h which itself is a superset of what they need, exposes too much of the internals. With this change, system/window.h depends on vndk/window.h which depends on android/native_window.h Test: compiled, booted Nexus 6P Bug: 34453351 Change-Id: Iad7bf035143541843309437fe630cc603d96a76e
* VNDK ANativeWindow APIMathias Agopian2017-03-271-0/+1095
The vndk API is a superset of the NDK API. Prior to this, vendor would have access to system/window.h which itself is a superset of what they need, exposes too much of the internals. With this change, system/window.h depends on vndk/window.h which depends on android/native_window.h Test: compiled, booted Nexus 6P Bug: 34453351 Change-Id: I870e08c652d90b3f2cf4ed7c7ca541ce2893f689