qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>,
	virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org,
	virtio-dev@lists.oasis-open.org
Subject: Re: [Qemu-devel] [virtio-dev] [PATCH 2/2] virtio-gpu/2d: add docs/specs/virtio-gpu.txt
Date: Fri, 12 Sep 2014 13:38:07 +0200	[thread overview]
Message-ID: <1410521887.30411.13.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <20140912091011.GC1614@stefanha-thinkpad.redhat.com>

On Fr, 2014-09-12 at 10:10 +0100, Stefan Hajnoczi wrote:
> On Thu, Sep 11, 2014 at 05:09:33PM +0200, Gerd Hoffmann wrote:
> > diff --git a/docs/specs/virtio-gpu.txt b/docs/specs/virtio-gpu.txt
> > new file mode 100644
> > index 0000000..9455383
> > --- /dev/null
> > +++ b/docs/specs/virtio-gpu.txt
> > @@ -0,0 +1,165 @@
> > +virtio-gpu specification
> > +========================
> 
> This document refers to the implementation for structs and does not
> fully document the semantics of the virtqueue commands.
> 
> Mixing the implementation and specification is risky since
> implementation changes cannot be checked against the specification.  In
> order to make this document self-contained you need to define the struct
> layouts.
> 
> Error conditions and corner cases are not documented for the virtqueue
> commands.  I've asked about a few of them below, but there more are
> required to make this specification complete enough so someone else
> could write a compatible implementation.

Ok.  The short-term goal for this text is to help reviewing the code by
documenting how the device is supposed to work.  Being good enough for
an independent implementation is the next level.  I'll keep it on the
radar though.

> > +VIRTGPU_CMD_RESOURCE_CREATE_2D:
> > +  Command: struct virtgpu_resource_create_2d
> > +
> > +  Create a 2D resource on the host.
> > +
> > +  This creates a 2D resource on the host with the specified width,
> > +  height and format. Only a small subset of formats are support. The
> > +  resource ids are generated by the guest.
> 
> Can the host refuse due to lack of resources?

Yes.  virtgpu_ctrl_hdr.type in the response will be set to
VIRTGPU_RESP_ERR_* then.  Current implementation does that only on
malloc() failure, there is no accounting (yet) to limit the amout of
memory the guest is allowed to allocate.

/me notes to write a section on error handling.

> > +VIRTGPU_CMD_SET_SCANOUT:
> > +  Command: struct virtgpu_set_scanout
> > +
> > +  Set the scanout parameters for a single output.
> > +
> > +  This sets the scanout parameters for a single scanout. The
> > +  resource_id is the resource to be scanned out from, along with a
> > +  rectangle specified by x, y, width and height.
> 
> What if x, y, width, and height are out-of-range for the given resource?

You'll get an error.

> What if width and height exceed the scanout width and height?

Using only a subrectangle of the resource for the scanout is legal.

> Is it possible to unset the scanout for a resource?

Yes, use resource_id 0.

> Can a resource be
> set on multiple scanouts?

Yes.

> Does VIRTGPU_CMD_SET_SCANOUT need to be called between every
> VIRTGPU_CMD_RESOURCE_FLUSH or is does the assignment persist?

Assignment is persistent.

> > +  the backing store for a resource. These pages are then used for the
> > +  transfer operations for that resource from that point on.
> > +
> > +VIRTGPU_CMD_RESOURCE_INVAL_BACKING:
> > +  Command: struct virtgpu_resource_inval_backing
> 
> Why is it called INVAL_BACKING instead of DETACH_BACKING?  "Detach" is
> logical since there is also an "attach" command.

No particular reason I think.  Dave?

cheers,
  Gerd

  reply	other threads:[~2014-09-12 11:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 15:09 [Qemu-devel] [PATCH 0/2] virtio-gpu: hardware specification Gerd Hoffmann
2014-09-11 15:09 ` [Qemu-devel] [PATCH 1/2] virtio-gpu/2d: add hardware spec include file Gerd Hoffmann
2014-09-11 15:15   ` Peter Maydell
2014-09-11 15:40     ` Gerd Hoffmann
2014-09-11 15:19   ` Eric Blake
2014-09-12 10:44     ` Gerd Hoffmann
2014-09-12 12:48       ` Eric Blake
2014-09-12 12:51         ` Eric Blake
2014-09-12 13:03         ` Peter Maydell
2014-09-14 13:46       ` Michael S. Tsirkin
2014-09-14 14:04         ` Peter Maydell
2014-09-14 14:11           ` Michael S. Tsirkin
2014-09-14 14:32             ` Peter Maydell
2014-09-14 15:09               ` Michael S. Tsirkin
2014-09-14 16:11                 ` Peter Maydell
2014-09-14 16:31                   ` Michael S. Tsirkin
2014-09-15 10:36               ` Gerd Hoffmann
2014-09-15 10:40         ` Gerd Hoffmann
2014-09-15 10:55           ` Michael S. Tsirkin
2014-09-11 15:20   ` Peter Maydell
2014-09-11 15:43     ` Gerd Hoffmann
2014-09-11 15:53       ` Christopher Covington
2014-09-11 18:58       ` [Qemu-devel] [virtio-dev] " Paolo Bonzini
2014-09-11 15:09 ` [Qemu-devel] [PATCH 2/2] virtio-gpu/2d: add docs/specs/virtio-gpu.txt Gerd Hoffmann
2014-09-11 15:30   ` Eric Blake
2014-09-12 11:08     ` Gerd Hoffmann
2014-09-12  9:10   ` [Qemu-devel] [virtio-dev] " Stefan Hajnoczi
2014-09-12 11:38     ` Gerd Hoffmann [this message]
2014-09-12 21:14       ` Dave Airlie
2014-09-15 10:14         ` Gerd Hoffmann
2014-09-14  9:16   ` [Qemu-devel] " Michael S. Tsirkin
2014-09-14 11:05     ` [Qemu-devel] [virtio-dev] " Dave Airlie
2014-09-12 21:18 ` [Qemu-devel] [virtio-dev] [PATCH 0/2] virtio-gpu: hardware specification Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410521887.30411.13.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).