Commit graph

16 commits

Author SHA1 Message Date
Dominik Behr
60aa3a0304 add dma-heap.h to external
and use it instead of system headers

Bug: 411474910
Test: mm ccdec in system/cros-codecs
Change-Id: I7a58acaa610e1678a379a4c28886938075e39037
2025-05-09 14:05:18 -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
Carlos Santa
3ab89b0247 xe: add initial Xe kmd support for gen12 xelp
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>
2025-02-10 11:07:50 -08: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
Vipin Anand
97e07deac8 minigbm: Add tile4 support
Adding tile4 support for MTL.

BUG=b:243459433, b:243685631
TEST=emerge-rex minigbm

Change-Id: Ib66e121498b6eacc6038a6a4c392a76a104c5c2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3841638
Tested-by: Ashutosh Kumar <ashutosh1.kumar@intel.com>
Commit-Queue: Rajat Jain <rajatja@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
2022-10-22 01:10:05 +00:00
Jason Macnak
2119a9cefc virtgpu_virgl: update virgl_hw.h from upstream
... to pull in VIRGL_FORMAT_P010 for use with Gfxstream.

BUG=b:191084459
TEST=build

Change-Id: I7cf9d4ea54f5606e5582d1329dfb1467084a89d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3579856
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2022-04-13 03:21:23 +00:00
Juston Li
ef852e007c minigbm: update external i915 header
Update header and i915 implementation with upstream protected object
create_ext support

Header imported from this hash:
commit 7551b98ff03b2b9ed534dc3a071d00891b1abde2
Author: Zyta Szpak <zr@semihalf.com>
Date:   Thu Aug 19 17:30:06 2021 +0200

    FIXUP: sched: Fix dmesg warnings

Cq-Depend: chromium:3203921, chromium:3207105
Change-Id: I9ca8e010eaff9d18eb85366cdd37789001418f44
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3132929
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
2021-10-14 18:05:46 +00:00
Gurchetan Singh
4e767d3ae7 minigbm: virtgpu/cross_domain: update protocol
- Update to match latest CONTEXT_INIT proposal
- Update cross domain protocol to match crosvm
  (crrev.com/c/3055850) & Sommelier (crrev.com/c/3054321)

BUG=b:173630595
TEST=local testing with cross domain backend

Change-Id: I7420b03988bc8aed5b2bc53a0c54498a9ee47f86
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3119670
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Nicholas Verne <nverne@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
2021-08-26 22:31:17 +00:00
Gurchetan Singh
b2917b28c2 virtgpu_cross_domain: handle from guest memory
For PCI passthrough and other use cases, it's desirable to get the
render target out of the guest.  In the PCI passthrough case, the
dGPU's memory is not available to the host.

The solution that many people are interested in is to use virtgpu
to allocate, and use the dGPU to render to that guest memory.  This
change adds a flag to the existing blob api, indicating to the host
that it *must* create an OS-specific handle out of guest memory upon
success.

Obviously, this is just for prototyping.  Only when the lords and
princes of dri-devel/mesa-dev -- eyes filled with the light of
upstream, swords as cold as blue ice -- descend from their heavenly
abodes on top of Mount Gogigyeopbbang may we have a proper
solution.

But for now, we'll have to live in our downstream mud hut with yet
another hack.  Oh well!

BUG=b:173630595
TEST=create a bunch of udmabufs

Change-Id: Ia33dc0c415be61423017003d3739c4fb7498dba5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2857886
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2021-04-30 20:41:42 +00:00
Gurchetan Singh
73c141e48e minigbm: virtgpu/cross_domain: next generation virtgpu backend
This change provides a route to the host side "cross domain"
allocator, which is specialized for resource sharing across domain
boundaries.  It uses the upcoming CONTEXT_INIT ioctl to initialize
the backend when available, and multiple timelines to perform
metadata queries.

While it would be awesome to use the revolutionary Address Space
Graphics (ASG) algorithm for metadata queries, it would be
non-trivial to pull off in minigbm.

Key aspects of the cross-domain allocator are:

* Intelligently falls back to OpenGL texture allocation host-side
  when external memory is not available.  The fallback path is
  named "virgl", even though it encompasses gfxstream and 2D mode.
  More refactorings will be added in the future for further
  clarity.

* Uses host Vulkan or minigbm to perform metadata query, and uses
  a cache to minimize vmexits.

* No shadow memory.  Only zero-copy blobs will be supported if the
  blob is mappable.  Shareable blobs may be compressed or tiled if
  not mappable.

* A commitment to sharing code across Google projects and
  cross-platform GPU virtualization.

The main goal here is to enable faster interation/testing, so this
code is just a prototype.  It should be fine to merge via minigbm,
since the project has a very chill philosophy and even proudly
accepts code that doesn't make any sense (crrev.com/c/2583188)
[so long as existing users are not broken].

BUG=b:173630595
TEST=launch virtual machine with 2D mode
TEST=launch virtual machine with 3D mode

Change-Id: Ie33a46f19e5cdd82a2ac03bcf2351f4a8f294970
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2691716
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
2021-02-17 07:25:37 +00:00
Chia-I Wu
2e41f6332b virtgpu: update to new virtio_drm.h
This is an ABI-compatible change and the kernel gets exactly the same
ioctl number and args than before.

BUG=b:177238493
TEST=none

Change-Id: I5797164e48ffd634c1e5c07dd2e0875efa16f1e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2622849
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
2021-01-16 02:01:40 +00:00
Jeffrey Kardatzke
4ddd342334 minigbm: Update external i915 header
This updates it to keep it in sync with the latest i915 driver code in
the v5.4 kernel where protected buffer allocation is used.

BUG=b:153111783,b:155511259
TEST=Protected buffers work w/ latest kernel

Change-Id: I0a511371bf69d4009ddfa0f951c7d16ba6b2c8d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2585681
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2020-12-12 02:49:17 +00:00
Gurchetan Singh
f2bc3994e1 minigbm: i915: use experimental uapi
New proposed i915 features for testing purposes.

BUG=b:153111783,b:155511259
TEST=Protected playback works w/ associated Chrome OS changes

Change-Id: I67bb178794d827c85667bff2fb4500c69fe0a4e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459531
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-11-25 22:35:16 +00:00
Gurchetan Singh
13b0012204 minigbm: i915: use local i915 drm header
Taken from libdrm.  Mainly so we can have local header for
development purposes.

BUG=b:153111783,b:155511259
TEST=Protected playback works w/ associated Chrome OS changes

Change-Id: I947ab11d5fbc0c2b62dbaf8806e7897d2df79621
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459530
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-11-25 22:35:14 +00:00
Gurchetan Singh
0ee06fb622 minigbm: virtgpu: add resource create blob function
Some SW intensive apps could benefit from this.

This should decrease power consumption when playing a Youtube
1080p60fps video by 10%.

BUG=chromium:924405
TEST=mmap_test

Change-Id: I80bb08a95b7387eb8af58e1f0d30beb695fc3e74
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1804914
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-08-31 17:48:08 +00:00
Gurchetan Singh
9f3110b90f minigbm: virtgpu: add virgl_protocol.h, add external directory
This adds Mesa protocol headers for BLOB resources.  Also some
code movement.  See:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4821

for another example.

BUG=chromium:924405
TEST=compile

Change-Id: I330851e6a58d4e12be8e0e882a230a1cca83e7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1804828
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-08-27 22:22:11 +00:00