linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: "Dmitry Sepp" <dmitry.sepp@opensynergy.com>,
	virtio-dev@lists.oasis-open.org,
	"Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Keiichi Watanabe" <keiichiw@chromium.org>,
	"Alexandre Courbot" <acourbot@chromium.org>,
	alexlau@chromium.org, dgreid@chromium.org,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	"Pawel Osciak" <posciak@chromium.org>,
	"David Stevens" <stevensd@chromium.org>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Daniel Vetter" <daniel@ffwll.ch>
Subject: Re: [virtio-dev] [RFC RESEND] virtio-video: Add virtio video device specification
Date: Fri, 8 Nov 2019 10:05:06 +0100	[thread overview]
Message-ID: <20191108090506.jw4t46d3o4ooy7ns@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAAFQd5CkTxCYhn70o5oiR4uLA7QyRMUw-XrRWorwZnwXGK0pDQ@mail.gmail.com>

> > 1. Both the device and the driver submit requests to each other. For each
> > request the response is sent as a separate request.
> 
> To be more precise, in vdec there are no responses. The guest sends
> commands to the host using one virtqueue. The host signals
> asynchronous events, which might not have the exact earlier guest
> request associated to them.

How do you report errors?  Is there an error event for that?

> An example of such special case could be
> H.264 framebuffer reordering, where one might end up with a few decode
> requests not resulting in any frames being output and then one decode
> request that would trigger multiple accumulated frames to be returned.

Note: this can be done with a request/response model too, by simply
completing the decode request when there is frame data, so in that case
multiple decode requests simply complete at the same time.  Yes, you can
have multiple outstanding requests in virtio.  Out-of-order completion
is also allowed btw.

> > 2. No support for getting/setting video stream parameters. For example
> > (decoder): output format (NV12, I420), so the driver cannot really select the
> > output format after headers have been parsed.
> 
> Getting video stream parameters is there, but they are currently left
> fully in control of the host video decoder. Ability to select between
> multiple possible formats could be worth adding, though.

Nice to see you agree on that one ;)

> > 3. No support for getting plane requirements from the device (sg vs contig,
> > size, stride alignment, plane count).
> 
> There is actually a bigger difference that results in that. Vdec
> assumes host-allocated buffers coming from a different device, e.g.
> virtio-gpu and the host having the right knowledge to allocate the
> buffers correctly. This is related to the fact that it's generally
> difficult to convey all the allocation constraints in a generic
> manner.

Yep, buffer handling is tricky, especially when it comes to decoding
directly to gpu buffers and also when supporting playback of
drm-protected streams where the guest might not be allowed to access
the stream data.

> > 5. Decoder only: new devices will be needed to support encoder, processor or
> > capture. Currently input is always a bitstream, output is always a video
> > frame. No way set input format (needed for encoder, see 2).
> 
> The rationale for this was that this is a point of contact with the
> host and a possible attack surface, so having a protocol as specific
> as possible makes the attack surface smaller and is easier to validate
> in the device implementation.

I think it certainly makes sense to support both video encoding and
video decoding with a single device spec.

For capture (especially camera) and processor things are less clear,
although there is at least some overlap too.  IIRC most of the spec is
"TBD" for those anyway, so I'd suggest to drop them from the spec for
now and focus on the video parts.

cheers,
  Gerd


  reply	other threads:[~2019-11-08  9:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 19:19 [RFC RESEND] virtio-video: Add virtio video device specification Dmitry Sepp
2019-11-07  9:56 ` [virtio-dev] " Gerd Hoffmann
2019-11-07 13:09   ` Dmitry Sepp
2019-11-08  7:49     ` Gerd Hoffmann
2019-11-08  7:58       ` Tomasz Figa
2019-11-08  9:51       ` Dmitry Sepp
2019-11-08  7:50     ` Tomasz Figa
2019-11-08  9:05       ` Gerd Hoffmann [this message]
2019-11-08  9:28         ` Keiichi Watanabe
2019-11-20 11:29           ` Gerd Hoffmann
2019-11-21 10:54             ` Dmitry Sepp
2019-12-04  7:48               ` Keiichi Watanabe
2019-12-04  9:16                 ` Gerd Hoffmann
2019-12-04 19:11                   ` Enrico Granata
2019-12-05  8:21                     ` Keiichi Watanabe
2019-12-06  7:32                       ` Gerd Hoffmann
2019-12-06 12:30                         ` Keiichi Watanabe
2019-12-06 15:50                           ` Enrico Granata
2019-12-09 13:43                             ` Keiichi Watanabe
2019-12-09 10:46                           ` Gerd Hoffmann
2019-12-09 11:38                             ` Dmitry Sepp
2019-12-09 13:17                               ` Keiichi Watanabe
2019-12-09 14:19                   ` Dmitry Sepp
     [not found]                     ` <CAPR809t2X3eEZj14Y-0CdnmzGZFhWKt2vwFSZBrEZbChQpmU_w@mail.gmail.com>
2019-12-10 13:16                       ` Dmitry Sepp
2019-12-12  5:39                         ` Keiichi Watanabe
2019-12-12 10:34                           ` Dmitry Sepp
2019-12-13 14:20                             ` Keiichi Watanabe
2019-12-13 16:31                               ` Keiichi Watanabe
2019-12-20 14:24                                 ` Dmitry Sepp
2019-12-20 15:01                                   ` Keiichi Watanabe
2019-12-13 14:58                     ` Christophe de Dinechin
2019-12-16  8:09                   ` Tomasz Figa
2019-12-16 10:32                     ` Gerd Hoffmann
2019-12-17 13:15                       ` Tomasz Figa
2019-12-17 13:39                         ` Gerd Hoffmann
2019-12-17 14:09                           ` Keiichi Watanabe
2019-12-17 16:13                             ` Dmitry Sepp
2019-12-18  6:43                               ` Gerd Hoffmann

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=20191108090506.jw4t46d3o4ooy7ns@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=acourbot@chromium.org \
    --cc=alexlau@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=dgreid@chromium.org \
    --cc=dmitry.sepp@opensynergy.com \
    --cc=hverkuil@xs4all.nl \
    --cc=keiichiw@chromium.org \
    --cc=linux-media@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=posciak@chromium.org \
    --cc=stevensd@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=virtio-dev@lists.oasis-open.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).