Commit graph

86 commits

Author SHA1 Message Date
cce8dc57df Add missing mediatek gralloc4 init .rc file
The gbm_mesa cherry-pick series added a mediatek gralloc@4.0 service
definition but the corresponding init .rc file was missing from the
aosp/android-16.0_r3 branch. Create it from the msm template.

Copyright (C) 2026 Brendan Szymanski <hello@bscubed.dev>
2026-07-15 22:46:56 -04:00
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
854a9186df gralloc: hide AIDL metadata for gralloc0-only build if requested
This is needed for ARC-R container targets using arc-cros-gralloc.

Meanwhile, bump -std=c++14 to -std=c++17 for std::optional and others.

Bug: b/433317686
Test: chromium CI + android CI
Change-Id: Id9ed5f27f6788ca63d0bdb9566c54b3cd4030e16
2025-09-10 15:40:18 -07: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
Treehugger Robot
7b8d54b37b Merge "UPSTREAM: presubmit: switch to cros format" into main 2025-06-25 17:07:06 -07:00
Mike Frysinger
bc47e98159 UPSTREAM: presubmit: switch to cros format
Rather than use `clang-format` from $PATH (which changes between devs),
use `cros format` which has a pinned version for all people.

Add *.cpp to the include list as not all C++ files use *.cc.

Then run format on the files to fix latent issues.

BUG=None
TEST=./presubmit.sh

Change-Id: I28e167d454a7b089bb79e932b7265fa87e4c331f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6475964
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>

Bug: None
Test: lunch brya-trunk_staging-userdebug && m libminigbm_gralloc
Change-Id: I23022dbb536ade53951fe61014c5056e114f4bbc
2025-06-24 17:37:57 -07: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
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
Kiyoung Kim
6210dc3d16 Define vintf_fragments as modules
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
2024-08-12 13:48:01 +09:00
Jason Macnak
92eb16bb24 gralloc: Move buffer metadata accessing into cros_gralloc_buffer
... to hide cros_gralloc_buffer_metadata from the AIDL/HIDL Apis.
No functional change expected.

Bug: b/321158178
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Test: vts -m VtsHalGraphicsMapperStableC_TargetTest
Change-Id: I33f17670a331385b0afe0e179cab8985b7fe78b9
2024-01-23 13:52:17 -08: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
Jason Macnak
6bd32d9cbf Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/main'
... to pull in https://crrev.com/c/4897926.

Bug: b/300616292
Bug: b/300194143
Bug: b/294661992
Test: launch Cuttlefish, run SurfaceFlinger_test, inspect
      tracing around lifetime of cros_gralloc_driver
Change-Id: I72c9164c2194af87bab0800fd821b4bc0934f245
2023-09-28 10:31:23 -07:00
Jason Macnak
1f9a351e4f gralloc: Use std::shared_ptr for cros_gralloc_driver
... to ensure the lifetime of the underlying cros_gralloc_driver
matches those of the various Mapper* interfaces. Without this, the
the destruction of the static cros_gralloc_driver `s_instance`
could race with a potential CrosGralloc4Mapper user on another
thread which is still alive at the time of exit() (for example,
a buffer being cleaned up on a libhwbinder worker thread).

Bug: b/300616292
Bug: b/300194143
Bug: b/294661992
Test: launch Cuttlefish, run SurfaceFlinger_test, inspect
      tracing around lifetime of cros_gralloc_driver
Change-Id: Id8e2dbff471c03f7b663952524905a06cc03fbc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4897926
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2023-09-28 17:11:55 +00:00
Jason Macnak
3957b416fa Fix convertToFenceHandle()
... to not return address to a local stack variable.

Noticed by dustingreen@

Bug: b/287536665
Test: cvd start && vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: Iba486270a7ae3f8fbe50b41e3ea4c32aa0c4acad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4615434
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2023-06-16 20:31:01 +00:00
Jason Macnak
966d073388 UPSTREAM: cros_gralloc: fix convertToFenceHandle()
... to not return address to local stack variable.

Upstream review: https://crrev.com/c/4615434

Bug: b/287536665
Test: cvd start && vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: I1f8b5e12fc77fb30bfca8dbf712efa925f45f537
2023-06-16 09:35:00 -07:00
Yiwei Zhang
49756130de Merge remote-tracking branch 'cros/main' into 'aosp/master'
Bug: 158617858
Bug: 174146421
Bug: 269565421
Test: CtsNNAPITestCases and CtsCameraTestCases
Change-Id: Ifca6fd0c2dcfcfc3426441f13cd04b8ba02b21ac
2023-02-20 22:59:22 +00:00
Dawn Han
d77e164105 minigbm: Relax the validateBufferSize check
Blob formats (aka buffers) get represented as R8 textures with height
of one and width==size. These have no particular stride requirement,
even though the host might ask for a pitch that would make sense for
a 2D R8 texture with height greater than one.

Relax the validateBufferSize check for format_blob rather than set the
stride. As blob defined: buffers of this format must have a height of
1, so height doesn't need to be checked specifically.

BUG=b:269565421
TEST=CQ

Change-Id: I7a8d4dbf292330df0c24b502abd9dbf3dceac728
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4263402
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
2023-02-20 04:00:05 +00:00
Yiwei Zhang
4f31804e58 Merge remote-tracking branch 'cros/main' into 'aosp/master'
Bug: 262920670
Bug: 262928949
Test: cts
Change-Id: I63e534134c5eaffebcdd74e04bb9ede4b8c5f7f7
2022-12-18 08:13:50 +00:00
John Reck
d6fbcaac65 Add CROP to listSupportedMetadataTypes
The getter already worked, it just wasn't listed as such.

Also drop claiming SMPTE2094_40 support on IMapper5, since
it's always a no-op and only conceptually makes sense
if the setter exists (wording on the spec will be changed
to reflect this)

Test: atest VtsHalGraphicsMapperStableC_TargetTest
Change-Id: I4ee93927edc11fda6bd3983caaabf8b281c080ab
2022-12-15 16:00:17 -05:00
Jason Macnak
399fa8b592 gralloc: Remove release_fence arg from cros_gralloc_driver::flush()
... to match downstream aosp/2279448.

BUG=b:259311835
TEST=presubmit

Change-Id: I696998e627abb0d88b83d55f8fb335df3dd7576c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4073504
Commit-Queue: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
2022-12-02 17:43:11 +00:00
John Reck
aefe9340f4 Initial implementation of IMapper 5
Test: atest VtsHalGraphicsMapperStableC_TargetTest
Change-Id: I7fd047e3b53fbf659595baa9f34eb1b979ef1f89
Merged-In: I7fd047e3b53fbf659595baa9f34eb1b979ef1f89
2022-12-01 17:38:35 +00:00
Yiwei Zhang
a11fc6dcd0 Merge remote-tracking branch 'cros/main' into 'aosp/master'
Bug: 246814802
Test: Blob_BlobTest_GpuDataBufferVertexBuffer_BLOB
Change-Id: Id33aa12d2684218f2a38eaaee55bb2c456ee6602
2022-09-15 19:03:32 +00:00
Yiwei Zhang
a07201ce2e gralloc4: fix plane layout mapping for DRM_FORMAT_YVU420
In fact, the resolved format is always DRM_FORMAT_YVU420_ANDROID at
gralloc frontend upon metadata query.

DRM_FORMAT_YVU420 is only returned upon filling fourcc in native handle.

Do the fix anyway for sanity and prepare for later code cleanup.

TEST=build

Change-Id: I4c9a96d317bb458cf715364f68f1a0daead1a077
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3789650
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
2022-07-28 21:31:05 +00:00
Yiwei Zhang
abc4860dcc Merge remote-tracking branch 'cros/main' into 'aosp/master' am: 9c34d76be0
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/2164289

Change-Id: I27b37026c2685b77c60f4a1cec3fb6eb81fc3d83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-25 21:13:32 +00:00
Yiwei Zhang
9c34d76be0 Merge remote-tracking branch 'cros/main' into 'aosp/master'
Test: build
Change-Id: I281daffb82b7e959cadd1073b15b45f8f0ec7722
2022-07-25 18:32:51 +00:00
Yiwei Zhang
bfb3c781a4 gralloc: use ALOGE instead of drv_log
TEST=build

Change-Id: I78b123f395fef8853f310a567ac0341b6958c535
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3761445
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
2022-07-15 06:50:52 +00:00
Jason Macnak
d358e6b84a Merge branch 'aosp/upstream-main' into 'aosp/main' am: dffef56827 am: 67f75e1c74 am: 720b1f1cae
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/2052055

Change-Id: Ia0a6ca586fbdf3693041d3217909788ead909df2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 19:40:38 +00:00
Jason Macnak
dffef56827 Merge branch 'aosp/upstream-main' into 'aosp/main'
... to pull in https://crrev.com/c/3563512 to avoid trying to use
dmabuf heap allocator when dmabuf system heap is not available.

Bug: b/227375257
Test: cvd start
Test: vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: I2de7d0b8e6a898fa34333ade9204929342268659
2022-04-01 09:58:38 -07:00
Ryo Hashimoto
860fbc8f83 Revert "gralloc: Use libminigbm_gralloc4_utils in allocator4/mapper4"
This reverts commit 5e26e6df86.

Reason for revert: b/225254942

Change-Id: I219e87de627fd00092ab9f66dc6cacb1a34b01bb
2022-03-18 09:33:05 +00:00
Jason Macnak
4674c0ea74 gralloc: Avoid setting out handle before allocate finishes
... otherwise a buffer would be leaked if `mDriver->allocate()`
succeeds but `initializeMetadata()` fails as the error handling
in the multi-buffer `CrosGralloc4Allocate::allocate()` would
fail to `mDriver->release();`.

BUG=b:219757060
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I375da2c959dd9df2667503a040ed1dcbd2aa12b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3501132
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-03-18 06:50:05 +00:00
Jason Macnak
5e26e6df86 gralloc: Use libminigbm_gralloc4_utils in allocator4/mapper4
... and also alphabetize.

Bug: b/223410512
Test: cvd start
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Test: cvd start --gpu_mode=gfxstream
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: I5ce5d93e137f37b326bd428f53288d8fb5478651
2022-03-16 14:01:16 -07:00
Jason Macnak
3b5bd44f32 gralloc: Add libminigbm_gralloc4_utils
... to support upcoming refactoring.

Bug: b/223410512
Test: presubmit
Change-Id: I66795dc0ddb69edeb80cfd4ff6dbb4fec78d8424
2022-03-16 14:01:16 -07:00
Lev Rumyantsev
95b765d807 Revert "gralloc: Adds Minigbm AIDL allocator"
Revert submission 17143242-cherrypick-minigbm-allocator-aidl-twsnybob5q

Reason for revert: b/224637687
Reverted Changes:
Iaf309fcbd:Add Minigbm Gralloc AIDL allocator
Idd114498c:gralloc: Adds Minigbm AIDL allocator

Change-Id: Ia8002ec629a16286e9efcca3cb8fb5a105dd86e5
2022-03-15 20:18:54 +00:00
Jason Macnak
7d0aa67904 gralloc: Adds Minigbm AIDL allocator
The switch from HIDL to AIDL does not introduce any new interface
methods.

Bug: b/223410512
Test: cvd start
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Test: cvd start --gpu_mode=gfxstream
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Change-Id: Idd114498c79bd48502e370c6144d8f08693e3781
2022-03-10 14:42:35 -08: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
Jason Macnak
0e9bd65933 gralloc: Move buffer name out of cros_gralloc_handle
... and into CrosGralloc4Metadata to simplify handle
creation by avoiding variable sized handles.

BUG=b:207388558
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target
TEST=cvd start --gpu_mode=gfxstream
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I2d5e37beef8b9ba6bfbd06d79131b381d3ff73da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3433595
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-02-17 07:05:56 +00:00
Jason Macnak
b4eb84da28 gralloc: Support gralloc->set(<metadata>)
... by reserving the first section in the shared memory
reserved region for a new CrosGralloc4Metadata struct.

BUG=b:207388558
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target
TEST=cvd start --gpu_mode=gfxstream
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I7c59196ca747dc0fe854cdb4cbbcd21dd82e1401
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3421048
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-02-17 07:05:56 +00:00
Jason Macnak
d6d2fc5530 gralloc: Replace for-each-handle ​with for-each-buffer
... to support upcoming change where CrosGralloc4Mapper's
get(<metadata>) will want to access metadata that may be
in either the buffer's handle or the buffer's reserved
region. The for-each-[handle|buffer] methods support
dumpBuffers() where we need to iterate over all of the
buffers while holding a lock on the cros_gralloc_driver's
mutex.

BUG=b:207388558
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target
TEST=cvd start --gpu_mode=gfxstream
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I674cab487d7446af722f94d796f504cf4f97de27
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3433121
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-02-17 07:05:55 +00:00
Jason Macnak
6235f17371 gralloc: cros_gralloc_buffer always owns a cros_gralloc_handle
... to make it easier handle ownership (no more conditional
ownership if the buffer was allocated versus imported).

This also helps avoid a deadlock in CrosGralloc4Mapper's
dumpBuffers() in an upcoming change where CrosGralloc4Mapper
wants to interact with both metadata in the handle and
metadata in the cros_gralloc_buffer's reserved region. By
having the cros_gralloc_buffer always have a handle, the
CrosGralloc4Mapper can have access to all metadata when it
has a cros_gralloc_buffer parameter.

BUG=b:207388558
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target
TEST=cvd start --gpu_mode=gfxstream
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I56fffbbfacf8436db165a961bec8ce546b4acc6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3433118
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-02-17 07:05:52 +00:00
Zhang Bo
7e669ca947 gralloc:fix incorrect plane layout of DRM_FORMAT_XBGR8888
The format DRM_FORMAT_XBGR8888 playe layout should be aligned with linux DRM
driver definition.

Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
Change-Id: I8f8b025a99a7503eb27eda96bcbdf3373b011a8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3414504
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-01-27 01:40:38 +00:00
John Stultz
db90701156 minigbm: Merge remote-tracking branch 'aosp/upstream-main' into HEAD
Update minigbm in AOSP

* aosp/upstream-main:
  minigbm: msm: Allow for build-time method to disable DRM_FORMAT_MOD_QCOM_COMPRESSED on NV12
  dumb_driver: should be rgb565
  minigbm: Support bo_create_with_modifiers in the dumb driver
  gralloc: Fix plane layout for RGB565
  gralloc: Add comment about HAL_PIXEL_FORMAT_RGB_565 component order
  gralloc: Fix a HAL_PIXEL_FORMAT to DRM_FORMAT mapping
  i915: prevent pre-gen9 from using tile modifiers with AR24
  minigbm: Remove stride alignment to power of two on ADL-P
  minigbm_helper: close the opened dir
  amdgpu: Use bo_release to free DRI images.
  drv: Add new bo_release driver callback.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I4404c8d2e6d7e4de37c89e08a6e0e43c9cf9cc03
2021-12-02 04:08:17 +00:00
Jason Macnak
f48d8bc6ca gralloc: Fix plane layout for RGB565
BUG=n/a
TEST=n/a

Change-Id: Id3254d66a83460618e994ab54673c51d56d00aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3291697
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2021-11-30 04:04:16 +00:00
Jason Macnak
547f29cb2f gralloc: Fix a HAL_PIXEL_FORMAT to DRM_FORMAT mapping
DRM and pixel formats have the order flipped.

HAL_PIXEL_FORMAT_RGB_888 -> DRM_FORMAT_BGR888

BUG=b:191096118
TEST=CtsNativeHardwareTestCases on Cuttlefish

Change-Id: I88315730075b6289463963a9c9071bd4f089447e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3291554
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2021-11-23 19:09:48 +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
Yiwei Zhang
b7a64441ef minigbm: refactor driver helpers
1. frontends access the driver via drv.h only
2. the renamed drv_helpers and drv_array_helpers are for driver only
3. remove extern "C" from drv_helpers.h given not exposed to gralloc
4. remove all redundant includes for those helpers

BUG=b:199524294
TEST=CQ and gralloc builds on aosp

Change-Id: I3f4d33076a6a8161804f1b7c26950ff5496507e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3195651
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2021-10-01 18:35:11 +00: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
Yiwei Zhang
b73dd1deac gralloc: add cros_gralloc_convert_map_usage
This is to unify map usage conversion for gralloc frontends.

BUG=b:199524294
TEST=build

Change-Id: I488213ca889a98f39a86e0340a315052cb8f624f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3171104
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2021-09-23 02:18:18 +00:00
Yiwei Zhang
6aad135952 gralloc: unify gralloc frontends to use cros_gralloc_convert_format
Reordered the cases to align with actual enum value for the hal formats,
and added 3 more formats support to align with gralloc4 support:
1. Y8
2. Y16
3. YCBCR_P010

BUG=b:199524294
TEST=CtsNativeHardwareTestCases
TEST=gralloc4 builds in aosp

Change-Id: I7a6743524c024d46ab2a7a6d973f431ea2721c49
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3160131
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2021-09-18 04:51:54 +00:00