summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc2.cpp
AgeCommit message (Collapse)Author
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
2022-12-13Add IMapper 5 implementation John Reck
Fixes: 205761028 Test: boots on CF w/ mapper4 removed Change-Id: I062ba3160fae972757669241fedcaf6ac3c6c12b
2022-01-29gralloc: Move validation of non-blob/gpu_data_buffer down to libui Chris Forbes
AIDL gralloc implementations may choose to support this combination. Existing implementations of HIDL gralloc 2/3/4 do not support it, and do not reliably reject it due to having been previously protected by validation at the AHardwareBuffer layer. Move the check down to the gralloc layer, and defer to the HAL only in the AIDL case. Bug: b/195944622 Test: build; real CTS/VTS to land soon after. Change-Id: I7b0b9de005a9b0f564915f9c71cc8aea3ef0618a
2019-12-09gralloc: expose Gralloc4 get/dump functions Marissa Wall
Expose Gralloc4 functions up to GraphicBufferAllocator/Mapper. By adding the functions to GraphicBufferAllocator/Mapper, the rest of the system can depend on GraphicBufferAllocator/Mapper instead of talking directly to IAllocator/IMapper. Bug: 141632767 Test: Implementation will be tested through VtsHalGraphicsMapperV4_0TargetTest Framework plumbing will be testing when it is exposed to GraphicBuffer Change-Id: Ie74a335a9d3a1e085e9fa186b327be8d21e870de
2019-12-05gralloc: Support allocate buffer without import Marissa Wall
Media allocates buffers but doesn't import until they absolutely need to. In order to support codec2 moving to GraphicBufferAllocator, add a function that allows them to allocate without import. Bug: 145139476 Test: VtsHalMediaC2V1_0Host && cherry pick ag/9741096 and run android.media.cts.MediaMetadataRetrieverTest#testThumbnailVP9Hdr Change-Id: Icbd5943d45f20cb796204f816e5aac446d402979
2019-02-04Adding isSupported HIDL Mapper function support to framework Valerie Hau
Bug: 123423521 Test: build, boot, manual testing Change-Id: Iee52de6f5610a8465b1f4435d02dc61a8064064a
2019-02-01Adding optional 3.0 lock support to GraphicBuffer Valerie Hau
Adding optional 3.0 lock parameters to GraphicBuffer Modifying isSupported to isLoaded Bug: 123423521 Test: build, boot Change-Id: If4a92bd7916072c2cd7005ca6f332f4a90098d27
2019-01-22Modifying Gralloc to handle bytesPerPixel and bytesPerStride Valerie Hau
Bug: 120493579 Test: build, boot Change-Id: I1fe5acc17389db6d57529d2e120ab6e1f3715705
2019-01-14gralloc: add allocator and mapper 3.0 support to SF Marissa Wall
Add support for IAllocator and IMapper 3.0 support to SurfaceFlinger. Bug: 120493579 Test: manual Change-Id: I8b7311cfa6b58502b334460d65eb66715ef429e8
2019-01-02gralloc: create a common gralloc interface Marissa Wall
Create gralloc interface for allocator and mapper to hide the implementation differences between Gralloc2 and Gralloc3. Bug: 120493579 Test: manual Change-Id: I21aa1954aa8b79f3e35616f188e15b47dae1f0e7
2019-01-02gralloc: move gralloc2 code inside gralloc2 Marissa Wall
Move Gralloc2 code and types from GraphicBufferAllocator and GraphicBufferMapper into Gralloc2.h/.cpp. Bug: 120493579 Test: manual Change-Id: I1268b0fd1a0645ce3dc4782a23d6d5fe83a4ba27
2018-11-05libui: filter out invalid buffer usage bits Chia-I Wu
Before fixing callers to omit the invalid bits, we need to make sure HALs do not use those bits. Let's filter the invalid bits out and see if anything breaks. Bug: 72323293 Bug: 72703005 Test: play videos on Pixels Change-Id: I539f9b785f9010b7b7cdc5f72d59391211f337e5
2018-05-02rename hidl_enum_{iterator,range} Steven Moreland
This is actually a range, not an iterator. Bug: 78573628 Test: m Change-Id: Ief1caed823da306398d3db5a96b7e007ed722eaf
2018-01-30libui: set USAGE_HW_2D in getValid10UsageBits Chia-I Wu
Bug: 72703005 Test: Manual Change-Id: I48e2c5651881fe6d3b809e978787ffc9a6de9fab Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2018-01-23libui: use IMapper::createDescriptor_2_1 Chia-I Wu
Update using's in Gralloc2.h to be based on common@1.1 and mapper@2.1. Use IMapper::createDescriptor_2_1 when it is available. Test: manual Change-Id: Id4f805a93a5e9a6cde9ecece7dd4954dec337060
2018-01-22Add new AHardwareBuffer formats and usages with latest HAL change Craig Donner
This time we also mask out EXTERNAL_DISP since it is not supported in HIDL. Bug: 66900669 Test: build, and added validation logic to Gralloc2 and GrallocBufferMapper. Change-Id: I7f4174581e24e361577640b9263514a168ed482d
2018-01-22Revert "Add new AHardwareBuffer formats and usages with latest HAL change." Craig Donner
This reverts commit b3899e5147fcff81be43469d9d6e8e56fc5aaac8. Reason for revert: breaks video rendering due to the use of an invalid flag Bug: 72299511 Test: build Change-Id: I7ab62b6aae03e813180fabd86f0570aba97beef0
2018-01-19Add new AHardwareBuffer formats and usages with latest HAL change. Craig Donner
Bug: 66900669 Test: build, and added validation logic to Gralloc2 and GrallocBufferMapper. Change-Id: I374155851fa575a3482084a8b7fbc8f9026b6148
2017-10-03libui: harden GraphicBufferMapper::importBuffer Chia-I Wu
Add support for validateBufferSize and getTransportSize from IMapper 2.1. Update GraphicBufferMapper::importBuffer to validate buffer size, and update GraphicBuffer::flatten to use the handle transport size. This fixes two issues with GraphicBuffer. Pointers returned by lock/lockYCbCr can now be accessed without potential OOB. flatten no longer includes process-local runtime data. Bug: 62535446 Bug: 62084097 Bug: 32587089 Test: manual Change-Id: Ice13af26b84f25e43089637e9d67e3ad820e22ed
2017-07-06Add GraphicBufferMapper::preloadHal Jesse Hall
Plumbing to allow Zygote to explicitly preload the a.h.graphics.mapper HAL. An earlier attempt did this implicitly with a static initializer in libui.so, but the library is also used by non-Zygote processes that don't have access to HALs. This way, the HIDL libraries and HAL are only loaded in Zygote and its children, not random other processes. Bug: 62353585 Test: check that a.h.graphics.mapper is in /proc/`pid zygote64`/maps Change-Id: I4989c8089e3a4cfd627f8940f5552950c1c617fc
2017-06-23Revert "libui: Load a.h.graphics.mapper passthrough service on library load" Jeff Vander Stoep
This reverts commit 75ca86f072f82d38b21e0a13234ecbc2c24cb6ab. avc: denied { read } name="hw" scontext=u:r:cameraserver:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:folio_daemon:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:hal_imsrtp:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:idmap:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:mediaextractor:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:mediametrics:s0 tcontext=u:object_r:system_file:s0 tclass=dir avc: denied { read } name="hw" scontext=u:r:webview_zygote:s0 tcontext=u:object_r:system_file:s0 tclass=dir Bug: 62353585 Bug: 62912747 Bug: 35197529 Test: build and boot device. Launch camera, take pictures. Change-Id: Ic6884f7235edb9191034a285414eb93aa44ac23c
2017-06-16libui: Load a.h.graphics.mapper passthrough service on library load Jesse Hall
Zygote loads libui, this helps complete the chain from zygote -> libui -> a.h.graphics.mapper -> gralloc so that all of these libraries which are used by nearly every app are loaded by zygote and shared. Bug: 62353585 Test: boot to launcher, run calculator, confirm a.h.graphics.mapper implementation library is in /proc/`pid zygote64`/maps Change-Id: Ib505c926a410191e3e2ad809bfe98a73b21fac90
2017-05-16libui: flush hwbinder commands in Allocator::allocate Chia-I Wu
Bug: 36279079 Test: monkey test on fugu Change-Id: I81f72d63d3ede64f279b26208bb5df7646050e73
2017-04-18libui: remove gralloc0/gralloc1 support Chia-I Wu
We now talk to HIDL gralloc exclusively. Bug: 37433368 Test: boots Change-Id: Iecd2f9a02c7066b2f33f24c1de57e9c4af8e28f5
2017-04-10libui: update for revised HIDL gralloc Chia-I Wu
The revised HIDL gralloc is implementable on top of gralloc0 and gralloc1, which enables us to remove all legacy code. However, it lacks the ability to query buffer properties from a buffer handle. GetBufferFromHandle in VR always fails. Bug: 36481301 Test: builds and boots on Pixel Change-Id: Id7cfa2d2172dfc008803860f24fcf4f03ba05f11