From: Alex Williamson <alex.williamson@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, intel-gvt-dev@lists.freedesktop.org
Subject: Re: [Qemu-devel] [PATCH v2 1/3] vfio/display: add edid support.
Date: Thu, 21 Feb 2019 10:34:50 -0700 [thread overview]
Message-ID: <20190221103450.4f37e60f@w520.home> (raw)
In-Reply-To: <20190221073850.rgygkl3uyn4rxswl@sirius.home.kraxel.org>
On Thu, 21 Feb 2019 08:38:50 +0100
Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Wed, Feb 20, 2019 at 02:54:35PM -0700, Alex Williamson wrote:
> > On Wed, 20 Feb 2019 09:47:51 +0100
> > Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > > This patch adds EDID support to the vfio display (aka vgpu) code.
> > > When supported by the mdev driver qemu will generate a EDID blob
> > > and pass it on using the new vfio edid region. The EDID blob will
> > > be updated on UI changes (i.e. window resize), so the guest can
> > > adapt.
> >
> > What are the requirements to enable this resizing feature? I grabbed
> > the gvt-next-2019-02-01 branch and my ever expanding qemu:commandline
> > now looks like this:
> >
> > <qemu:commandline>
> > <qemu:arg value='-set'/>
> > <qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
> > <qemu:arg value='-set'/>
> > <qemu:arg value='device.hostdev0.ramfb=on'/>
> > <qemu:arg value='-set'/>
> > <qemu:arg value='device.hostdev0.driver=vfio-pci-nohotplug'/>
> > <qemu:arg value='-set'/>
> > <qemu:arg value='device.hostdev0.xres=1600'/>
> > <qemu:arg value='-set'/>
> > <qemu:arg value='device.hostdev0.yres=900'/>
> > </qemu:commandline>
> >
> > Other relevant sections:
> >
> > <graphics type='spice'>
> > <listen type='none'/>
> > <gl enable='yes' rendernode='/dev/dri/by-path/pci-0000:00:02.0-render'/>
> > </graphics>
>
> When using spice you also need the spicevmc channel and the spice agent
> being installed and active in the guest.
This is the vdagent using installation like this:
https://www.ovirt.org/develop/infra/testing/spice.html
ie. vdservice install, net start vdservice?
I'm not seeing anything magically change when I do that. I do have the
default serial and redirection devices installed by virt-manager:
<serial type='pty'>
<source path='/dev/pts/4'/>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/4'>
<source path='/dev/pts/4'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir0'/>
<address type='usb' bus='0' port='2'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir1'/>
<address type='usb' bus='0' port='3'/>
</redirdev>
I believe I have drivers installed, but it's a bit difficult to verify
given the Intel graphics glitches I copied you on.
> > > + dpy->edid_regs->link_state = VFIO_DEVICE_GFX_LINK_STATE_UP;
> > > + pwrite_field(fd, dpy->edid_info, dpy->edid_regs, link_state);
> > > + trace_vfio_display_edid_link_up();
> > > + return;
> > > +
> > > +err:
> > > + trace_vfio_display_edid_write_error();
> > > + return;
> >
> > nit, no unwind and only one call point, could probably do without the
> > goto.
>
> Not that easily due to the goto being hidden in the pwrite_field()
> macro.
Ah, I knew those macros were going to be tricky, but I fell for it
anyway. Sorry.
> > > + trace_vfio_display_edid_available();
> > > + dpy->edid_regs = g_new0(struct vfio_region_gfx_edid, 1);
> > > + pread_field(fd, dpy->edid_info, dpy->edid_regs, edid_offset);
> > > + pread_field(fd, dpy->edid_info, dpy->edid_regs, edid_max_size);
> > > + pread_field(fd, dpy->edid_info, dpy->edid_regs, max_xres);
> > > + pread_field(fd, dpy->edid_info, dpy->edid_regs, max_yres);
> > > + dpy->edid_blob = g_malloc0(dpy->edid_regs->edid_max_size);
> > > +
> > > + vfio_display_edid_update(vdev, true, 0, 0);
> > > + return;
> > > +
> > > +err:
> > > + fprintf(stderr, "%s: Oops, pread error\n", __func__);
> > > + g_free(dpy->edid_regs);
> > > + dpy->edid_regs = NULL;
> > > + return;
> >
> > This code is unreachable.
>
> It's not. Again, the goto is in pread_field.
>
> But I just noticed I missed one fprintf which should be a
> trace_vfio_display_edid_write_error() ...
Yep.
next prev parent reply other threads:[~2019-02-21 17:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-20 8:47 [Qemu-devel] [PATCH v2 0/3] vfio/display: add edid support Gerd Hoffmann
2019-02-20 8:47 ` [Qemu-devel] [PATCH v2 1/3] " Gerd Hoffmann
2019-02-20 21:54 ` Alex Williamson
2019-02-21 7:38 ` Gerd Hoffmann
2019-02-21 17:34 ` Alex Williamson [this message]
2019-02-22 5:45 ` Gerd Hoffmann
2019-02-20 8:47 ` [Qemu-devel] [PATCH v2 2/3] vfio/display: add xres + yres properties Gerd Hoffmann
2019-02-20 22:36 ` Alex Williamson
2019-02-21 7:46 ` Gerd Hoffmann
2019-02-21 17:35 ` Alex Williamson
2019-02-20 8:47 ` [Qemu-devel] [PATCH v2 3/3] vfio/display: delay link up event Gerd Hoffmann
2019-02-20 22:39 ` Alex Williamson
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=20190221103450.4f37e60f@w520.home \
--to=alex.williamson@redhat.com \
--cc=intel-gvt-dev@lists.freedesktop.org \
--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).