summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
AgeCommit message (Collapse)Author
2024-11-28Merge "Revert "Add new ANativeWindow_setFrameRateParams API"" into main Rachel Lee
2024-11-26Revert "Add new ANativeWindow_setFrameRateParams API" Rachel Lee
Revert submission 29890736-anativewindow-setframerateparams Reason for revert: removing API to be landed in another release. Reverted changes: /q/submissionid:29890736-anativewindow-setframerateparams Change-Id: I366030e9bcb4b468e728cf425c1c22360700fe71
2024-11-11Add DISPLAY_BT2020 dataspace Alec Mouri
This already exists in AIDL, and will exist in the SDK Bug: 355264141 Flag: EXEMPT NDK can't be flagged! Test: builds Change-Id: I32fd0e9d5c58363393d5217211d1f5fe9e14f86b
2024-10-25Add new ANativeWindow_setFrameRateParams API Rachel Lee
The new overload uses same plumbing and same logic as the other setFrameRate-like functions. This plumbing and logic will be upgraded to accommodate new parameters in a future CL. Bug: 362798998 Test: atest SetFrameRateTest Flag: EXEMPT NDK Change-Id: If29c32a92b48c36fe06c70db5505f73cea482637
2023-12-14Add AHB_allocate2 + get/setDataSpace John Reck
Also fix that some ADataSpace enum values were not prefixed with ADATASPACE_* Test: atest AHardwareBufferTest Bug: 315475131 Change-Id: Ie92f416a209501fa8fdc9b3593ea6d3bb68eaa48
2023-04-06Revert "Revert "Remove incorrect isDataSpaceValid"" John Reck
This reverts commit 265f96fb55dcacb3dc038ef5b2f9d9387c9fc037. Reason for revert: Fixed underlying issue Bug: 276807477 Test: atest android.graphics.cts.ANativeWindowTest#testSetBuffersDataSpace Change-Id: I101c246f673bf279c3c441759b82bdc607794b75
2023-04-06Revert "Remove incorrect isDataSpaceValid" Ayush Jain
This reverts commit e4f832e21dbad52f7b455d557584d8baad66dd6f. Reason for revert: DroidMonitor: Potential culprit for Bug b/277122111 - 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: I0fc4f98eb83448562c57433aa68018bcfee746bf
2023-04-05Remove incorrect isDataSpaceValid John Reck
Bug: 276807477 Test: SilkFX demo Change-Id: I3d11924199b4eb18cd0ec3fbddc88ed7d5c42a6e
2023-02-28Fix implementation of ANW_read/write parcel John Reck
Bug: 268427650 Test: atest android.graphics.cts.ANativeWindowTest Change-Id: I19d7390998edbad960fe8812ec1d57e5a725b4e6
2022-12-02Inlining the clearFrameRate function. Kriti Dang
Bug: 246597190 Test: m Change-Id: Ia11f47de9b52ecfc41119fcf2605b5ac56b07275
2022-11-03Make ANativeWindow available over stable AIDL Sungtak Lee
Bug: 251850069 Test: m Change-Id: Ia47a5c6a83a7c51b4034c901f6ffc9813d3a6eb3
2022-09-02Add clearFrameRate API in ndk Kriti Dang
This API is same as using setFrameRate with 0 as frame-rate value. But this causes confusion, as the remaining two arguments are ignored, when frame-rate is 0. Bug: 241096917 Test: android.graphics.cts.SetFrameRateTest#testClearFrameRate Change-Id: I469e41cc1a15abf4c0b402caca12a9f6db4cdb71
2022-07-06Add ANativeWindow_getBuffersDefaultDataSpace() Jason Macnak
This is useful for ANGLE (OpenGL ES implementation layered on top of Vulkan) which needs to the know the default dataspace to pass along to Vulkan when creating a surface/swapchain for an ANativeWindow. See http://aosp/q/topic:cuttlefish-angle-colorspace Bug: b/229286407 Test: lunch aosp_cf_x86_64_phone-userdebug && m && cts -m CtsMediaCodecTestCases Change-Id: Ie7a0c4b4f409f730f5c70bd88485644cfa03f10d
2022-06-07Add prefix to newly introduced IntDef for DEPTH Sally Qi
Bug: 235218604 Test: builds Change-Id: Ia2b4be4ac2936b6e136d58d107ec0fe4f5b41a0e
2021-12-07Add DEPTH variables into ADataSpace Sally Qi
Bug: 205034862 Test: builds Change-Id: I1ac30853a873744027c2ea0aac731ecb76ca3b34
2021-11-16Merge "Add BT2020 PQ variant to ADataSpace" TreeHugger Robot
2021-11-16Add BT2020 PQ variant to ADataSpace Sally Qi
Bug: 201535612 Test: builds Change-Id: I0851a5fcf8afaa8cf9f9f8a6d15da3f60e601fd5
2021-11-15Add BT2020 HLG and variant into ADataSpace Sally Qi
Bug: 201535612 Test: build pass Change-Id: Iecde54a4ba554f16bcb381ab65c8d9d8f22222bb
2021-10-14Remove primary SHIFT variables from ADataSpace Sally Qi
Bug: 201539996 Test: build pass Change-Id: I91b65470567d243213cf7e1dbabec5ff41130371
2021-10-06ADataSpace should be aligned with the AIDL Dataspace. Sally Qi
Bug: 200309580 Test: build pass Change-Id: Ibe184ca6edcbd61677d2cdf5d45e0ad24161ee30
2021-06-03Make sure ANATIVEWINDOW_QUERY_BUFFER_AGE is identified as VNDK API. Peiyong Lin
Previously when we switch to only expose VNDK header, the ANativeWindow_query doesn't properly recognize ANATIVEWINDOW_QUERY_BUFFER_AGE as a VNDK query and hence a -EINVAL was returned. This patch makes sure it is identified and skipped to complete the actual query. Bug: b/189551931 Test: manual Change-Id: I9d4ef74dec3315e661e5a01e7b34a9f97f41fe78
2021-03-24setFrameRate: Make shouldBeSeamless an enum Marin Shalamanov
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
2020-11-16Add shouldBeSeamless to setFrameRate Marin Shalamanov
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
2020-02-19Merge "[ANativeWindow] Apply remaining API feedback" TreeHugger Robot
2020-02-18Add compatibility param to setFrameRate() api Steven Thomas
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
2020-02-14[ANativeWindow] Apply remaining API feedback Alec Mouri
* 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
2020-02-13[ANativeWindow] allocateBuffers changes Alec Mouri
* rename allocateBuffers to tryAllocateBuffers to reflect that its a best-effort API * promote to public NDK Bug: 148962594 Test: builds Change-Id: Iff73c2eb7bb07d28ef26b95202257950e9da4627
2020-02-03[ANativeWindow] add ANativeWindow_getNextFrameId api. Alec Mouri
Stable API for getNextFrameNumber. Here the naming is mirroring the existing EGL api for eglGetNextFrameIdANDROID. Bug: 137012798 Test: builds Change-Id: I8bf6fb198055a295b8aa68d3b9db2577376d39b1
2020-02-01Merge "[ANativeWindow] Add ANativeWindow_allocateBuffers stable abi." TreeHugger Robot
2020-02-01Merge "[ANativeWindow] Support interception methods in apex" TreeHugger Robot
2020-01-23[ANativeWindow] Add ANativeWindow_allocateBuffers stable abi. Alec Mouri
Bug: 137012798 Test: builds Change-Id: Ibe2afe83d48adb583bfbda088376fcf402050814
2020-01-23[ANativeWindow] Support interception methods in apex Alec Mouri
This is to support HWUI's ReliableSurface. Test: builds Test: Hook up with HWUI and manually verify with settings app Change-Id: I3a1d75dbd993dde1771930ad25212d8e4e7d94a0
2020-01-22Add setFrameRate() api Steven Thomas
setFrameRate() is a new api in Android 11 that will enable apps to specify their intended frame rate. Bug: 143912624 Bug: 137287430 Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest. Change-Id: I0150055fbffd37f2d644829e9dadbfc517045d8e
2020-01-07Extend ADataspace. Peiyong Lin
In order to allow NDK image decoding to access more color spaces, extend ADataspace to match Named.ColorSpace as many as possible. BUG: b/140635413 Test: build Change-Id: I8e06071060ab19b103900ff04d60f1c3d3fccda9
2019-09-06[ANativeWindow] Increase precision for duration queries. Alec Mouri
Use perform() instead in query() to retrieve dequeue/queue durations for nanosecond resolution. Bug: 137012798 Test: atest Change-Id: I894a8784f3321d4ab6f538d7e7fc1457de26f289
2019-09-06[ANativeWindow] Add stub for ANativeWindow_setDequeueTimeout Alec Mouri
HWUI and media both require setting a dequeue timeout so that dequeue calls don't hang. Bug: 137012798 Test: libnativewindow_test Change-Id: Ic85b07096d490918ae4a722516b8c4b6cb0ab678
2019-09-06[ANativeWindow] Add apex stub for getLastDequeueStartTime Alec Mouri
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
2019-09-06[ANativeWindow] Add apex header for getLastQueueDuration Alec Mouri
Bug: 137012798 Test: libnativewindow_test Change-Id: I46d5ab9c11161923ebbbc67400b10b2e7c0c6b61
2019-08-20[ANativeWindow] Add test infrastructure for apex apis Alec Mouri
* 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
2019-06-27BufferQueue: handle consumer driven size for pre-rotation Yiwei Zhang
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
2018-05-31Fix enum-compare warning Yi Kong
Explicitly cast enum type to int for value comparison. Bug: 72330874 Test: m checkbuild Change-Id: Ic0403fbb525c47a19c7d788686857f60ffb89990
2018-04-06ANativeWindow_setBuffersTransform: Allow forwarding INVERSE_DISPLAY Robert Carr
For OpenGL based camera viewfinder implementations, we want to let them read the Transform bit off the original camera API provided image and forward it to their OpenGL surface so they can achieve the same rotation functionality. Bug: 74400997 Test: Manual Change-Id: Idccd977e6d885b1b12de019faa98b564cc7baf48
2018-02-07[NDK] Expose NDK API to set buffers data space for P. Peiyong Lin
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
2017-05-26use 64-bits usage bits almost everywhere Mathias Agopian
Revert "Revert "use 64-bits usage bits almost everywhere"" This reverts commit 1671de0068de40f57288628d4b757a1c84962a62. Test: manual, build Bug: 33350696 Bug: 38466700 Change-Id: Ia2f51b97137dba754b1938dfb1e235f4babc8a88
2017-05-21Revert "use 64-bits usage bits almost everywhere" Guang Zhu
Bug: 38466700 This reverts commit 175d98757d7d9003d4f64756cf4c2b366ba77e97. Change-Id: I5f08a4ca91511775cd52250d10a0220b258b8368
2017-05-19use 64-bits usage bits almost everywhere Mathias Agopian
Test: manual, build Bug: 33350696 Change-Id: Ida33c2a902155044651158467bb99d664e958c41
2017-05-09fix circular dependency libnativewindow <-> libui Mathias Agopian
Bug: 37647680 Bug: 37648355 Test: compile, manual Change-Id: I9631beea52e23ebb519411f943c6f5062aedd2e5
2017-04-28Plumb gralloc producer/consumer bits correctly Mathias Agopian
Bug: 33350696 Test: compile, boot device, cts Change-Id: I2f078cf4bbdf0db49f2e914b051f55629fb37eb6
2017-04-03Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer Mathias Agopian
this is to allow vendors to use AHardwareBuffer’s lock/unlock on buffer dequeued from an ANativeWindow. Test: compiled Bug: 36866217 Change-Id: If630105572ae0e57f6fda19c13e82150f415ed6b
2017-03-28Use gralloc usage conversion library Jesse Hall
Converting from ..graphics.allocator@2.0 usage to gralloc0 usage isn't quite as simple as ORing and truncating, which is what the default implementation was doing. Switch to using library functions that do it correctly. Test: boot bullhead Change-Id: Ibe644b53655e191b9bca9d619825a8918e8fc365