Re: [virtio-dev] [RFC RESEND] virtio-video: Add virtio video device specification

Gerd Hoffmann
2019-12-09T10:46:25Z

Hi,

> > For (1) you'll simply do a QUEUE_BUFFER. The command carries references
> > to the buffer pages. No resource management needed.
> >
> > For (2) you'll have RESOURCE_CREATE + RESOURCE_DESTROY + QUEUE_RESOURCE,
> > where RESOURCE_CREATE passes the scatter list of buffer pages to the
> > host and QUEUE_RESOURCE will carry just the resource id.
> >
> > For (3) you'll have RESOURCE_IMPORT + RESOURCE_DESTROY + QUEUE_RESOURCE.
> >
>
> Thanks for the clarification.
> On second thought, however, I'm wondering if we should keep all
> RESOURCE controls.
> This should be an option (4).

Well, that's actually (2), aka "we use RESOURCE_* commands to manage
resources". With the commands in the latest draft that would be:

(1) RESOURCE_CREATE
(2) RESOURCE_ATTACH_BACKING
(3) RESOURCE_QUEUE (resource can be used multiple times here)
(4) RESOURCE_DETACH_BACKING
(5) RESOURCE_DESTROY

I'm not sure we need the separate *_BACKING commands. I think we could
also have RESOURCE_CREATE pass the buffer pages scatter list instead.

Why it is done this way? Just because the design was copied from
virtio-gpu? Or is there some specific reason?

cheers,
Gerd