Adds a new intel backend for interfacing with the Xe kernel driver.
Currently only tested on gen12 (Xe1; e.g. TGL, ADL, MTL).
Test 1: drm-tests (natively): stop ui and then run:
- mapped_texture_test
- null_platform_test -m [I915_FORMAT_MOD_X_TILED|I915_FORMAT_MOD_Y_TILED]
- plane_test (by default it uses NV12)
Test 2: full OS: boot to UI, execute webGL and/or YouTube successfully and watch
the terminal: TERM=xterm watch -n1 -d cat /sys/kernel/debug/dri/0/i915_display_info
for color formats and display plane usage
v1: Carlos Santa <carlos.santa@intel.corp-partner.google.com>
v2: Ryan Neph <ryanneph@google.com>
- formatting fixes
- remove deprecated #ifdef I915_SCANOUT_Y_TILED conditional compilation
- add missing backend_xe implementations
- mimic i915_add_combinations
- Match formatting, order of operations, and add the missing combo for
YVU420_ANDROID + USE_CAMERA_WRITE.
- In a future CL, we'll factor this into a common function called by both
backends.
- simplify xe_bo_map()
- The conditional body is always taken, so remove the conditional entirely.
- mark late-gen12 as mtl_or_newer until proper version handling is used.
BUG=b:358427077
TEST=drm-tests (see above)
Change-Id: I1eaa1dcce6cee706a421b3c4d6a532a6b83f8564
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245159
Tested-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
FINALLY, the gbm.pc is autogenerated to respect the variables steering
the build.
BUG=b:338254311
TEST=mkdir -p build && OUT=build make && test -f build/gbm.pc && echo "ALL GOOD"
TEST=emerge minigbm
Change-Id: Ie1458bb46375be1357cbf4f0a8f59d698cbd6cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5513263
Commit-Queue: Ryan Neph <ryanneph@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>
This is the first change to add unit tests for the public APIs in
minigbm.
Only tests 3 APIs here for now, and just added some very simple input
for each api testing.
The ultimate goal would be cover more APIs and the input combinations.
BUG=b:304380938
TEST=cros_workon_make --board=guybrush minigbm --test
TEST=cros_run_unit_tests --board guybrush --packages "minigbm"
TEST=CQ
Change-Id: Id15806b7bc6cd9c4764bf08becec6546d72bb117
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4923791
Commit-Queue: Dawn Han <dawnhan@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Dawn Han <dawnhan@google.com>
These are used when building minigbm for crosvm for unit and integration
tests. See: https://crrev.com/c/3141771
BUG=b:196059146
TEST=make CC_STATIC_LIBRARY(libminigbm.pie.a)
Change-Id: I819fcd2f3ec4969139825ffdc323e54e8b2eeab9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3141018
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Waffle does not support modifiers, detect it and fall back to linear
buffers. Fixes glmark2-waffle, glbench/windowmanagertest, etc.
BUG=b:158238296, b:153675943
TEST=run glmark2-waffle and verify it displays correct
TEST=run graphics.Sanity and verify that it passes
TEST=start ui and verify that it still picks UBWC modifier
Change-Id: I591136c8d07bd32beb6f4efa63971821193ce39e
Exempt-From-Owner-Approval: already CR+2 from owner
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2343173
Tested-by: Rob Clark <robdclark@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
The name of Amlogic DRM driver in kernel is "meson", so rename it in
minigbm to match that.
BUG=internal b/74248568
TEST=run ozone_demo on device
Change-Id: If2ef376715231f0b3c9fe320177d0e82d94214f0
Reviewed-on: https://chromium-review.googlesource.com/951912
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
Tested-by: Sergey Volk <servolk@chromium.org>
As per offline discussion, libdrm_intel doesn't maintain cache coherency
correctly for a number of edge cases.
The plan is to:
1) Revert the libdrm CL.
2) Use simpler mmap/unmap logic to deal CTS failures.
3) Use explicit flush to deal with coherency.
CQ-DEPEND=CL:454105
This reverts commit 82a8eedaa5.
Conflicts: i915.c
Change-Id: I6c0bf746b71ea08f5cf4f1aa80d17d28b26ec4c6
Reviewed-on: https://chromium-review.googlesource.com/454104
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
With cros_gralloc enabled, the following three CTS tests fail with an i915
backend:
EncodeVirtualDisplayWithCompositionTest#testRendering800x480Locally
EncodeVirtualDisplayWithCompositionTest#testRenderingMaxResolutionRemotely
EncodeVirtualDisplayWithCompositionTest#testVirtualDisplayRecycles
The reason for the failures is the bo_map() function calls
DRM_IOCTL_I915_GEM_MMAP_GTT with untiled buffers, leading to
Surface::dequeueBuffer not completing in time.
In addition, we never set the domain when we map, which can lead to
cache coherency issues.
libdrm already has functions for regular and GTT mapppings, so let's just
add it here rather than duplicating the logic.
TEST=Chrome boots and container boots
gbmtest, tiled_bo_test, all CTS tests specified in go/arc++gfx pass
BUG=chromium:616275
CQ-DEPEND=CL:424674
Change-Id: I68943367205abd3b470adb0597109fe30aa3e381
Reviewed-on: https://chromium-review.googlesource.com/424832
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
It has nothing to do with the preprocessor.
BUG=none
TEST=builds
Change-Id: Ib5c851b0127d36bf52cce1e5c81cfed0eb3b541d
Reviewed-on: https://chromium-review.googlesource.com/415112
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
On device with 32-bit userspace on 64-bit kernel we need to make
sure mmap64 is used to import buffer, or the call may fail because
of invalid offset.
BUG=None
TEST=Use libgbm to import drm_gralloc buffer on Elm.
Change-Id: I1b70d105e6f135d8fa534fb99cad266eed910ea9
Reviewed-on: https://chromium-review.googlesource.com/405147
Commit-Ready: Ricky Liang <jcliang@chromium.org>
Tested-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
We would like to reuse the same set of drivers for ChromeOS (with
a minigbm frontend) and Android (with a gralloc frontend). Since
we don't want to pollute the gbm API with gralloc formats and usages,
we can refactor minigbm on top a private API that will be a superset
of gbm and gralloc. This change redirects gbm calls to the
private API.
TEST=Ran graphics_Gbm on minnie and cyan, and checked if Chrome boots.
BUG=chromium:616275
CQ-DEPEND=CL:367791
Change-Id: I50d10f9d6c7ea936b0d76c5299a58d948939fdf9
Reviewed-on: https://chromium-review.googlesource.com/367780
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
The soname needs to match mesa exactly. The actual library is installed
as libminigbm.so.1.0.0 - this filename does not matter, and it is
probably better to be specific.
BUG=chromium:446653
TEST=chrome built against mesa boots with minigbm &
chrome built against minigbm boots with minigbm
Change-Id: Id031cc1eb63ab27df57ef9e0313994723e24987c
Reviewed-on: https://chromium-review.googlesource.com/244782
Reviewed-by: Haixia Shi <hshi@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
We don't want to use the misc. platform-specific libdrms, but we
still need the headers for the ioctl definitions and such. So let's
react to the GBM_* flags and use pkg-config to find the path to those
headers.
BUG=chromium:412508
TEST=emerge-daisy_freon minigbm
Change-Id: Ie8e1812fc0cebbc025d9c57a9032541c6a7e6da0
Reviewed-on: https://chromium-review.googlesource.com/219010
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Let's add pkg-config and install headers since this is needed for
ozone to build with a gbm platform.
BUG=chromium:394868,chromium:402597,chromium:413947,chromium:412508
TEST=emerge minigbm, then try pkg-config-board --libs --cflags. Rejoice that it works!
Change-Id: I94a26b1986db76e2d0dad638feda80ec10f48a9f
Reviewed-on: https://chromium-review.googlesource.com/218979
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Instead of overriding with our own, let's use the libdir passed down
from the ebuild.
BUG=none
TEST=emerge minigbm
Change-Id: Ic38fd538add6d4c85e502b9dc0feeabaa8378e2e
Reviewed-on: https://chromium-review.googlesource.com/218978
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Minigbm is a gbm implementation for a few DRM targets. Currently the
targets are:
- cirrus
- exynos
- gma500
- i915
- rockchip
- tegra
- udl
Right some targets are controlled with GBM_{TARGET} flags. I would
like to get to a place where we can just build all the targets in a
single library, but we need the drm headers for all targets for that
to happen so this needs more thinking.
BUG=chromium:394868,chromium:402597,chromium:413947,chromium:412508
TEST=unit tests, which I will need to import later
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I36ae07f2a59827a807e19e1432891ca196b28803
Reviewed-on: https://chromium-review.googlesource.com/218030