Metadata query sent to host minigbm detects the YVU420 + LINEAR
combination and internally handle as YVU420_ANDROID to obey Android's
specific layout requirements.
This matches a similar hack applied to the virtgpu_virgl backend long
ago: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2596704
BUG=b:360937659
TEST=Fixes instagram video decode artifacts
Change-Id: I591e427a926327b841be6e280ca57eefab598965
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5849472
Reviewed-by: Chia-I Wu <olv@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Auto-Submit: Ryan Neph <ryanneph@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
minigbm has platform dependent compile flags that need to be set
correctly to work on the chipset (e.g. -DDRV_I915 on Intel devices). The
libminigbm_gralloc_* variants had set them, but the libgbm doesn't. This
CL introduces a Soong config variable "platform" under "minigbm"
namespace to control libgbm build variants, and apply the flags from
gralloc library to each variant.
Device .mk's can set it like:
$(call soong_config_set, minigbm, platform, intel)
Refer to
https://crsrc.org/o/src/third_party/chromiumos-overlay/media-libs/minigbm/minigbm-9999.ebuild
for ChromiumOS configuration of the compile flags.
Bug: 362894809
Test: m libgbm
Change-Id: I64d03604902072da85643c932832064a2425e25b
We need use_flags when we implement the dri interface on top of hbm.
Also, dri_bo_create_with_modifiers does not take use flags only because
gbm_bo_create_with_modifiers does not. That has changed with
gbm_bo_create_with_modifiers2 although minigbm does not reflect that.
BUG=b:292148713
TEST=CQ
Change-Id: I120358c843140a937fee1dd6183d1836ea622eec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801181
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
There is no reason to leak the internals to backends.
BUG=b:292148713
TEST=CQ
Change-Id: I42215ad3add750f19d4a2f0a575a040d73bb19e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801180
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Make dri_driver a proper object that the backend can create, rather than
something that the backend must inherit from.
This makes dri_init return a dri_driver and make the rest dri_*
functions take a dri_driver. There is no functional change.
BUG=b:292148713
TEST=CQ
Change-Id: I3ef045d73b0015b5c6d926dec7bae69d35d94275
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801179
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Some parts of Android uses gcc and bfd, this imports upstream common.mk
changes required to avoid pass unsupported flags to them.
BUG=b:352469414
TEST=CQ
Change-Id: Ie9f5ff8d0590e215688105db4b24f529fd948383
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5825982
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
Auto-Submit: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Tested-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Set `emulated_metadata` fields to default values (0) to prevent
potential usage of uninitialized variables in `virtgpu_virgl.c`.
This fix ensures that the compilation doesn't fail due to warnings
being treated as errors when using strict compiler flags.
Change-Id: I2508168c095896c7fd492830ffb6ff3564dc2733
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5782849
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Define vintf_fragments as modules if the file is shared among multiple
modules to avoid any conflicts.
Bug: 322089980
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: I653ed96587445a3e0126b3eee415edce7b657939
Seeing this error in Android when running `cargo_embargo`:
error: command-line option ‘-fvisibility-inlines-hidden’ is valid
for C++/ObjC++ but not for C [-Werror]
Test: cargo_embargo generate
Bug: none
Change-Id: Iddfaac9a2e4cce22401b65515dea3ed581e57400
... except when running with software rendering as apps do not
know that they would need to request additional CPU_* usage
for GPU_* usage.
Bug: b/356845188
Test: cts -m CtsNativeHardwareTestCases
Change-Id: I3536d80469d2187550558e9d02795896de4f9827
... to pull in https://crrev.com/c/5722608 for depth format support
handling on CF.
Bug: b/352091996
Test: dEQP test cases on Cuttlefish
Change-Id: Ie99042b2d35df70401efa0133b3ccfc370a9a97a
1. Allocate secure buffer from DMA_HEAP_IOCTL_ALLOC ,then using FD to
create a GEM handle and close this FD.
2. Since the secure buffer doesn't allocate via DRM_IOCTL_MTK_GEM_CREATE,
the DRM_MTK_GEM_CREATE_FLAG_RESTRICTED flag can be removed.
It should be added in the code that calls drmModeAddFB2().
3. Add mediatek_private_drv_data to store the dma_heap_fd in drv->priv,
and also add mediatek_close() to close dma_heap_fd and free drv->priv
when backend driver is closing.
BUG=b:248609774
TEST=emerge-geralt minigbm
Change-Id: I96df25580efe04f2c9a739b2d68de8837df091df
Signed-off-by: Jason-jh Lin <jason-jh.lin@mediatek.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5581571
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
To improve the efficiency of allocating high-resolution video decoder,
pass a flag to notify the kernel DMA framework to allocate linear
scanout buffers with single pages, so the allocation is more likely to
success when the available large chunk memory is constrained.
BUG=b:352229429
TEST=emerge-geralt libdrm minigbm
Cq-Depend: chromium:5689126
Change-Id: I21f2745cb5bdb7eaf7f50482c4c091791d13bbcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5706152
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
This syncs common.mk with the latest source in src/platform2/common-mk.
Main change that affects the compiled binary are the newly added
-fvisibility-inlines-hidden CXXFLAGS and the -Bsymbolic-non-weak
LDFLAGS (see comments in the file for what these do).
Deviating from upstream, disable -Wimplicit-fallthrough and
-Wunreachable-code to unbreak compilation.
BUG=b:352469414
TEST=CQ
Change-Id: I75f7dc4084ba7857ab840ee438309c31d9457211
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5691003
Tested-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Auto-Submit: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Commit-Queue: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
This reverts commit b7a9a2b7d5.
Reason for revert: Crash resolved by Ieb07b5bbc206f07f69e4afba921149f49d6fe8c4
Bug: 349870098
Change-Id: I49848f6e7311c1f44e6c988cb42107ed79da3a6b
This includes changes I63a5352e, Ia34b7d3a, I2685813f and I07e60729
mediatek: Add MT8196
minigbm: Reduce allocation size for MT2T allocations
minigbm: #define MINIGBM_HAS_GBM_BO_GET_MAP_INFO
Add depth buffer support for virtgpu virgl
Change-Id: I125c0b751f86b217a6ffbf7ec3fd2a1ddf848461
Bug: b:347022601
Test: Ran app that export/import depth through AHB with cf
Change-Id: I07e60729b18a9f15e0d795c33c462ba4b4f255b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5636740
Tested-by: Jean-François Thibert <jfthibert@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Commit-Queue: Jean-François Thibert <jfthibert@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Mark the availability of minigbm's newer gbm_bo_get_map_info() API.
Virglrenderer (and others) can test for its existence at build-time and
conditionally use it.
BUG=b:338254311
TEST=emerge minigbm
TEST=virglrenderer can conditionally build with gbm_bo_get_map_info()
Change-Id: I2685813fa99b73316477bef7edfd96e5dd9699a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5636516
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
On MTK, when we allocate MT2T surfaces for protected content, these are
sent in as P010 instead. However, P010 uses 16bpp where MT2T requires
only 10bpp. This adjusts the allocation sizes to only be what is needed
so we reduce memory usage by 5/8.
BUG=b:339091167
TEST=Netflix 4K 10-bit HEVC plays on Ciri
Change-Id: Ia34b7d3aa962f3138da130077d723748592023bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5582540
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Miguel Casas <mcasas@google.com>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Miguel Casas <mcasas@google.com>
* changes:
gralloc: Avoid using std::optional in shared memory metadata
gralloc: Move buffer metadata accessing into cros_gralloc_buffer
gralloc: Move buffer metadata initialization into common layer
FINALLY, the gbm.pc is autogenerated to respect the variables steering
the build.
BUG=b:338254311
TEST=mkdir -p build && OUT=build make && test -f build/gbm.pc && echo "ALL GOOD"
TEST=emerge minigbm
Change-Id: Ie1458bb46375be1357cbf4f0a8f59d698cbd6cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5513263
Commit-Queue: Ryan Neph <ryanneph@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>