[PATCH v4] tests/drm_virtgpu: Add functional coverage for core VirtIO-GPU ioctls
Dorinda Bassey
dbassey at redhat.com
Mon Jun 16 16:31:56 UTC 2025
Hi all,
Thank you Erico and Kamil for the reviews. very much appreciated.
BR,
Dorinda.
On Wed, Jun 11, 2025 at 7:05 PM Kamil Konieczny <
kamil.konieczny at linux.intel.com> wrote:
> Hi Erico,
> On 2025-06-11 at 18:10:52 +0200, Erico Nunes wrote:
> > Hello,
> >
> > On 6/10/25 6:30 PM, Dorinda Bassey wrote:
> > > This test suite adds coverage for multiple DRM ioctls specific
> > > to the VirtIO-GPU driver, verifying functionality such as
> > > resource creation, memory mapping, 3D transfers, context
> > > initialization, and parameter querying.
> > > Each test validates a key ioctl to ensure correct behavior from
> > > user space and backend implementations. Each subtest is
> > > self-contained and can be executed independently.
> > >
> > > Included subtests:
> > > - drm-virtgpu-map
> > > - drm-virtgpu-execbuffer
> > > - drm-virtgpu-resource-info
> > > - drm-virtgpu-3d-transfer-to-host
> > > - drm-virtgpu-3d-transfer-from-host
> > > - drm-virtgpu-3d-wait
> > > - drm-virtgpu-resource-create-blob
> > > - drm-virtgpu-get-caps
> > > - drm-virtgpu-context-init
> > > - drm-virtgpu-getparam
> > >
> > > How to Test with QEMU virtio-vga-gl or rustvmm vhost-device-gpu
> > >
> > > 1. Launch a QEMU guest with virtio-vga-gl
> > > ./build/qemu-system-x86_64 \
> > > -enable-kvm \
> > > -cpu host \
> > > -m 4096 \
> > > -machine q35 \
> > > -display gtk,gl=on \
> > > -vga none \
> > > -device virtio-vga-gl \
> > > -drive file=image.qcow2,format=qcow2 \
> > > -netdev user,id=n0,hostfwd=tcp::2222-:22 \
> > > -device virtio-net-pci,netdev=n0
> > >
> > > ssh into the guest and run the tests.
> > >
> > > 2. Start the vhost-device-gpu backend and Launch a QEMU
> > > guest with vhost-user-gpu-pci or vhost-user-vga, see guide on:
> > > https://crates.io/crates/vhost-device-gpu
> >
> > Overall this looks quite good to me. Thanks for doing this initial batch
> > of tests for virtio-gpu. I think it is a good start to build upon and
> > start enabling some more DRM tests in CIs especially since this can
> > astract hardware details.
> >
> > I have a couple of comments below, to consider if you will do another
> > respin:
> >
> >
> > >
> > > tests/drm_virtgpu.c | 425 ++++++++++++++++++++++++++++++++++++++++++++
> > > tests/meson.build | 1 +
> > > 2 files changed, 426 insertions(+)
> > > create mode 100644 tests/drm_virtgpu.c
> >
> > Would it make sense for this to live in its own subdirectory? Since it
> > is testing "device-specific" commands (for virtio-gpu being the device).
> > I see that some of the other drivers have their own directory, and
> > currently this one is bundled together with some fairly generic DRM or
> > KMS API tests in meson.build.
> > But I'm not sure if there is a policy for this so I'd leave it to the
> > igt maintainers.
> >
>
> Lets start with something simple, new folder could be created when
> there will be more virtgpu tests.
>
> > > +#define VIRTGPU_DEVICE "/dev/dri/card0"
> >
> > VIRTGPU_DEVICE is unused since an earlier revision, so it can be removed.
> >
>
> Thank you for spotting this.
>
> Regards,
> Kamil
>
> > > +static const struct {
> > > + const char *name;
> > > + uint64_t id;
> > > +} params[] = {
> > > + {"3D_FEATURES", VIRTGPU_PARAM_3D_FEATURES},
> > > + {"CAPSET_QUERY_FIX", VIRTGPU_PARAM_CAPSET_QUERY_FIX},
> > > + {"RESOURCE_BLOB", VIRTGPU_PARAM_RESOURCE_BLOB},
> > > + {"HOST_VISIBLE", VIRTGPU_PARAM_HOST_VISIBLE},
> > > + {"CROSS_DEVICE", VIRTGPU_PARAM_CROSS_DEVICE},
> > > + {"CONTEXT_INIT", VIRTGPU_PARAM_CONTEXT_INIT},
> > > + {"SUPPORTED_CAPSET_IDs", VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs},
> > > + {"EXPLICIT_DEBUG_NAME", VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME},
> > > +};
> >
> > Might make sense to move this params array to the "drm-virtgpu-getparam"
> > subtest since it is only used there.
> >
> > Considering these you can add my:
> > Reviewed-by: Erico Nunes <ernunes at redhat.com>
> >
> > Thanks
> >
> > Erico
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20250616/6fe0dcb3/attachment.htm>
More information about the igt-dev
mailing list