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

Gerd Hoffmann
2019-12-18T06:44:01Z

On Tue, Dec 17, 2019 at 05:13:59PM +0100, Dmitry Sepp wrote:
> Hi,
>
> On Dienstag, 17. Dezember 2019 15:09:16 CET Keiichi Watanabe wrote:
> > Hi,
> >
> > Thanks Tomasz and Gerd for the suggestions and information.
> >
> > On Tue, Dec 17, 2019 at 10:39 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> > > Hi,
> > >
> > > > 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.
> > >
> > > When going down that route I'd suggest to use two device ids (even when
> > > specifying both variants in one spec section and one header file due to
> > > the overlaps) instead of feature flags.
> >
> > Sounds good. It makes sense to use different device IDs for different
> > devices.
> Does this mean one driver handles both? Or we have two separate drivers?

That is the driver writers choice. You can have a single kernel module
registering as driver for both IDs. Or you can have two kernel modules,
each registering for one of the IDs, possibly with a third library
module with helper code for common bits like buffer management.

cheers,
Gerd