qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 7/8] virtio-vga: v1
Date: Fri, 6 Dec 2013 15:24:57 +1000	[thread overview]
Message-ID: <CAPM=9tx4Vd3RSSXqkdADJMxRN=Jwo1-udczRLmTRcS79kuwVVw@mail.gmail.com> (raw)
In-Reply-To: <1385031990.26155.14.camel@nilsson.home.kraxel.org>

On Thu, Nov 21, 2013 at 9:06 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Do, 2013-11-21 at 13:12 +1000, Dave Airlie wrote:
>> On Wed, Nov 20, 2013 at 10:02 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> > On Mi, 2013-11-20 at 15:52 +1000, Dave Airlie wrote:
>> >> From: Dave Airlie <airlied@redhat.com>
>> >>
>> >> This is a virtio-vga device built on top of the virtio-gpu device.
>> >
>> > Ah, I see what you use the wrapping for.  Hmm.  I think you should use a
>> > common base class instead, i.e. something like virtio-gpu-base which
>> > holds all the common stuff.  Both virtio-gpu and virtio-vga can use that
>> > as TypeInfo->parent then.  This way virtio-vga doesn't have to muck with
>> > virtio-gpu internals.  virtio-gpu-base can be tagged as abstract class
>> > (using .abstract = true) so it will not be instantiated directly.
>> >
>>
>> I'm not sure what that buys me here, I need the virtio-vga to attach
>> the vga ops the first console that the virtio-gpu registers, it can't
>> be a separate console, and since virtio-gpu initialises before
>> virtio-vga I can't tell it to not register the console.
>
> virtio-gpu-core registers no consoles.  It just export the hw_ops
> functions.   virtio-gpu-core inly initializes the stuff which is
> identical for both virtio-gpu and virtio-vga, everything else is left to
> the init functions of the subclasses.
>
> virtio-gpu uses virtio-gpu-core as parent.  Registers the the consoles,
> using the hw_ops functions exported by virtio-gpu-core.  Also sets the
> pci class to DISPLAY_OTHER.
>
> virtio-vga uses virtio-gpu-core as parent too.  Registers the consoles,
> using functions basically doing "if vgamode then call vga hw_ops else
> call virtio-gpu-core hw_ops".  Simliar to what you have today but
> without the funky wrapping.  Sets pci class to DISPLAY_VGA and
> initializes vga stuff.
>
> cheers,
>   Gerd

Okay I'm really missing something here and I think I've confused
myself completely.

My plan was

virtio-gpu-base - VirtIOGPUBase object - VirtIODevice parent_obj -
abstract class - contains vqs + exposes ops

virtio-gpu - virtio-gpu-base wrapper with init sequence for non-VGA
virtio gpus (mmio + pci)
virtio-gpu-pci - VirtIOPCIProxy parent_obj - contains a VirtIOGPU vdev
that it instantiates in its instance init like all the PCI wrappers

Now the advice given was to have virtio-vga wrap virtio-gpu-base but
from what I can see it really can't. Since it needs to act and look
like a PCI device

virtio-vga: Also has a VirtIOPCIProxy parent_obj, however as
virtio-gpu-base is abstract I can't directly instantiate it, and I
can't instantiate virtio-gpu as its the wrong thing,

so do I really need to add another class? rename virtio-vga to
virtio-pci-vga and add a new virtio-vga that just wraps
virtio-gpu-base?

This is getting a lot messier than the code I had, and the benefits
are escaping me, which must mean I'm misinterpreting the instructions
given.

This then led to another question how do I call the virtio-gpu-base
init functions? directly? as I can't use qdev as they are abstract
from what I can see.

Dave.

  reply	other threads:[~2013-12-06  5:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  5:52 [Qemu-devel] [RFC] virtio-gpu and sdl2 so far Dave Airlie
2013-11-20  5:52 ` [Qemu-devel] [PATCH 1/8] ui/sdl2 : initial port to SDL 2.0 (v1.2) Dave Airlie
2013-11-20 10:52   ` Gerd Hoffmann
2013-11-20  5:52 ` [Qemu-devel] [PATCH 2/8] console: add state notifiers for ui<->display Dave Airlie
2013-11-20 11:04   ` Gerd Hoffmann
2013-11-20  5:52 ` [Qemu-devel] [PATCH 3/8] console: add information retrival wrappers Dave Airlie
2013-11-20 11:12   ` Gerd Hoffmann
2013-11-20  5:52 ` [Qemu-devel] [PATCH 4/8] console: add ability to wrap a console Dave Airlie
2013-11-20  5:52 ` [Qemu-devel] [PATCH 5/8] sdl2: update for multihead support Dave Airlie
2013-11-20  5:52 ` [Qemu-devel] [PATCH 6/8] virtio-gpu: v0.1 of the virtio based GPU code Dave Airlie
2013-11-20 11:26   ` Gerd Hoffmann
2013-11-20  5:52 ` [Qemu-devel] [PATCH 7/8] virtio-vga: v1 Dave Airlie
2013-11-20 12:02   ` Gerd Hoffmann
2013-11-21  3:12     ` Dave Airlie
2013-11-21  6:17       ` Paolo Bonzini
2013-11-21 11:06       ` Gerd Hoffmann
2013-12-06  5:24         ` Dave Airlie [this message]
2013-12-06  8:24           ` Gerd Hoffmann
2013-12-06  8:58             ` Dave Airlie
2014-01-07 23:35               ` Dave Airlie
2014-01-13  8:01                 ` Gerd Hoffmann
2013-11-20  5:52 ` [Qemu-devel] [PATCH 8/8] HACK: just to make things start easier with libvirt Dave Airlie
  -- strict thread matches above, loose matches on Subject: below --
2013-12-10  4:05 [Qemu-devel] [RFC] sdl2 + virtio-gpu repost Dave Airlie
2013-12-10  4:05 ` [Qemu-devel] [PATCH 7/8] virtio-vga: v1 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='CAPM=9tx4Vd3RSSXqkdADJMxRN=Jwo1-udczRLmTRcS79kuwVVw@mail.gmail.com' \
    --to=airlied@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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).