Commit graph

4 commits

Author SHA1 Message Date
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
Kaiyi Li
4baf42e47c virtgpu: define capset ids as macros
... to avoid using magic numbers.

TEST=compile
BUG=b:322199104

Change-Id: I8522596f2cb2d0e9bdc381440c7e9ad3bbaa3165
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5246254
Tested-by: Kaiyi Li <kaiyili@google.com>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Auto-Submit: Kaiyi Li <kaiyili@google.com>
2024-01-31 01:44:11 +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