qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Akihiko Odaki <akihiko.odaki@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Paul Durrant <paul@xen.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu Developers <qemu-devel@nongnu.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] virtio-gpu: Respect graphics update interval for EDID
Date: Wed, 3 Mar 2021 10:18:04 +0100	[thread overview]
Message-ID: <20210303091804.5fm4esvd2iixbgew@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAMVc7JX-E_3fE9SCOaYFAtDBRHNmHxmHWiqcJDPE-4zq-QHJbQ@mail.gmail.com>

On Fri, Feb 26, 2021 at 01:47:38PM +0900, Akihiko Odaki wrote:
> 2021年2月25日(木) 20:46 Gerd Hoffmann <kraxel@redhat.com>:
> >
> >   Hi,
> >
> > > > Because of the wasted frames I'd like this to be an option you can
> > > > enable when needed.  For the majority of use cases this seems to be
> > > > no problem ...
> > >
> > > I see blinks with GNOME on Wayland on Ubuntu 20.04 and virtio-gpu with
> > > the EDID change included in this patch.
> >
> > /me looks closely at the patch again.
> >
> > So you update the edid dynamically, each time the refresh rate changes.
> > Problem with that approach is software doesn't expect edid to change
> > dynamically because on physical hardware it is static information about
> > the connected monitor.
> >
> > So what the virtio-gpu guest driver does is emulate a monitor hotplug
> > event to notify userspace.  If you resize the qemu window on the host
> > it'll look like the monitor with the old window size was unplugged and
> > a new monitor with the new window size got plugged instead, so gnome
> > shell goes adapt the display resolution to the new virtual monitor size.
> >
> > The blink you are seeing probably comes from gnome-shell processing the
> > monitor hotplug event.
> >
> > We could try to skip generating a monitor hotplug event in case only the
> > refresh rate did change.  That would fix the blink, but it would also
> > have the effect that nobody will notice the update.
> >
> > Bottom line:  I think making the edid refresh rate configurable might be
> > useful, but changing it dynamically most likely isn't.
> >
> > take care,
> >   Gerd
> 
> The "hotplug" implementation is probably what other combinations of
> devices and guests will do if they want to respond to the changes of
> the refresh rate, or display mode in general. That makes telling the
> dynamic refresh rate to guests infeasible.
> 
> As you wrote, making the refresh rate configurable should be still
> useful, and I think matching it to the backend physical display is
> even better. GTK, the sole implementer of gfx_update_interval in my
> patch reports the refresh rate of the physical display the window
> resides in. It means the value may change when the physical display
> changes its refresh rate, which should be rare if it does, or the
> window moves to another physical display.

Yes.  Added debug printf, can see that it changes exactly twice for me,
once to the default value and then to the real refresh rate.

That rules out the hotplug event as source for the blinks.  I'm
wondering where they are coming from, and I can't reproduce them
on my machine ...

> consistent. The only inconsistency I see in my patch is that the
> refresh rate change has no throttling while the window size change
> has. I don't think it is problematic because it should be rare to move
> the window across physical displays, but I can implement one if you
> don't agree or know other cases the refresh rate frequently changes.

I think it would be best to just add a new field for the refresh rate
to QemuUIInfo.  That avoids a new callback you also get the throttling
for free ;)

take care,
  Gerd



      reply	other threads:[~2021-03-03  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 13:34 [PATCH] virtio-gpu: Respect graphics update interval for EDID Akihiko Odaki
2021-02-22 10:57 ` Gerd Hoffmann
2021-02-23  4:50   ` Akihiko Odaki
2021-02-24 11:15     ` Gerd Hoffmann
2021-02-25  1:52       ` Akihiko Odaki
2021-02-25 11:46         ` Gerd Hoffmann
2021-02-26  4:47           ` Akihiko Odaki
2021-03-03  9:18             ` Gerd Hoffmann [this message]

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=20210303091804.5fm4esvd2iixbgew@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).