linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Keiichi Watanabe" <keiichiw@chromium.org>,
	"Dmitry Sepp" <dmitry.sepp@opensynergy.com>,
	virtio-dev@lists.oasis-open.org,
	"Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Alexandre Courbot" <acourbot@chromium.org>,
	"Alex Lau" <alexlau@chromium.org>,
	"Dylan Reid" <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: Tue, 17 Dec 2019 22:15:56 +0900	[thread overview]
Message-ID: <CAAFQd5BN+enTk3-4aUCCB+ZUA+7ZsOP=zndXh4Y=a8faoRk1Pw@mail.gmail.com> (raw)
In-Reply-To: <20191216103236.ugjorzq5pntc7gtt@sirius.home.kraxel.org>

On Mon, Dec 16, 2019 at 7:32 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>   Hi,
>
> > > Hmm, modern GPUs support both encoding and decoding ...
> >
> > Many SoC architectures have completely separate IP blocks for encoding
> > and decoding. Similarly, in GPUs those are usually completely separate
> > parts of the pipeline.
>
> In the OS there is one driver per GPU handling both ...
>

That's usually only the case for the desktop PC-style GPUs. That said,
it probably doesn't matter from the protocol point of view how it's
handled in the host. At least it is definitely safe to assume that the
host provides functionality for independently decoding and encoding
things from different processes, which is enough to implement virtio
decoder and encoder as separate devices.

> > > I don't think we should bake that restriction into the specification.
> > > It probably makes sense to use one virtqueue per function though, that
> > > will simplify dispatching in both host and guest.
> > >
> >
> > Wouldn't it make the handling easier if we had one virtio device per function?
>
> I don't think there is much of a difference between one device per
> function and one virtqueue per function.  You'll probably have a single
> driver for both anyway, to share common code for buffer management etc.
>

The semantics of the encoder and decoder on the driver side, at least
on Linux where V4L2 is used, are different enough for much of the code
to be separated.

That said, even with separate devices, the same driver can be
instantiated multiple times, which is a common case in Linux, handled
by the driver core. That basically gives us the ability to have as
many instances of whatever function we want for free, without the need
to explicitly handle multiple functions in one device in the driver.
So that clearly equals simpler driver code.

On the host side, the encode and decode APIs are different as well, so
having separate implementation decoder and encoder, possibly just
sharing some helper code, would make much more sense.

> > > Use separate pixel_format (fourcc) and stream_format (H.264 etc.) enums?
> >
> > I'd specifically avoid FourCC here, as it's very loosely defined and
> > could introduce confusion.
>
> I don't think using fourcc is a problem, and given that both drm and
> v4l2 use fourcc already this would be a good choice I think.

Both DRM and V4L2 use two mutually incompatible sets of FourCCs, so
I'm not sure how it could be a good choice. At least unless we decide
to pick a specific set of FourCC. It doesn't help that Windows/DirectX
has its own set of FourCCs that's again slightly different than the
two mentioned before.

>
> But the definition should be more specific than just "fourcc".  Best
> would be to explicitly list and define each format supported by the
> spec.

Why not be consistent with virtio-gpu and just define new formats as
we add support for them as sequential integers?

Best regards,
Tomasz

  reply	other threads:[~2019-12-17 13:16 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
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 [this message]
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='CAAFQd5BN+enTk3-4aUCCB+ZUA+7ZsOP=zndXh4Y=a8faoRk1Pw@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --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=kraxel@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=posciak@chromium.org \
    --cc=stevensd@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).