[PATCH v2 1/2] drm/virtio: Defer the host dumb buffer creation
Gerd Hoffmann
kraxel at redhat.com
Wed Sep 11 09:49:15 UTC 2024
Hi,
> > +static int virtio_gpu_deferred_create(struct virtio_gpu_object *bo,
> > + struct virtio_gpu_device *vgdev,
> > + const struct drm_mode_fb_cmd2 *mode_cmd)
> > +{
> > + struct virtio_gpu_object_params params = { 0 };
> > +
> > + params.format = virtio_gpu_translate_format(mode_cmd->pixel_format);
> > + params.dumb = true;
> > - params.format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888);
>
> This will break the guest blob code path in virtio_gpu_object_create(),
> AFAICT.
Good point.
> > + } else if (params->dumb) {
> > + /* Create the host resource in virtio_gpu_user_framebuffer_create()
> > + * because the pixel format is not specified yet
> > + */
> > + bo->ents = ents;
> > + bo->nents = nents;
> > + bo->deferred = true;
> > }
>
> AFAICS, the "params.dumb = true" should be set in
> virtio_gpu_mode_dumb_create() and not in virtio_gpu_deferred_create().
> Was this patch tested?
virtio_gpu_deferred_create re-creates params from scratch, so it must
set "params.dumb = true" too. That looks fine to me.
> Overall, this deferred resource creation doesn't look robust. Could be
> better to either add SET_SCANOUT2 with the format info or add cmd that
> overrides the res fmt.
If we can solve this issue with a guest-side fix I'd very much prefer
that. When adding device features for that the driver will have to
support both old + new devices, which I don't think will be better in
the end.
take care,
Gerd
PS: Figured how using blob resources on s390x should work
(tested in emulation only).
----------------------- cut here -----------------------
--- fedora-s390x-gfx.xml 2024-09-11 11:29:57.864900808 +0200
+++ fedora-s390x-gfx-blob.xml 2024-09-11 11:29:54.662935454 +0200
@@ -1,8 +1,11 @@
<domain type='qemu'>
- <name>fedora-s390x-gfx</name>
- <uuid>00e1b01c-f220-4d95-9d25-cd52c4284238</uuid>
+ <name>fedora-s390x-gfx-blob</name>
+ <uuid>2dcfa930-019d-4c25-8636-65abeed741c0</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
+ <memoryBacking>
+ <source type='memfd'/>
+ </memoryBacking>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='s390x' machine='s390-ccw-virtio-6.2'>hvm</type>
@@ -59,7 +62,7 @@
</graphics>
<audio id='1' type='none'/>
<video>
- <model type='virtio' heads='1' primary='yes'/>
+ <model type='virtio' heads='1' primary='yes' blob='on'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
<zpci uid='0x0001' fid='0x00000000'/>
</address>
More information about the dri-devel
mailing list