Commit graph

303 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
5e001f8239 gbm_mesa: Change mapper name 2026-07-15 22:37:40 -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
Roman Stratiienko
446588514a minigbm: Add drv_bo_get_pixel_stride function
Some drivers may copy/convert the buffer during mapping and
in some cases stride of copied image can be different from
original. Android uses pixel_stride for CPU access and need
map_time stride instead of original stride in this cases.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2026-07-15 22:36:25 -04:00
Roman Stratiienko
37858e5143 minigbm: Add external driver support
Allow backends with custom DRM probing logic or
backends that does not rely on DRM (dma-heap, ION).

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I7bcaf10205ca051eb109d6e220b8a2af38267442
2026-07-15 22:36:25 -04:00
710cfdaae9 Drop DRM master after opening card node so the composer can master it
Change-Id: I6e40ed8fbfec788bc8f5382338d573057f230f79
2026-07-12 14:31:15 -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
Hirokazu Honda
c785301bd3 cros_gralloc: Map GRALLOC_USAGE_PROTECTED to BO_USE_PROTECTED on API 35+
Bug: 433330646
Test: allocate a buffer with GRALLOC_USAGE_PROTECTED usage
Flag: EXEMPT: desktop-only change
Change-Id: I9a47dbb13655b141bfeaa9820632428647e7419b
2025-07-21 21:57:03 -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
Yiwei Zhang
6af751e128 cros_gralloc: fallback to check ro.board.platform for SS VK
For bringup purpose, SS VK might be used to boot the system. To ease the
runtime vulkan icd switch, normally we preset TARGET_BOARD_PLATFORM to
pastel, so that to leave ro.hardware.vulkan unset post boot. At runtime,
we can push a real hw driver and set ro.hardware.vulkan to switch to it,
which can be safely reset after reboot.

Bug: b/417259528
Test: boot to ui with SS VK chosen by TARGET_BOARD_PLATFORM
Change-Id: I37212fadaf007c2c2d054b878f0a4f411f1a6fe8
2025-05-24 05:54:09 +00:00
Dominik Behr
1a29f8b3da cros_gralloc: AIDL fixes for pixelformats and getMetadata
- fix return values for getArmMetadata
- add some understanding of new AIDL pixelformats

Bug: b/388092228, b/397712115, b/377616165
Test: boot corsola with AIDL gralloc/stable c mapper
Flag: EXEMPT desktop-only

Change-Id: I66b2ec6af7227cfb4c92e9459aeeee00aaa14b8f
2025-04-21 16:47:40 -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
Andrew Wolfers
3dd534cca2 Add padding for i915 cursor buffers
This change adds behavior to pad the requested buffer size when the
BO_USE_CURSOR flag is set. This change is required due to restrictions
on cursor planes with the i915 driver, where a buffer must be of a
particular size in order to be committed to a cursor plane. The exact
requirements can be queried from the DRM_CAP_CURSOR_{WIDTH|HEIGHT}
properties, which if provided, will specify a known acceptable cursor
buffer size. After this change, if the BO_USE_CURSOR flag is set and the
requested size is less than indicated capability, the resulting buffer
will be padded according to the difference.

Bug: b/378461707 , b/388014686
Change-Id: I451421cc784d1e3fdc83eb4e9762d6f0f4caea7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6282179
Tested-by: Andrew Wolfers <aswolfers@chromium.org>
Reviewed-by: Lina Versace <linyaa@google.com>
Commit-Queue: Andrew Wolfers <aswolfers@chromium.org>
2025-03-12 12:21:51 -07:00
Jason Macnak
aac2a172e9 Revert "Revert "UPSTREAM: cros_gralloc: Avoid using masks in han..."
Revert submission 3309719-revert-3308804-MZCJYQCOVW

Reason for revert: initial cause of b/361574971 believed to be fixed with ag/29881064 and aosp/3309046 

Reverted changes: /q/submissionid:3309719-revert-3308804-MZCJYQCOVW

Change-Id: I60894baab0a773fdceb34601d8b05b54a6dd34f3
2024-10-16 19:19:47 +00:00
Jason Macnak
8956e04c7f Revert^2 "Merge remote-tracking branch 'aosp/upstream-main'"
8a3215bf53

Change-Id: I299a95b80910f102a652cbd577838ddfc65fdbc6
2024-10-16 19:19:47 +00:00
Jason Macnak
8a3215bf53 Revert "Merge remote-tracking branch 'aosp/upstream-main'"
Revert submission 3308804

Reason for revert: b/373667975

Reverted changes: /q/submissionid:3308804

Change-Id: Ieb4e87d2bdcd975f5aa231c8e05f1053963c6c6e
2024-10-15 20:15:13 +00:00
Jason Macnak
3068d2b441 Revert "UPSTREAM: cros_gralloc: Avoid using masks in handle_usage()"
Revert submission 3308804

Reason for revert: b/373667975

Reverted changes: /q/submissionid:3308804

Change-Id: I601a93f9a36c41327a703d4347ef6de63d4a8365
2024-10-15 20:15:13 +00:00
Jason Macnak
93e16b9029 cros_gralloc: Avoid using masks in handle_usage()
After https://crrev.com/c/5907583, handle_usage() tries to match
the entire value. An allocation with usage 0x100000203 from

  BufferUsage::GPU_RENDER_TARGET |
  BufferUsage::CPU_READ_OFTEN |
  BufferUsage::FRONT_BUFFER

would fail to match the combined BUFFER_USAGE_FRONT_RENDERING_MASK
(`1U << 28 | 1ULL << 32`) because the allocation only sets a
single usage bit `BUFFER_USAGE_FRONT_RENDERING` (`1ULL << 32`)
and not the combined mask.

Bug: b/373474508
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Change-Id: I926789a7aab937f2c2092475cb40ad9666b4f95f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5932803
Auto-Submit: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Ren-Pei Zeng <kamesan@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>
2024-10-15 16:19:58 +00:00
Jason Macnak
3b405c8fdf UPSTREAM: cros_gralloc: Avoid using masks in handle_usage()
After https://crrev.com/c/5907583, handle_usage() tries to match
the entire value. An allocation with usage 0x100000203 from

  BufferUsage::GPU_RENDER_TARGET |
  BufferUsage::CPU_READ_OFTEN |
  BufferUsage::FRONT_BUFFER

would fail to match the combined BUFFER_USAGE_FRONT_RENDERING_MASK
(`1U << 28 | 1ULL << 32`) because the allocation only sets a
single usage bit `BUFFER_USAGE_FRONT_RENDERING` (`1ULL << 32`)
and not the combined mask.

Bug: b/373474508
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Change-Id: I926789a7aab937f2c2092475cb40ad9666b4f95f
2024-10-14 16:39:48 -07:00
Jason Macnak
93d9ee4352 Merge remote-tracking branch 'aosp/upstream-main'
... to pull in https://crrev.com/c/5913519.

Bug: b/320202326
Bug: b/309244873
Test: CI
Change-Id: I353d0c39c44f600d6070a9796f4fd4b824f1848a
2024-10-11 12:30:00 -07:00
Ryan Neph
6d687b7b62 Revert "gralloc: Error when locking buffer alloc'd without CPU_ usage"
This reverts commit eb0e5fa310.

Reason for revert: fix ARCVM test regressions while investigating root cause (b/371862010).

Original change's description:
> gralloc: Error when locking buffer alloc'd without CPU_ usage
>
> ... 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
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5893718
> Reviewed-by: Ryan Neph <ryanneph@google.com>
> Reviewed-by: Juston Li <justonli@google.com>
> Tested-by: Ryan Neph <ryanneph@google.com>
> Tested-by: Juston Li <justonli@google.com>
> Commit-Queue: Ryan Neph <ryanneph@google.com>
> Commit-Queue: Jason Macnak <natsu@google.com>

Bug: b/371862010
Change-Id: Id16c3ae1989fec9d7cd71c24b9c6d55c3d29ae45
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5915946
Auto-Submit: Ryan Neph <ryanneph@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: ChromeOS Auto Retry <chromeos-auto-retry@chromeos-bot.iam.gserviceaccount.com>
2024-10-08 20:42:45 +00:00
Ren-Pei Zeng
d56aa1353a cros_gralloc: Fix gralloc -> gbm usage flag mapping
GRALLOC_USAGE_SW_READ_RARELY was incorrectly mapped to
BO_USE_SW_READ_OFTEN since GRALLOC_USAGE_SW_READ_OFTEN (== 3) contains
GRALLOC_USAGE_SW_READ_RARELY (== 2) in bit mask. Fix it by making the
flag check compare the full bit mask.

Same for the WRITE case.

BUG=None
TEST=CQ

Change-Id: I0c1e0e6f07978b6090472b2d470f5880ad231d0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5907583
Reviewed-by: Jason Macnak <natsu@google.com>
Tested-by: Ren-Pei Zeng <kamesan@chromium.org>
Commit-Queue: Ren-Pei Zeng <kamesan@chromium.org>
2024-10-04 17:09:07 +00:00
Jason Macnak
eb0e5fa310 gralloc: Error when locking buffer alloc'd without CPU_ usage
... 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
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5893718
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Juston Li <justonli@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Tested-by: Juston Li <justonli@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2024-09-26 21:08:07 +00:00
Ryan Neph
94e1bdc657 OWNERS: add ryanneph@google.com
Change-Id: If6006eb58e2068819eb7002af7c486fe0b84f168
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5894024
Commit-Queue: Jason Macnak <natsu@google.com>
Reviewed-by: Chia-I Wu <olv@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Auto-Submit: Ryan Neph <ryanneph@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
2024-09-26 18:58:25 +00:00
Treehugger Robot
22c6d554b2 Merge "Error when attempting to lock buffer alloc'd without CPU_ usage" into main 2024-09-25 22:09:14 +00: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
4cca6f67dd Error when attempting to lock buffer alloc'd without CPU_ usage
... 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
2024-08-02 08:18:36 -07:00
Jean-François Thibert
fd19358a25 Revert^2 "Merge upstream-main into main"
This reverts commit b7a9a2b7d5.

Reason for revert: Crash resolved by Ieb07b5bbc206f07f69e4afba921149f49d6fe8c4
Bug: 349870098

Change-Id: I49848f6e7311c1f44e6c988cb42107ed79da3a6b
2024-07-03 18:21:13 +00:00
Jason Macnak
b7a9a2b7d5 Revert "Merge upstream-main into main"
This reverts commit 018f7ff8fa.

Reason for revert: b/349870098

Change-Id: I942c713e4f7a24881b7ea3cff30df13a2b4a7c9c
2024-06-27 21:40:26 +00:00
Jean-Francois Thibert
018f7ff8fa Merge upstream-main into main
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
2024-06-26 13:21:44 -04:00
Jean-Francois Thibert
6158bc1fdc Add depth buffer support for virtgpu virgl
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>
2024-06-26 15:22:27 +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
Yiwei Zhang
8291bfe6f1 minigbm: format fix
BUG=n/a
TEST=./presubmit.sh

Change-Id: Ic581ebe770c648ee344cfbe20ba6655786a2088e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5505015
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Satoshi Niwa <niwa@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2024-05-01 08:09:45 +00:00
Roman Stratiienko
dd62167b6f cros_gralloc: Remove Android.bp files
Android.bp files are maintained in the AOSP fork repository.

Change-Id: I492e0c2154b22cd4cda85e379df2578b352c23df
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4961034
Commit-Queue: Jason Macnak <natsu@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
2024-03-13 00:34:56 +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
Jason Macnak
bca615781a gralloc: Sync with AOSP
Bug: b/321158178
Test: untested, AOSP already builds
Change-Id: I0f405f840baf3da755b39a3a3c1028ecbc0915c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5258793
Commit-Queue: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
2024-02-27 18:49:17 +00:00
Jooyung Han
9c5a81e4f1 Expose .rc/.xml for CF gralloc apex
Bug: 312358547
Test: allocator HAL service works from CF
Change-Id: I0d7a58b23af1150a98856be7ad4ffc1e1efb42b8
2024-02-06 16:13:00 +09:00
Jason Macnak
3a1e511437 gralloc: Avoid using std::optional in shared memory metadata
... to ensure the metadata is trivially copyable.

Bug: b/321158178
Test: vts -m VtsHalGraphicsAllocatorAidl_TargetTest
Test: vts -m VtsHalGraphicsMapperV4_0Target
Test: vts -m VtsHalGraphicsMapperStableC_TargetTest
Change-Id: Ib8cc1147692fa1e056108987339aff3e222ab0d7
2024-01-23 13:52:17 -08: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
John Reck
46f078c8b0 Support an additional option to initialize the dataspace
Test: atest AHardwareBufferTest#Allocate2WithExtras
Change-Id: Ic0620087c331beaf758c1fb56ae6b343a1b68345
2023-12-08 14:48:09 -05:00
Yiwei Zhang
118166a788 tiny format fixes
Also absorbs:
https://android-review.git.corp.google.com/c/platform/external/minigbm/+/2768266

BUG=n/a
TEST=./presubmit.sh

Change-Id: I7b781090762ed86b0d0c6c1736d0eeea6e2058ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4903262
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Dawn Han <dawnhan@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
2023-10-11 08:08:59 +00: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
fe5c2c0171 gralloc: Upstream AIDL allocator, stablec mapper, and sepolicy
... from various developments in AOSP.

Bug: b/225198076
Test: n/a
Change-Id: I65c340cfee4a3ad3c6545f365ca60249fd338a5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4897925
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:53 +00:00
Amit Pundir
21fc4f10c8 Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/main'
* aosp/upstream-main: (27 commits)
  minigbm: add some validation check in cros_gralloc
  minigbm: update format of mediatek.c
  Revert "i915: Vertical align video encode buffers to macroblock size"
  minigbm: drv: Fix MINIGBM_DEBUG usage on Android
  mediatek: Add BO_USE_PROTECTED use_flag for gpu and video decoder
  i915: Vertical align video encode buffers to macroblock size
  Don't print verbose messages by default
  virgl: Store format modifier in blob's bo meta
  Fix convertToFenceHandle()
  minigbm: update drv_get_os_option() to try getenv() first
  Update usage to 64-bit
  virtgpu_cross_domain: fix prop query for mt8183 camera quirk
  virtgpu_virgl: use blobs for ABGR8888
  minigbm: move camera work-around
  mediatek: Add BO_USE_PROTECTED use_flag to support secure buffer allocation
  i915: prefer tile4 for non-linear scanout buffers
  i915: allow linear mapping for P010 scanout
  minigbm: remove `close_gem_handle`
  mediatek: Exclude MT8173's FP16 and 10-bit ABGR support
  minigbm: Use clflushopt if supported
  ...

Change-Id: I38fb3f2c699205f73633e07d1824c4fd48dac5f5
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2023-07-21 10:11:44 +05:30