Commit graph

62 commits

Author SHA1 Message Date
Konsta
d500d5ee8d gbm_mesa: Add android makefiles and init/vintf fragments
* APEX is based on cuttlefish implementation [1].

[1]: https://android.googlesource.com/device/google/cuttlefish/+/refs/tags/android-16.0.0_r1/guest/hals/gralloc/
2026-07-15 22:37:40 -04:00
Yiwei Zhang
9f2c22f6e9 ANDROID: drop arcvm targets from blueprint
...since generic is the one to use going forward.

Bug: N/A
Test: presubmit
Change-Id: Idd427e4619ef44e126c6b8c245571df5cc02f1e5
2025-06-30 23:08:29 +00:00
Dominik Behr
035900982f remove mediatek suffix entries
Everything now builds under the same minigbm name for all platforms.

Bug: 388092228
Test: Boot corsola to desktop
Flag: EXEMPT: desktop-only change

Change-Id: I00708383151f832bcccec1aad8091f422dfcf2c3
2025-06-18 17:20:32 -07:00
Roman Kiryanov
ba24dd28c2 Move hwc3 to goldfish
goldfish-opengl will be retired

Bug: 416327221
Test: presubmit
Change-Id: Ie7250187d9604f9c6f9d368a513493dc72aa5c58
Signed-off-by: Roman Kiryanov <rkir@google.com>
2025-05-14 22:29:41 +00:00
Dominik Behr
89677c4474 mediatek: advertise support of protected buffers only
if the heap is available

Bug: b/406253026
Test: run android.graphics.cts.BitmapTest#testWrapHardwareBufferWithProtectedUsageFails
Flag: EXEMPT: desktop-only change
Change-Id: Ifbd1d75e63609e5e7c24e0ec6dce7aaba9f14b98
2025-04-14 16:34:23 -07:00
Dominik Behr
a1e715acd8 cros_gralloc: add support for mt8186
Add build changes for mt8186.
Add ARM metadata types: compression, plane fds and data type.
Add mediatek_drm.h which is not available.

Bug: 388092228
Test: boot corsola with minigbm gralloc/mapper

Change-Id: I1f1e8a57f37e26694320c3ddee01fbad453f854b
2025-03-27 19:25:18 -07:00
Andrew Wolfers
0c5b7a6dd0 Upgrade minigbm to 3dd534cca2
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update external/minigbm
For more info, check https://cs.android.com/android/platform/superproject/main/+/main:tools/external_updater/README.md

Bug: 378461707
Test: TreeHugger
Change-Id: Ia66fa770f9c0d8a3c7539602eaa324e7341163b8
2025-03-20 08:18:23 -07:00
John Stultz
c07a3f5090 Merge "cros_gralloc: move cflags select into minigbm_defaults build rule" into main am: fefcc1b9da
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3517291

Change-Id: Id93558ab8142bd5c4551a74fb04da999136588af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-03-20 01:24:11 -07:00
Yongqin Liu
d99636bb60 cros_gralloc: move cflags select into minigbm_defaults build rule
from the current libgbm build rule, so that one minigbm build rule
would work for all platforms based on the minigbm platform
soong config varible which is set in the device repository.

Test: boot to homescreen with both msm and generic minigbm
      allocator and mapper versions

Change-Id: I939730626eb478f699b1b099054446f25bb7289c
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Suggested-by: Jason Macnak <natsu@google.com>
2025-03-07 00:39:34 +08:00
Ram Muthiah
e38686f7b1 Revert "Add cuttlefish hwc3 to minigbm visibility"
Revert submission 31743741-CF changes for Android Display Processing

Reason for revert: Testing if this resolves b/398170080

Reverted changes: /q/submissionid:31743741-CF+changes+for+Android+Display+Processing

Change-Id: I54d1c6c2b0d09d492c56bbeb063aa97edc0d0013
2025-02-21 11:17:01 -08:00
Neeraj Kerkar
b9de1bfa82 Add cuttlefish hwc3 to minigbm visibility
Bug: 337330263
Test: Tested by ag/31743741
Change-Id: Idebdcce7df839c9fde4b6be5d48f3fb7d36a36c9
2025-02-21 01:42:31 -08:00
Ryan Neph
998c523bc1 ANDROID: build Xe backend into intel targets am: ad502fed04 am: df3b0d2f98
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3486572

Change-Id: I2166927f187d00b9f9e3d6a0c9ef9d9a6fa65e96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-10 18:13:16 -08:00
Ryan Neph
ad502fed04 ANDROID: build Xe backend into intel targets
Bug: 358427077
Test: CQ

Change-Id: I61bbfdd6665622c7a56c773e0c450e2fb54a4380
2025-02-10 15:41:17 -08:00
Marcell Kovacs
267582cec6 Merge "Add min_sdk_version: "34" to minigbm/libgbm" into main 2025-02-03 14:25:26 -08:00
Marcell Kovacs
18202bbd23 Add min_sdk_version: "34" to minigbm/libgbm
Bug: 349146763
Test: m -j
Change-Id: I13e3cf8c674fc3c2c402893efd7878eb99680e2d
2025-02-03 12:24:38 -08:00
Hang Nguyen
584eb0112d minigbm: Enable use in cros_codecs
Previous to this CL, cros_codecs caused a build failure in soong
with the following message:
error: system/cros-codecs/Android.bp:17:1: module "libcros_codecs"
variant "android_arm64_armv8-2a_cortex-a55_rlib_rlib-std": depends
on //external/minigbm:libgbm_sys which is not visible to this module
You may need to add "//system/cros-codecs" to its visibility

This CL updates libgbm_sys's visibility with cros_codecs.

Bug: 389780527
Test: Build cros_codecs with libgbm_sys as a depedency.
Change-Id: Id4538880193adfda55d755449d1984d83b0a6919
2025-01-30 19:24:55 +00:00
Ren-Pei Zeng
7133248700 Add minigbm helper to libgbm
Include minigbm extension functions in libgbm.

Bug: 362894809
Test: m libgbm
Change-Id: Ibbd00602d1e8cde5f3699b7d83ed4c294a19be8e
2024-09-05 17:12:52 +00:00
Ren-Pei Zeng
75370a9012 Add Soong config variable for libgbm build variants
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
2024-09-05 17:11:44 +00:00
James Farrell
3887cf47fb Migrate 25 crates to monorepo.
bytemuck_derive
hashlink
httparse
http-body
httpdate
idna
instant
intrusive-collections
itertools
jni-sys
lazy_static
libc
libloading
linked-hash-map
linkme
litrs
lock_api
log
lru-cache
lz4_flex
macaddr
managed
maybe-async
memchr
memoffset

Bug: 339424309
Test: treehugger
Change-Id: I6f6545eb832112d6fbf73f24b6632bdd13ae7121
2024-08-27 14:37:59 +00:00
Jason Macnak
24a395410e Merge changes Ib8cc1147,I33f17670,Ib00873ba into main
* 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
2024-05-15 15:50:39 +00:00
Marcin Radomski
65742c01dd minigbm: add bindgen-generated Rust bindings
This provides the bindings necessary to use the Rust gbm crate within
Android source tree. Bindgen flags used in the rust_bindgen definition,
as well as the workaround described in wrapper.h were based on upstream
gbm-sys crate's build.rs [1].

Looking at other rust_bindgen modules, they are generally defined
alongside the native module they provide bindings to.

Details: go/drm-gbm-rust-crates-for-android

[1] 606c4260e0/gbm-sys/build.rs (L78)

Bug: b/328181805
Test: lunch aosp_cf_x86_64_only_phone-trunk_staging-userdebug && m
Test: m libgbm_sys
Change-Id: I3065f7fe35f4a86b72ac90c34476da6304155daf
2024-03-18 18:48:46 +00:00
Jiyong Park
66c52b3f63 Merge "Link libdrm statically" into main 2024-03-13 00:01:23 +00:00
Marcin Radomski
b1dc373138 Merge remote-tracking branch 'cros/main'
To pull in https://crrev.com/c/5352370 and https://crrev.com/c/5352371.

Additionally, add backend_mock.c to Android.bp. It was added in
https://crrev.com/c/4923791, and drv.c uses symbols defined there
unconditionally.

The one merge conflict was an i915->is_media_compression_enabled assert
in i915_num_planes_from_modifier [1] that was removed upstream in
https://crrev.com/c/5118242. The assertion referenced a flag that was
set through an ENABLE_INTEL_MEDIA_COMPRESSION environment variable.
There are no references to that variable in AOSP sources.

[1] https://cs.android.com/android/platform/superproject/main/+/main:external/minigbm/i915.c;l=591;drc=350c09cf0fa662928e208eb6749a1f3ca34dac9f

Bug: b/328181805
Test: lunch aosp_cf_x86_64_only_phone-trunk_staging-userdebug
Test: m && cvd start && atest SurfaceFlinger_test
Change-Id: I8faba268580ad984af92a63c47366d6a69e8c9d0
2024-03-12 14:52:29 +00:00
Jiyong Park
e8329c44a1 Link libdrm statically
Bug: 326147655
Test: check the existence of libdrm.so
Change-Id: I950ffb24b4a72a5349d0842e498932c3557a2378
2024-03-11 15:49:58 +09:00
Jason Macnak
bd616875b5 gralloc: Move buffer metadata initialization into common layer
... to dedup and support upcoming change to metadata initialization.

Bug: b/321158178
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Test: vts -m VtsHalGraphicsMapperStableC_TargetTest
Change-Id: Ib00873babcb2ec8816b0d319e675d6884594f618
2024-01-23 13:52:14 -08:00
Jooyung Han
18f8874fde Merge "Add libminigbm_gralloc_headers" into main 2023-11-14 05:12:40 +00:00
Jooyung Han
31140885b6 Add libminigbm_gralloc_headers
hwcomposer3 (device/generic/goldfish-opengl) needs this for Android.bp
conversion.

Bug: 205619241
Test: build CF; launch; hwcomposer runs ok
Merged-In: I361358bc495270c85e00f61041e2eb4f172d8a6f
Change-Id: I361358bc495270c85e00f61041e2eb4f172d8a6f
2023-11-14 10:23:31 +09:00
Arve Hjønnevåg
de9f1c19bc Make minigbm vendor available
Needed to make crosvm vendor available

Bug: 309149829
Test: build aosp_cf_x86_64_phone_trusty_vm-userdebug
Change-Id: I1872e332d907035acd914d50919461ac59405b68
2023-11-13 23:31:20 +00:00
Jooyung Han
dffb72afb3 Add libminigbm_gralloc_headers
hwcomposer3 (device/generic/goldfish-opengl) needs this for Android.bp
conversion.

Bug: 205619241
Test: build CF; launch; hwcomposer runs ok
Change-Id: I361358bc495270c85e00f61041e2eb4f172d8a6f
2023-11-13 11:03:24 +09:00
Amit Pundir
33261816d3 android: libgbm: Add libcutils to shared libs
Otherwise upstream-main branch fail to link libgbm.so:

------------------------------
//external/minigbm:libgbm link libgbm.so
ld.lld: error: undefined symbol: property_get
>>> referenced by drv_helpers.c:625 (external/minigbm/drv_helpers.c:625)
>>>               out/soong/.intermediates/external/minigbm/libgbm/android_arm64_armv8-2a_kryo385_static/obj/external/minigbm/drv_helpers.o:(drv_get_os_option)
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
------------------------------

Change-Id: I7bde9a57b930d4f527ece27ade3c294490cebd3a
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2023-06-08 21:54:01 +05:30
John Stultz
82475270f4 minigbm: Add HAS_DMABUF_SYSTEM_HEAP to the msm build target
After commit db3c6fcf02 ("gralloc: Hide dmabuf heap allocator
behind of a flag") landed, db845c started seeing boot failures
and the following sepolicy denials in the logcat:

allocator@4.0-s: type=1400 audit(0.0:446): avc: denied { read write } for path=2F6D656D66643A7072696D6553686164657243616368655F64737420726573657276656420726567696F6E202864656C6574656429 dev="tmpfs" ino=1378 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:hal_graphics_allocator_default_tmpfs:s0 tclass=file permissive=0

It seems disabling the the libdmabufheap allocator and falling
back to memfd is causing sepolicy troulbe which blocks
allocations from working.

This patch adds -DHAS_DMABUF_SYSTEM_HEAP to the
libminigbm_gralloc_msm target, which resolves the issue.

However its not clear if this is the best solution, as I suspect
other devices (_meson, etc) may also need this fix.

Fixes: db3c6fcf02 ("gralloc: Hide dmabuf heap allocator behind of a flag")
Signed-off-by: John Stultz <jstultz@google.com>
Change-Id: Id93c431ac3a449fc7057bec8dff82356b0668153
2022-04-06 21:58:54 +00:00
Jason Macnak
9f0521cb06 gralloc: Enable dmabuf system heap for Cuttlefish
... to be used with https://crrev.com/c/3563512.

Bug: b/227375257
Test: cvd start
Test: vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: Iae4e8e2447a4f76ed4d261f7d8bf7287dec7a4d9
2022-03-31 23:37:29 +00:00
Jason Macnak
72c3089009 Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/master'
... to pull in support for `gralloc->set(<metadata>)` for Cuttlefish
from https://crrev.com/c/3421048 and the related changes in the chain.

Bug: b/219757060
Test: cvd start
Test: cts dEQP-VK.api.external.memory.android_hardware_buffer.*
Test: vts -m VtsHalGraphicsMapperV4_0Target

Test: cvd start --gpu_mode=gfxstream
Test: cts dEQP-VK.api.external.memory.android_hardware_buffer.*
Test: vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: I541d479da3b208c25666fcc50f89c790c361f1f6
2022-03-01 12:40:58 -08:00
John Stultz
bf308b3781 ANDROID: minigbm: msm: Enable QCOM_DISABLE_COMPRESSED_NV12 on the minigbm_msm build target
Currently upstream video video drivers don't support
QCOM_COMPRESSED drm modifier, so disable it on NV12 bufffers in
the build for now.

Submitted to AOSP, as upstream doesn't include the Android.bp files.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I86730572d0253455c76552c99d135e3246be6052
2021-12-02 04:20:44 +00:00
Satoshi Niwa
731b55a950 minigbm: Rename variant from "virgl" to "arcvm"
It's possible to switch its backend from virtgpu_virgl to another
one later. b/195673105#comment33

Bug: 195673105
Test: mma
Change-Id: I32396118fe20e220604ad36893e9a6c690e9fd4f
2021-11-05 06:24:26 +09:00
Satoshi Niwa
7658cd6a0e minigbm: Android.bp: Add virgl varient of gralloc.minigbm
Mostly copied from msm varients,
except for cflags:["-DVIRTIO_GPU_NEXT"]

Bug: 195673105
Test: mma
Change-Id: If5b1b46cbb248f26ec7720d012a679a902236707
2021-11-04 17:49:05 +09:00
Jason Macnak
42669faa70 Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/master'
... to update Minigbm for Cuttlefish to pull in https://crrev.com/c/3208931
to restrict 2D allocs to max supported SwiftShader size.

Bug: b/194426249
Test: `cts -m CtsNativeHardwareTestCases` with aosp/1845813
Change-Id: I9f538e48a72ec699617b9e653812f2b785c5e39a
2021-10-07 08:49:05 -07:00
Jason Macnak
e300b83aaa Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/master'
... to update Minigbm for Cuttlefish to pull in clean ups for
supported combinations and to pull in restricting 2D allocs to
max supported SwiftShader/llvmpipe size.

Bug: b/201325625
Bug: b/194426249
Test: launch_cvd --gpu_mode=guest_swiftshader
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I11c71b95987cedbb27515e85559e00c5df8c0dd9
2021-09-30 09:47:06 -07:00
Roman Stratiienko
0a3c16b677 minigbm: Wrap cros_gralloc code into shared library
In some cases both gralloc4 and gralloc0 mapper APIs may
be used by the single process.

For example gralloc4/mapper is always used for importing buffers
by the framework. Later those buffers may be accessed via gralloc0
API (by mesa3d for example).

Wrapping cros_gralloc code into a shared library ensures both frontends
will use a single cros_gralloc_driver instance, thus making such scenarios
possible.

Bug: 191895066

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I17f8f781eed42051fbfa9cf34b53346b1ec7a41b
2021-07-09 14:46:30 -07:00
Roman Stratiienko
a264847ff5 minigbm: Cleanup Android.bp
Goals:
1. Cleanup
2. Allow the declaration and configuration of targets outside the tree

Out-of-tree Android.bp example:
'''
cc_binary {
    name: "android.hardware.graphics.allocator@4.0-service.minigbm_vc4",
    init_rc: ["allocator.minigbm_vc4.rc"],
    defaults: ["minigbm_gralloc4_allocator_defaults"],
    cflags: ["-DDRV_VC4"],
}

cc_library_shared {
    name: "android.hardware.graphics.mapper@4.0-impl.minigbm_vc4",
    defaults: ["minigbm_gralloc4_common_defaults"],
    cflags: ["-DDRV_VC4"],

    srcs: [":minigbm_gralloc4_mapper_files"],
}
'''

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: Ia535814c361d3625aa7f31c79674ff1ad965e1c0
2021-06-23 18:43:02 +03:00
Treehugger Robot
59831098b8 Merge changes from topic "db845-minigbm-gralloc"
* changes:
  minigbm: Android.bp: Add msm varients of gralloc.minigbm and libminigbm_cros_gralloc
  minigbm: Andorid.bp: Use cc_defaults in defining libminigbm_cros_gralloc and users
2021-06-02 16:14:12 +00:00
Jason Macnak
cab396632e Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/master'
... to update Minigbm for Cuttlefish to pull in cross domain virtgpu
backend.

Bug: b/189133053
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Test: CtsGraphicsTestCases
Change-Id: I8ce1c8b0574bb0ccefc8fd119ffc9a6e410fa3dc
2021-05-26 10:24:18 -07:00
John Stultz
d5f571990c minigbm: Android.bp: Add msm varients of gralloc.minigbm and libminigbm_cros_gralloc
In order to support msm devices, we need to enable -DDRV_MSM
as a build flag for both gralloc.minigbm and libminigbm_cros_gralloc.

This unfortunately requires new _msm post-fixed targets for both
gralloc.minigbm and libminigbm_cros_gralloc as well as for
the allocator and mapper HALs.

This feels a bit messy, but seems to be the only way to only
build with -DDRV_MSM on msm devices.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ic43967bddd40bab4622f92faebb96e679a19891d
2021-04-27 21:11:04 +00:00
John Stultz
893f7f144a minigbm: Andorid.bp: Use cc_defaults in defining libminigbm_cros_gralloc and users
This splits out some cc_defaults for libminigbm_cros_gralloc and
users of that library. This is needed because the underlying
minigbm_defaults needs to be built with different cflags for
different hardware, so this change allows us to share the
default build values.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I2111c325d4a206b8889a9314a5204b34a38a1ee1
2021-04-27 21:11:04 +00:00
Bob Badour
bcc2498bb3 [LSC] Add LOCAL_LICENSE_KINDS to external/minigbm
Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  cros_gralloc/gralloc4/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp

Added SPDX-license-identifier-BSD
to:
  cros_gralloc/gralloc3/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Iff770232cbc5f95eb6b015587cd670d10ad616d5
2021-02-14 10:37:21 -08:00
Peter Collingbourne
956d50b00f Install gralloc.minigbm*.so to the hw subdirectory.
Otherwise the system will be unable to find it.

Bug: 178231152
Change-Id: I56f4bec918c706f248451377f8bbf56dc390f12e
2021-01-22 17:03:54 -08:00
Jiyong Park
a5864eb6c7 add crosvm to com.android.virt
To do so, crosvm and its dependencies have the apex_available property
set to "//apex_available:platform", "com.android.virt" to explicitly
acknowledge the joining.

Bug: 174639241
Test: m com.android.virt
Change-Id: I11f02fea20b81f070ce5fb245eebb70421bb4e0b
2020-12-14 16:03:39 +09:00
Jason Macnak
459cfe1128 Updates libgbm to use libdrm_headers
... as being able to use cc_library in header_libs is not
intended and does not work on all branches which blocks
aosp/1497292.

Bug: b/173252016
Bug: b/171019648
Test: m
Change-Id: Ia569aa47d28fb3e89e9315b44b6634b7f21fcf0e
2020-11-16 09:57:34 -08:00
Jason Macnak
21d6fa9f48 Update Android.bp after merge
Mostly to reflect changes in http://crrev.com/c/2429952

Bug: b/171019648
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I7c15919cb95b04d2dd6eb7c42b4d7d2da61cd75e
2020-10-28 13:27:52 -07:00
Jason Macnak
1e4aff7321 Adds Android.bp files back after merge.
I removed the Android.bp files from upstream as they seemed
to get out of sync quickly. Let's just keep them in Android
repos.

Bug: b/161909468
Test: launch_cvd
Merged-In: I27f020b4f661890bcc2817deb09ffb9af1c76f1b
Change-Id: Id5222980cc2e7c284a846259c808bf79cf5f2a75
2020-09-18 09:22:24 -07:00