[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 0/5] Support virtio-gpu DRM native context
From: |
Dmitry Osipenko |
Subject: |
Re: [PATCH v4 0/5] Support virtio-gpu DRM native context |
Date: |
Sun, 12 Jan 2025 18:49:57 +0300 |
User-agent: |
Mozilla Thunderbird |
On 1/10/25 15:16, Alex Bennée wrote:
> Dmitry Osipenko <dmitry.osipenko@collabora.com> writes:
>
>> This patchset adds DRM native context support to VirtIO-GPU on Qemu.
>>
>> Contarary to Virgl and Venus contexts which mediate high level GFX APIs,
>> DRM native context [1] mediates lower level kernel driver UAPI, which
>> reflects in a less CPU overhead and less/simpler code needed to support it.
>> DRM context consists of a host and guest parts that have to be implemented
>> for each GPU driver. On a guest side, DRM context presents a virtual GPU as
>> a real/native host GPU device for GL/VK applications.
>>
>> [1] https://www.youtube.com/watch?v=9sFP_yddLLQ
>>
>> Today there are four known DRM native context drivers existing in a wild:
>>
>> - Freedreno (Qualcomm SoC GPUs), completely upstreamed
>> - AMDGPU, mostly merged into upstreams
>> - Intel (i915), merge requests are opened
>> - Asahi (Apple SoC GPUs), WIP status
>>
>>
>> # How to try out DRM context:
>>
>> 1. DRM context uses host blobs and requires latest developer version
>> of Linux kernel [2] that has necessary KVM fixes.
>>
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/
>>
>> 2. Use latest libvirglrenderer from upstream git/main for Freedreno
>> and AMDGPU native contexts. For Intel use patches [3].
>>
>> [3] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1384
>>
>
> Can we detect if virglrenderer has support at build time?
>
> [drm] pci: virtio-gpu-pci detected at 0000:00:02.0
> [drm] Host memory window: 0x8000000000 +0x100000000
> [drm] features: +virgl +edid +resource_blob +host_visible
> [drm] features: +context_init
> [drm] number of scanouts: 1
> [drm] number of cap sets: 2
> DRM native context support was not enabled in virglrenderer
> qemu: virgl could not be initialized: -1
> [drm:virtio_gpu_init] *ERROR* timed out waiting for cap set 0
>
> is a poor failure mode at runtime.
It's not possible to check at a build time whether virglrenderer is
built with DRM support, there are no flags for that. There is no
build-time dependency on DRM for Qemu, hence such flags were never
needed. You can rebuild virglrenderer with enabled DRM support,
rebuilding Qemu isn't needed in that case.
In general, it should be up to a package maintainer to enable required
virglrenderer features. It's more a Qemu's design problem that it can't
initialize virglrenderer earlier, before starting VM, IMO. Overall,
don't see a problem to address here.
--
Best regards,
Dmitry