qxl: Only emit QXL_INTERRUPT_CLIENT_MONITORS_CONFIG on config changes
commit6c7565028c272c4c6f2a83c3a90b044eeaf2804a
authorChristophe Fergeau <cfergeau@redhat.com>
Fri, 28 Oct 2016 14:48:40 +0000 (28 16:48 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 5 Dec 2016 08:37:52 +0000 (5 09:37 +0100)
tree705db07c385b8b95b2c64f468bba96c051731f2d
parentbd8ef5060dd2124a54578241da9a572faf7658dd
qxl: Only emit QXL_INTERRUPT_CLIENT_MONITORS_CONFIG on config changes

Currently if the client keeps sending the same monitor config to
QEMU/spice-server, QEMU will always raise
a QXL_INTERRUPT_CLIENT_MONITORS_CONFIG regardless of whether there was a
change or not.
Guest-side (with fedora 25), the kernel QXL KMS driver will also forward the
event to user-space without checking if there were actual changes.
Next in line are gnome-shell/mutter (on a default f25 install), which
will try to reconfigure everything without checking if there is anything
to do.
Where this gets ugly is that when applying the resolution changes,
gnome-shell/mutter will call drmModeRmFB, drmModeAddFB, and
drmModeSetCrtc, which will cause the primary surface to be destroyed and
recreated by the QXL KMS driver. This in turn will cause the client to
resend a client monitors config message, which will cause QEMU to reemit
an interrupt with an unchanged monitors configuration, ...
This causes https://bugzilla.redhat.com/show_bug.cgi?id=1266484

This commit makes sure that we only emit
QXL_INTERRUPT_CLIENT_MONITORS_CONFIG when there are actual configuration
changes the guest should act on.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Message-id: 20161028144840.18326-1-cfergeau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/qxl.c