freedreno/drm: Add virtio backend

Add a new backend to enable using native driver in a VM guest, via a new
virtgpu context type which (indirectly) makes host kernel interface
available in guest and handles the details of mapping buffers to guest,
etc.

Note that fence-fd's are currently a bit awkward, in that they get
signaled by the guest kernel driver (drm/virtio) once virglrenderer in
the host has processed the execbuf, not when host kernel has signaled
the submit fence.  For passing buffers to the host (virtio-wl) the egl
context in virglrenderer is used to create a fence on the host side.
But use of out-fence-fd's in guest could have slightly unexpected
results.  For this reason we limit all submitqueues to default priority
(so they cannot be preepmted by host egl context).  AFAICT virgl and
venus have a similar problem, which will eventually be solveable once we
have RESOURCE_CREATE_SYNC.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
This commit is contained in:
Rob Clark
2022-02-02 10:56:26 -08:00
committed by Marge Bot
parent 2200d674e4
commit 802f4da5ee
17 changed files with 1852 additions and 6 deletions

View File

@@ -201,6 +201,12 @@ option(
value : false,
description : 'use kgsl backend for freedreno vulkan driver',
)
option(
'freedreno-virtio',
type : 'boolean',
value : false,
description : 'use experimental virtio backend for freedreno (currently only gallium driver)',
)
option(
'imagination-srv',
type : 'boolean',