Commit graph

1716 commits

Author SHA1 Message Date
Jason Macnak
5e6c2647bb Revert "Revert "UPSTREAM: cros_gralloc: Avoid using masks in han..." am: aac2a172e9
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3312316

Change-Id: I1cbc7db44a74f3efbb2e51e4f9ce2b5aede97c5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-17 16:24:29 +00:00
Jason Macnak
4ea3c08e34 Revert^2 "Merge remote-tracking branch 'aosp/upstream-main'" am: 8956e04c7f
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3312315

Change-Id: I33a7adfe36ae51b3963c38d9f1f557a536ef0559
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-17 16:24:25 +00: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
0f824af7d8 Revert "Merge remote-tracking branch 'aosp/upstream-main'" am: 8a3215bf53
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3309719

Change-Id: I93826809532260b3bd9880b225c71c1186d3daa7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-15 22:30:57 +00:00
Jason Macnak
cd7a69560b Revert "UPSTREAM: cros_gralloc: Avoid using masks in handle_usage()" am: 3068d2b441
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3309718

Change-Id: Id0d97f43e607af90bc5a1b92610f25e865e42394
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-15 22:30:55 +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
41aab4f4ad UPSTREAM: cros_gralloc: Avoid using masks in handle_usage() am: 3b405c8fdf
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3308804

Change-Id: I283d573cbf995dcf976237e95a7abb5b5d646e88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-15 17:15:30 +00:00
Jason Macnak
893ec0c88f Merge remote-tracking branch 'aosp/upstream-main' am: 93d9ee4352
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3306122

Change-Id: I05caac510642564f1f14402665134256258bd467
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-10-15 17:15:26 +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
Grzegorz Jaszczyk
ccda09042a i915: allow DRM_FORMAT_YVU420_ANDROID for camera use
After this change is_supported() succeeds, USB camera starts
working and:

 E [minigbm:CrosGralloc4Allocator.cc(88)]: Unsupported combination -- pixel format: YV12, drm format:DRM_FOURCC_9997, usage: CPU_READ_NEVER | CPU_WRITE_NEVER | CPU_WRITE_RARELY | CPU_WRITE_OFTEN | GPU_TEXTURE | CAMERA_OUTPUT (0x20130)

issue is fixed.

Similar settings were already introduced for other backends e.g. msm:
https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3058396

BUG=b:323730914, b:309244873
Test: Verify that USB camera is working in Android environment

Change-Id: I29e0ec914ec8ba7c5b068fe22623efa30f0fb4f3
Reviewed-by: Michal Dubiel <dubielm@google.com>
Reviewed-by: Konrad Adamczyk <konrada@google.com>
Tested-by: Michal Dubiel <dubielm@google.com>
Tested-by: Konrad Adamczyk <konrada@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5913520
Tested-by: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Auto-Submit: Grzegorz Jaszczyk <jaszczyk@google.com>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
2024-10-10 22:08:10 +00:00
Grzegorz Jaszczyk
ff0509d723 mediatek: allow DRM_FORMAT_YVU420_ANDROID for camera use
After this change is_supported() succeeds, USB camera starts
working and:

 E [minigbm:CrosGralloc4Allocator.cc(88)]: Unsupported combination -- pixel format: YV12, drm format:DRM_FOURCC_9997, usage: CPU_READ_NEVER | CPU_WRITE_NEVER | CPU_WRITE_RARELY | CPU_WRITE_OFTEN | GPU_TEXTURE | CAMERA_OUTPUT (0x20130)

issue is fixed.

Similar settings were already introduced for other backends e.g. msm:
https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3058396

BUG=b:320202326, b:309244873
Test: Verify that external USB camera is working in Android environment

Change-Id: I7e1e328998ddf62ed127c001f054ed10c6fb6a02
Reviewed-by: Michal Dubiel <dubielm@google.com>
Reviewed-by: Konrad Adamczyk <konrada@google.com>
Tested-by: Konrad Adamczyk <konrada@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5913519
Auto-Submit: Grzegorz Jaszczyk <jaszczyk@google.com>
Tested-by: Grzegorz Jaszczyk <jaszczyk@google.com>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
2024-10-10 14:55:09 +00: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
25ad577bd6 Merge "Error when attempting to lock buffer alloc'd without CPU_ usage" into main am: 22c6d554b2
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3204926

Change-Id: I879c3a611615b888660af6cba272be908417bcc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-25 22:37:55 +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
Hang Nguyen
453a4c0dcf i915: Remove media compression support
This CL removes the support for media compression on ADL and MTL in
minigbm. The change includes removing the functionality to allocate the
modifier and compute the metadata for media compressed buffers from
minigbm.

BUG=b:365827638
TEST=Build chrome and deploy

Change-Id: I688b30ff08de4753e7491f6e29c688c2133fa27a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5873458
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Hang Nguyen <hnt@chromium.org>
Commit-Queue: Hang Nguyen <hnt@chromium.org>
Reviewed-by: Andres Calderon Jaramillo <andrescj@google.com>
Tested-by: Hang Nguyen <hnt@chromium.org>
2024-09-25 15:34:16 +00:00
Ryan Neph
2381df8295 virtgpu_cross_domain: fix planar size calculation
The last plane's size may include any padding bytes introduced by
virtgpu's page-alignment, but its not incorrect, and all other planes
will be exact.

BUG=b:365820897
TEST=Spot check new size calculation for YVU420_ANDROID allocation

Change-Id: I6e88905d7191dca7e68e5dfd773d2fcaac79773d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5849473
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Auto-Submit: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
2024-09-11 02:25:27 +00:00
Ryan Neph
05865d75bb virtgpu_cross_domain: force LINEAR for YVU420_ANDROID
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>
2024-09-10 22:59:26 +00:00
Treehugger Robot
81253f9dc1 Merge "Add minigbm helper to libgbm" into main am: a997cbf53a
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3255522

Change-Id: Id8ec6cf28371a52c1cc0921fc6d7d730c373b823
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 18:37:15 +00:00
Treehugger Robot
a997cbf53a Merge "Add minigbm helper to libgbm" into main 2024-09-05 18:26:46 +00:00
Treehugger Robot
e2f44a61ff Merge "Add Soong config variable for libgbm build variants" into main am: 5beb9a4475
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3255521

Change-Id: I027c95b7136eb3214f5e74d91536530d19c6d84d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 18:25:50 +00:00
Treehugger Robot
5beb9a4475 Merge "Add Soong config variable for libgbm build variants" into main 2024-09-05 18:12:08 +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
Chia-I Wu
e2fdd90122 dri: pass use_flags to dri_bo_create_with_modifiers
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>
2024-09-04 02:19:39 +00:00
Chia-I Wu
ac54d29297 dri: make dri_driver an opaque object
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>
2024-09-04 02:19:37 +00:00
Chia-I Wu
2743358812 dri: make dri_driver a proper object
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>
2024-09-04 02:19:34 +00:00
Tatsuyuki Ishi
a160cb46b1 minigbm: Update common.mk to unbreak gcc and bfd builds
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>
2024-09-03 12:44:03 +00:00
James Farrell
4fc25cc0af Migrate 25 crates to monorepo. am: 3887cf47fb
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3242977

Change-Id: I5c7e50e36795fbab9d3f06300e97ac72936dde67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 23:06:07 +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
Dorinda Bassey
a2a049d9f5 Initialize emulated_metadata fields to avoid uninitialized warnings
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>
2024-08-27 00:06:40 +00:00
Kiyoung Kim
9326e201ce Define vintf_fragments as modules am: 6210dc3d16
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3215537

Change-Id: Ied8b1cedad0f214c6ed62618ee0a463d1cba4535
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-22 02:47:07 +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
Devin Moore
33ee33bdf0 ANDROID: Move -fvisibility-inlines-hidden to CXXFLAGS only am: ca50f86101
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3207722

Change-Id: Ied2604611ce47e093e97e0d4f9245f371e7fc85e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 21:14:09 +00:00
Devin Moore
ca50f86101 ANDROID: Move -fvisibility-inlines-hidden to CXXFLAGS only
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
2024-08-05 22:43:46 +00:00
Jason Macnak
105245d6e3 Merge remote-tracking branch 'aosp/upstream-main' am: 197d810946
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3204910

Change-Id: I3812b7b1fc5dbc6a842e7a8dead63b895e623775
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-02 15:32:55 +00: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
Jason Macnak
197d810946 Merge remote-tracking branch 'aosp/upstream-main'
... 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
2024-08-01 09:20:50 -07:00
Jean-Francois Thibert
71ca6afaef Add format filtering for virgl gfxstream
Bug=b:352091996
Test=Ran CTS deqp test cases with cuttlefish

Change-Id: Ie6af00d39abfd19b8070b8df9349d05c80b324c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5722608
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Jean-François Thibert <jfthibert@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Tested-by: Jean-François Thibert <jfthibert@google.com>
2024-08-01 15:42:33 +00:00
Jason-jh Lin
661992dfdf mediatek: Allocate secure buffer by DMA_HEAP_IOCTL_ALLOC
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>
2024-07-17 19:41:57 +00:00
Fei Shao
cd5aef63a7 minigbm: mediatek: Pass ALLOC_SINGLE_PAGES for linear scanout buffer
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>
2024-07-15 13:32:51 +00:00
Fei Shao
c06a7dbe71 minigbm: mediatek: Integrate primitive BO use flag definitions
Move the primitive is_* boolean definitions for BO_USE_* flags to the
top of mediatek_bo_create_with_modifiers().

No functional changes.

BUG=b:352229429
TEST=emerge-geralt minigbm

Change-Id: Id1e9007d16bbf43bfb11af6f0376a18e1fc02cf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5706151
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
2024-07-15 10:38:19 +00:00
Fei Shao
41fb484c28 minigbm: mediatek: Update restricted flag name
Follow CL:5689125 and rename the flag.

BUG=b:352225473
TEST=emerge-geralt minigbm libdrm

Cq-Depend: chromium:5689125
Change-Id: I271d57e255a79af5b8e93ddb91186107dc8ec529
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5690587
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
2024-07-12 15:37:52 +00:00
Tatsuyuki Ishi
87c07170be minigbm: Update common.mk with symbolic and visibility flags
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>
2024-07-11 14:28:21 +00:00
Jean-François Thibert
92352d8240 Revert^2 "Merge upstream-main into main" am: fd19358a25
Original change: https://android-review.googlesource.com/c/platform/external/minigbm/+/3158699

Change-Id: I32fdd6fc8534b6a6bd564f99426ba71492951876
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-04 13:56:37 +00:00