This change modifies buffer allocation to include necessary padding
for buffers with the BO_USE_CURSOR flag. This behavior mirrors
identical logic in the i915 implementation.
Bug: b/417750580
Change-Id: I3358678fd194eff24fad2cb3749ca59bac33afb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6546486
Commit-Queue: Andrew Wolfers <aswolfers@chromium.org>
Tested-by: Andrew Wolfers <aswolfers@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
goldfish-opengl will be retired
Bug: 416327221
Test: presubmit
Change-Id: Ie7250187d9604f9c6f9d368a513493dc72aa5c58
Signed-off-by: Roman Kiryanov <rkir@google.com>
for all render/scanout formats and R8 and non YUV image source formats.
Bug: 414820115
Test: run dEQP-VK.image.swapchain_mutable.android.2d_array
Change-Id: I074f84b75f9096a77c9db90e66fcbd98672372ea
so that to avoid any residual init, vintf, libs, etc when switching
gralloc backends for incremental builds.
Bug: N/A
Test: toggle between gralloc version and m and check
Change-Id: I2c19aa115b584de938e2364e40a52c56c901adda
Android gralloc via AIDL allows use of AHB-backed external memory for
storage images with usage AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER; its
equivalents are VK_IMAGE_USAGE_STORAGE_BIT/BO_USE_GPU_DATA_BUFFER.
On older interfaces before gralloc 4.1/AIDL, BO_USE_GPU_DATA_BUFFER
is only allowed for BLOB formats; this adds it to combinations with
non-BLOB formats for the newer interfaces.
The image_storage_formats list is a subset of the formats being used
that support VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT which for anv is
power-of-two formats; here it ends up excluding the YCbCr formats.
Bug: 397763052
Test: dEQP-VK.wsi.android.[display_timing.*/ swapchain*]
Change-Id: I6b034790fa77f15fb341acfae4a45255231a5a14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6442090
Commit-Queue: Juston Li <justonli@google.com>
Commit-Queue: ChromeOS Auto Runner <chromeos-auto-runner@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Tested-by: Juston Li <justonli@google.com>
(cherry picked from commit db68fa51e4b7ed19546c80806da9f462c3b5c8d7)
RPL is the only Xe-supported board that was missing PCI ids that were
present in the i915 backend. Add them to Xe backend for parity.
Reformatted adlp_ids to match other arrays, no functional changes.
BUG=b:410014030
TEST=ChromeOS CQ
TEST=Android Presubmit
Change-Id: I2714133456893b59ade7572e5634716953b2bbd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6454754
Reviewed-by: Matt Turner <msturner@google.com>
Auto-Submit: Ryan Neph <ryanneph@google.com>
Commit-Queue: ChromeOS Auto Retry <chromeos-auto-retry@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Ryan Neph <ryanneph@google.com>
(cherry picked from commit 972cf6778f284cdf7350e0ab9492323ed4201ccf)
if the heap is available
Bug: b/406253026
Test: run android.graphics.cts.BitmapTest#testWrapHardwareBufferWithProtectedUsageFails
Flag: EXEMPT: desktop-only change
Change-Id: Ifbd1d75e63609e5e7c24e0ec6dce7aaba9f14b98
On Android, cros-codecs needs NV12 buffers that can be written to by the
CPU so that it can do MM21->NV12 de-tiling using libyuv. On Android, we
can't specify that we want NV12 buffers specifically using the gralloc
API. Instead, we ask for DRM_FORMAT_FLEX_YCbCr_420_888 and hope for the
best.
Before this CL, minigbm was returning YV12 buffers in this case on
corsola. This CL makes it so that on the mediatek backend,
DRM_FORMAT_FLEX_YCbCr_420_888 is always resolved to NV12 outside of
MT8173.
Bug: 408498122
Bug: 408503818
Test: adb -s $DUT shell codec -vpR /tmp/1080.mp4 on corsola
Test: vts-tradefed run vts --serial $DUT -m VtsHalMediaC2V1_0TargetVideoDecTest on corsola
Change-Id: Idbdba3434fdfdb0bf12aa7c92d1f9523e5870aba
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
Bring in from upstream:
* d30ea066 (crrev/c/6394316) intel_defines: Add ADL-N PCI ids
Get these earlier missed changes from upstream:
* 3dd534cc Add padding for i915 cursor buffers
* aec65367 virtgpu_cross_domain: Hold a lock for all of bo_create
Bug: 403278247
Test: CI
Change-Id: I0abfa7707032a4601dc456628b20a30ea498e8ea
To ease the desktop development, it's better to expand the existing
owners of minigbm. Unlike CrOS side, I'd like to keep the list minimal
so only introduce per-file for the hw backends under our control.
Bug: N/A
Test: build
Change-Id: I1f05842af9e35c669c28b9e45c443ff30c87d56e
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>
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>
In crosvm, the MinigbmDevice implementation of the Gralloc interface
assumes that a call to get_image_memory_requirements will be immediately
followed by a matching call to allocate_memory, as the implementation
stashes a buffer allocated by the first call to be returned by the
second.
However on Android multiple processes/threads can be making calls to
allocate memory via CrosGralloc. In particular if the device is
configured to use the cross-domain back-end, and two threads are trying
to allocate memory, the two requests to get the memory requirements for
an allocation can be submitted to crosvm followed by the two requests to
actually allocate memory.
When the assumption is violated, the crosvm code was raising an error
for the SECOND memory requirement request. However the error does not
propagate back to the virtgpu_cross_domain code here. The result is that
the request is understood to have succeeded, and the code here then
reads the size metadata from the response buffer, but that contains the
values from the FIRST memory requirement request. Those values may be
There is a fix for crosvm in review (https://crrev.com/c/6260975) to
not raise an error if the calls are not made in the expected order,
while still maintaining a single stashed buffer. However this means the
memory allocated for one of the two requests must be released, and would
have to be reallocated, at some extra runtime cost as allocating
graphics memory requires allocating physically contiguous memory.
The existing cross-domain code here acquired a simple mutex lock to
maintain a metadata cache, which was held for the duration of the first
call. This change extends the duration of the lock to the entire
allocation request so that the guest always makes the two requests in
the expected order.
BUG=b:395748805,b:355060470
TEST=ARCVM on Corsola starts up under high CPU stress
Change-Id: I6429ea28141ef440345a3eb442066173b3e04802
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6288246
Commit-Queue: Lloyd Pique <lpique@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Lloyd Pique <lpique@google.com>
This reverts commit a9ae53a8c4.
Reason for revert: I modified the wrong file. The correct CL is here aosp/3498986.
Change-Id: I669cb7b08725f3cb501dfa5311703746425771dc