Add the default set of test rules.
V2 test plans will be verified in staging before being enabled in prod.
See go/cros-cq-test-config for more details.
BUG=b:249150178
TEST=dirmd validate
Change-Id: I3fc9f5cd31f0f76537a21efb8d9f2efcb8ab4580
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3924812
Tested-by: Navil Perez <navil@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Andrew Lamb <andrewlamb@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Navil Perez <navil@google.com>
HAL_PIXEL_FORMAT_BLOB gets resolved into DRM_FORMAT_R8 with height of 1.
Avoid doing any vertical alignment for this case. Ideally we want a new
DRM_FORMAT_BLOB format.
BUG=b:255226937
TEST=atest CtsNNAPITestCases:GpuNnapiTest
Change-Id: Iea86481392b40c6c827f84323cb50450ddec03a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4035255
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Use blob buffers for encoder NV12 input, even when software access is
required. This is helpful for ARCVM, since the v4l2_codec2 stack
sometimes needs to do a format conversion in the guest as the
virtio-video encoder only supports NV12/I420 input.
Supporting this requires knowing the host buffer layout before creating
the blob resource. This is done by creating a temporary resource to
query the layout. To avoid the overhead of querying the host every time
a buffer is created, the allocator process keeps a cache of the most
recently used buffer formats and their host layout.
Creating temporary resources to discover host buffer parameters is a bit
of a cludge. However, since virtgpu_virgl will eventually be deprecated
in favor of virtgpu_cross_domain, a self-contained and simple approach
like this gives some nice performance gains on low end devices.
TEST=decode-edit-encode workflows
TEST=Cts{NativeHardware,Camera,Graphics,Video}TestCases on volteer
BUG=b:203380807, b:232531771
Change-Id: Ibda500862b42680ba898ba689e1600ebe5d258bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3256451
Auto-Submit: David Stevens <stevensd@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Format is no longer used when computing virgl bind flags, so drop the
parameter.
BUG=None
TEST=compiles
Change-Id: I7c0526584c442f981aa1b109c6b785a01d1e7ddf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4014226
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
To reserve the blame history, make it easier to extend and ensure the
lines don't get too lengthy in the future.
BUG=None
TEST=emerge-geralt minigbm
Change-Id: Id176ac4b113f61472c171874884d14037591c5e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3998335
Tested-by: Fei Shao <fshao@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
The drivers now require a loader with a working useInvalidate hook.
If not enabled then "createNewScreen2" call will fail in mesa-22.2.0 onwards.
BUG=b:245687387
TEST= screenshot --internal /tmp/test.png
tast run <IP> graphics.GLBench
Signed-off-by: Ikshwaku Chauhan <ikshwaku.chauhan@amd.corp-partner.google.com>
Change-Id: I0f7319fb7193be6ea938209413e8fbfe3b7f0c93
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3941506
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
1) Adding MTL PCI-IDs to minigbm
2) renamed gen variable to graphics_version to allign to driver naming
convention and to adapt to upcoming split ip versions for
display/graphics/media.
BUG=b:243459433, b:243685631
TEST=emerge-rex minigbm
Change-Id: I9859fadecf737532e8f1689c1531caccf31fe212
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3841636
Tested-by: Ashutosh Kumar <ashutosh1.kumar@intel.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Rajat Jain <rajatja@google.com>
This reverts commit 7a1a7dbda3.
BUG=b:243681772
TEST=confirm UBWC usage in arcvm
Cq-Depend: chromium:3900312
Change-Id: I126353bd91b75b7656257da00bc6fdf7d4c17060
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3900553
Reviewed-by: Chia-I Wu <olv@google.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Venus device memory mapping setup must succeed for AHB VkBuffer.
Meanwhile, the imported AHB can be allocated with only GPU_DATA_BUFFER
flag. So we must add mappable flag in virtgpu backends accordingly.
BUG=b:246814802
TEST=Blob_BlobTest_GpuDataBufferVertexBuffer_BLOB
Change-Id: I88f63c732d3b133daf755d73ed54578605d27112
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3896159
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Add BO_USE_TEXTURE to YUYV planes for Mediatek devices. This allows them
to be used as hardware overlays.
BUG=b:238137982
TEST=Tested on Asurada and Cherry
Change-Id: Ib0b6d91f64fe4e0af737594de976d5d5154e223d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3864630
Tested-by: Justin Green <greenjustin@google.com>
Commit-Queue: Justin Green <greenjustin@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
In recent kernel versions virtgpu reports support for the linear
modifier due to commit "drm: add support modifiers for drivers whose
planes only support linear layout" [1].
This causes the UI to when it calls gbm_bo_create_with_modifiers; it
hits an early return in drv_bo_create_with_modifiers due to the
virtgpu backend setting neither bo_create_with_modifiers nor
bo_compute_metadata.
Fix by adding a virgl_bo_create_with_modifiers modeled on
dumb_bo_create_with_modifiers. If the requested modifiers include
the linear modifier, pass the request on to virgl_bo_create.
Otherwise fail with EINVAL.
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8be576837b6e62b2ad0de2f9ba31cef618fa2891
BUG=b:243569755
TEST=Deploy minigbm to a reven-kernelnext VM
TEST=Restart UI, observe UI is no longer black
TEST=Logs don't show "Failed to create scanout buffer" errors
Change-Id: If8d02225a7a50600b5ae4685cc963ad391bd9bf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3862241
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Dominik Behr <dbehr@chromium.org>
Tested-by: Nicholas Bishop <nicholasbishop@google.com>
Auto-Submit: Nicholas Bishop <nicholasbishop@google.com>
Add YUY2 (DRM_FORMAT_YUYV) support for Mediatek platforms. Mediatek
devices support YUY2 hardware overlays, which we would like to exploit
to reduce video frame latency.
BUG=b:238137982
TEST=Tested with atomictest on Asurada
Change-Id: I42937956cb1017fea5f8997dd38d591a1b0b80b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3846866
Reviewed-by: Rob Clark <robdclark@chromium.org>
Tested-by: Justin Green <greenjustin@google.com>
Commit-Queue: Justin Green <greenjustin@google.com>
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>
No need to introduce host storage and mapping to the guest for buffers
that only have CPU access. Fixes slow performance of sw encoders.
BUG=b:238158981, b:239333100
TEST=cts-tradefed run cts -m CtsVideoTestCases -t android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Perf0320x0240
TEST=cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.RecordingTest#testSupportedVideoSizes[1]
Change-Id: Iaf88a750ae215d3a02b8415ab93be06b08a7f550
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3777563
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
This is required for modern Android atop a gralloc with the cross_domain
backend or other native backend.
BUG=b:238609372
TEST=build and AHB cts
Change-Id: Id963eeec62c4400cc009384e127c93588c99346e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3777566
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
With arcvm, virtgpu_cross_domain.c in the host remaps YVU420_ANDROID to
YVU420, to avoid exposing custom DRM_FORMAT_x values in the API between
the host and guest. Which means it expects identical behavior for both.
Fortunately, we can do this, provided that it is a single level+layer
(minigbm does not allocate anything more complex than non-mipmap 2D),
and not tiled/UBWC. The latter constraint we can get away with because
NV12 is used for anything produced by hw.
BUG=b:238158981
TEST=cts-tradefed run cts -m CtsVideoTestCases
Change-Id: If1330340f84835643be7cf8cae95026cbcebf273
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3774456
Auto-Submit: Rob Clark <robdclark@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Blob formats (aka buffers) get represented as R8 textures with height
of one and width==size. These actually 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.
BUG=b:239335026
TEST=cts-tradefed run cts -m CtsNNAPITestCases
Change-Id: I293f03b1c4292ed50252ea272f7d9e47e6c64ee2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3770014
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
It is used for AHBs that are SSBOs/UBOs. But I noticed this mainly
because venus's test allocation uses this as well when
VK_ANDROID_external_memory_android_hardware_buffer is enabled.
BUG=b:238663100
TEST=ANGLE
Change-Id: I72bdc73e1afdcb3f23667a77bc892e8402f25188
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3749168
Auto-Submit: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Like ADL-P, RPL-P is gen12 and has XE_LPD
PCI IDs from https://crrev.com/c/3654737
BUG=b:233114312
TEST=Protect playback works on RPL-P
'cat /sys/kernel/debug/dri/0/i915_gem_framebuffer' shows gen12
modifier
Change-Id: I5595d72a97fd5eb09080eea48ac4a3e3800747d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3726504
Commit-Queue: Juston Li <juston.li@intel.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: George D Sworo <george.d.sworo@intel.corp-partner.google.com>
Rename to reflect that ADL-P has the newer XE_LPD display IP that
required the height and stride adjustments.
RPL-P also has XE_LPD
BUG=b:233114312
TEST=sudo emerge-brya minigbm
Change-Id: I5f83a74d5332b4118fb841efd9200a6519e545e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3732651
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: George D Sworo <george.d.sworo@intel.corp-partner.google.com>
Commit-Queue: Juston Li <juston.li@intel.com>
It's better just to conditionally advertise cross domain capset
in crosvm.
This is to upstream aosp/2101455.
BUG=173630595
TEST=compile
Change-Id: Ic44176141cade44bfa0cc2fcf457ddafb7ae7195
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3707443
Reviewed-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
This is required for dma-buf sharing, which is a thing that can happen
for sharing across processes even if it is the same GPU device involved
on both ends. (Also, anything that gralloc allocates needs to be dmabuf
exportable, so not setting _USE_CROSS_DEVICE is just plain wrong.)
This fixes hangs in deqp-cts when using cross-domain virtgpu backend
(rather than the virgl backend)
BUG=b:230100768
TEST=Run deqp-cts
Change-Id: Ic9204feb0af52ef4a25bcfd554425cb8cd3f3fe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3696038
Tested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
... as the host may write to the buffer in a compute shader.
BUG=b:234513607
TEST=cts -m CtsNativeHardwareTestCases -t
android.hardware.nativehardware.cts.AHardwareBufferNativeTests#Blob_BlobTest_GpuDataBufferCpuRead_BLOB
Change-Id: Ied49e7861e9ae0cbc9e25ecfb7feec30cc733864
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3688450
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
crrev/c/3633249 compares libva and minigbm allocated Surfaces/BOs
for accelerated video decoding. Currently it fails on e.g. zork
because libva (mesa-amd backend) aligns those buffers to 256,
whereas minigbm aligns them to 512. This CL reduces the 512-align
provision in amdgpu to Android-originated buffers, where IIUC
from the bug there is such restriction.
BUG=b:200680176
BUG=b:171013552
TEST=vaapi_unittest on zork w/ crrev/c/3633249
Change-Id: I703037c70dded8596408c475518a29de3b59f039
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3647157
Tested-by: Miguel Casas-Sanchez <mcasas@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Commit-Queue: Miguel Casas-Sanchez <mcasas@chromium.org>
This is required for importing multi-plane modifiers where the
format plane count is lower (usually `1`). It will be used
by Exo for v3/4 of the `zwp_linux_dmabuf_v1` Wayland potocol,
allowing Wayland clients (and thus all clients that build on
the Wayland support) to use explicit modifiers which again
can increase performance on many GPUs.
Also add another fallback path to `dri_num_planes_from_modifier()`
for cases when `queryDmaBufFormatModifierAttribs()` fails and do
some refactoring there. Without this, some test apparently fail.
This includes the amdgpu part of
commit 1a733377e9, partially reverting
commit 853b8542fb.
Bug🅱️224580219
Change-Id: I93b64123420b39f3b83ff1bbbb9c59ddf4bc6105
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3568489
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Tested-by: Robert Mader <robert.mader@collabora.com>
Commit-Queue: Robert Mader <robert.mader@collabora.com>