This patch changes the graphical_console_init function to return an
allocated DisplayState instead of a QEMUConsole.
This patch contains just the graphical_console_init change and few other
modifications mainly in console.c and vl.c.
It was necessary to move the display frontends (e.g. sdl and vnc)
initialization after machine->init in vl.c.
This patch does *not* include any required changes to any device, these
changes come with the following patches.
Patch 6/7
This patch changes the QEMUMachine init functions not to take a
DisplayState as an argument because is not needed any more;
In few places the graphic hardware initialization function was called
only if DisplayState was not NULL, now they are always called.
Apart from these cases, the rest are all mechanical substitutions.
Patch 7/7
This patch updates the graphic device code to use the new
graphical_console_init function.
As for the previous patch, in few places graphical_console_init was called
only if DisplayState was not NULL, now it is always called.
Apart from these cases, the rest are all mechanical substitutions.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 6 of 13] graphical_console_init change
which also contains several following fixes.
Ian Jackson [Tue, 10 Mar 2009 18:04:43 +0000 (18:04 +0000)]
exploiting the new interface in vnc.c (Stefano Stabellini)
This patch exploits the new DisplaySurface and PixelFormat structures in
vnc, making the code easier to read allowing further improvements.
Compared to the last version I fixed a bug that prevented the hextile
encoding from working properly.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 5 of 13] exploiting the new interface in vnc.c
This patch changes the DisplayState interface adding support for
multiple frontends at the same time (sdl and vnc) and implements most
of the benefit of the shared_buf patch without the added complexity.
Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is
also responsible for allocating the data and setting the depth.
Vga.c (or another backend) will do any necessary conversion.
The idea is to change it so that is vga.c (or another backend) together
with console.c that fully manage the DisplayState interface allocating
data and setting the depth (either 16 or 32 bit, if the guest uses a
different resolution or is in text mode, vga.c (or another backend) is
in charge of doing the conversion seamlessly).
The other idea is that DisplayState supports *multiple* frontends
like sdl and vnc; each of them can register some callbacks to be called
when a display event occurs.
The interesting changes are:
- the new structures and related functions in console.h and console.c
in particular the following functions are very helpful to manage a
DisplaySurface:
- console_select and qemu_console_resize in console.c
this two functions manage multiple consoles on a single host display
- moving code around in hw/vga.c
as for the shared_buf patch this is necessary to be able to handle a dynamic
DisplaySurface bpp
- changes to vga_draw_graphic in hw/vga.c
this is the place where the DisplaySurface buffer is shared with the
videoram, when possible;
Compared to the last version the only changes are:
- do not remove support to dpy_copy in cirrus_vga
- change the name of the displaysurface handling functions
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 4 of 13] DisplayState interface change
Ian Jackson [Tue, 10 Mar 2009 17:59:47 +0000 (17:59 +0000)]
remove bgr (Stefano Stabellini)
Do not handle bgr host displays in the backends.
Right now a bgr flag exists so that sdl can set it, if the SDL_Surface
is bgr.
Afterwards the graphic device (e.g. vga.c) does the needed conversion.
With this patch series is sdl that is responsible for rendering the format
provided by the graphic device that must provide a DisplaySurface
(ds->surface) in 16 or 32 bpp, rgb.
Afterwards sdl creates a SDL_Surface from the given DisplaySurface and
blits it into the main SDL_Surface using SDL_BlitSurface.
Everything is handled by sdl transparently, because SDL_BlitSurface is
perfectly capable of handling bgr displays by itself.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Patch adapted for qemu-xen-unstable by Stefano Stabellini. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Patch adapted for qemu-xen-unstable by Stefano Stabellini. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Also additional fixes supplied by Stefano in his message
[Xen-devel] [PATCH 2 of 13] Introduce accessors for DisplayState Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Jackson [Tue, 10 Mar 2009 17:56:42 +0000 (17:56 +0000)]
Implement "info chardev" command. (Gerd Hoffmann)
This patch makes qemu keep track of the character devices in use and
implements a "info chardev" monitor command to print a list.
qemu_chr_open() sticks the devices into a linked list now. It got a new
argument (label), so there is a name for each device. It also assigns a
filename to each character device. By default it just copyes the
filename passed in. Individual drivers can fill in something else
though. qemu_chr_open_pty() sets the filename to name of the pseudo tty
allocated.
Ian Jackson [Mon, 2 Mar 2009 11:21:51 +0000 (11:21 +0000)]
Override default cache mode for disk images to write-back
Upstream qemu changed the default cache mode to write-through (ie,
O_DSYNC) which is much slower. We do not need this as we have
explicit control of cacheing with the IDE cache control commands.
Original patch by Yang Zhang modified by Ian Jackson.
Signed-off-by: Yang Zhang <yang.zhang@intel.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 2 Mar 2009 11:15:37 +0000 (11:15 +0000)]
wake up PCI passthru device on boot
Commit 8c771eb6294afc5b3754a9e3de51568d4e5986c2 enables a guest
OS to program D0-D3hot states, thus PCI passsthru devices transit
into D3hot state when the guest Windows shutdown.
That disables reboot from passthru devices because the device is
not active in the POST phase. Actually, the option ROM can't be read
from the guest bios.
Ian Jackson [Mon, 2 Mar 2009 11:13:44 +0000 (11:13 +0000)]
passthrough: MSI-X mask bit acceleration
Read MSI-X mask bit directly from the device, since buffered version
may not be up-to-date when MSI-X mask bit interception is working.
Also rebind every MSI-X vector on guest PCI BAR rebalancing so that
MSI-X mask bit intercept handler can get the correct gpa
[ Also, fix declaration of pt_msix_update_remap in pt-msi.h, which
was misspelled pt_msi_update_remap. -iwj ]
Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
The anonymouys structure inside PHPSlots only has one element,
so things can be simplified by moving the element into PHPSlots
and removing the anonymous structure.
Ian Jackson [Mon, 23 Feb 2009 11:33:56 +0000 (11:33 +0000)]
Cleanup PCI passthrough code
The patch cleanups the code of PCI passthrough.
- Use LIST_FOREACH(). Don't use lh_first, le_next directly.
- Use pci_{read, write}_block instead of "switch(len) case [124]
pci_{read, write}_{byte, word, long}();".
- Eliminate duplicate codes using PT_MEARGE_VALUE macro.
- Define PCI_ERR_* macro in pass-through.h if libpci is old.
- Remove the unreasonable loop from pt_aer_reg_{save,restore}.
- Enable pt_aer_reg_{save,restore}, even if libpci is old.
- Fix ro_mask and remove unnecessary pt_xxx_reg_write functions.
- Add "Error:" or "Warning:" to messages.
- Remove verbose messages.
Trailing whitespace does not survive some people's mailers, with the
result that their patches do not apply. Therefore in this commit I'm
removing it from the pass-through code, which is currently entirely in
the Xen tree.
This change is the result of this rune:
perl -i~ -pe 's/[\t ]*$//' hw/pass-through.[ch] hw/pt-msi.[ch]
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 19 Feb 2009 17:55:54 +0000 (17:55 +0000)]
fix raw_aio_remove list walk bug
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cherry picked and cross-ported by Ian Jackson
from Stefano's submission to qemu-devel, 18 Feb 2009 16:56:16 GMT.
Ian Jackson [Fri, 6 Feb 2009 16:16:06 +0000 (16:16 +0000)]
hw/pass-through.c: workaround for old libpci
Old versions of libpci (including the ones on the automatic tests
which control Xen staging propagation) do not define
PCI_LIB_VERSION or the PCI_ERR_{UNCOR_MASK,...} constants.
This means that change 8c771eb6294afc5b3754a9e3de51568d4e5986c2 breaks
the build. In this changeset I apply what is intended to be a
workaround for this problem but it may not be completely correct; this
is therefore perhaps an interim fix.
The potential problem is that the save/restore of some PCI passthrough
error handling registers (across suspend/resume) may not work properly
with old versions of libpci. However non-passthrough and non-suspect
use cases should now be fine.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 5 Feb 2009 15:54:13 +0000 (15:54 +0000)]
Enable guest OS to program D0-D3hot states of an assigned device
This patch enables guest OS to program D0-D3hot states of assigned
device.
This patch is revised version based on the review comments.
- Use LIST_FOREACH(). Don't use lh_first, le_next directly.
- Use pci_{read, write}_block instead of "switch(len) case [124]
pci_{read, write}_{byte, word, long}():".
Ian Jackson [Thu, 5 Feb 2009 14:45:25 +0000 (14:45 +0000)]
fix raw_aio_read/write error handling
Currently when qemu_paio_read or qemu_paio_write return an error we call
qemu_aio_release without removing the request from the list.
I know that in the current implementation qemu_paio_write/read don't return
any error, but still the behavior is wrong, especially considering
that the implementation of these two functions is likely to change in is
the future.
This patch fixes the problem adding a raw_aio_remove function that
removes the callback from the queue and also calls qemu_aio_release.
raw_aio_remove is called by raw_aio_read, raw_aio_write and
raw_aio_cancel.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Backported-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Jan 2009 12:06:19 +0000 (12:06 +0000)]
Restore xenfb.h and atkbd_ translation tables for xenfbfront
Commit ef21d5fda2be46163d9bc3f65d64a6bfd97dd06e removed xenfb.h but
this broke the stubdom build. Necessary changes to get the build
working again:
* un-#if-0 atkbd_set2_keycode and atkbd_unxlate_table in xenfb.c
* make those two tables not `static'
* restore xenfb.h, with their declarations
* adjust the comment in the new xenfb.c
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Jan 2009 11:39:10 +0000 (11:39 +0000)]
Get guest uuid from xenstore
xenstore_get_guess_uuid() retrieves the guest uuid by using a sysctl
hypercall through libxc now, but when we use the ioemu-stubdom, the
hcall is not allowed to be invoked.
This patch makes ioemu get the guest uuid from xenstore, instead of
using libxc.
Ian Jackson [Mon, 26 Jan 2009 15:07:08 +0000 (15:07 +0000)]
Replacement PV xenfb backend (Gerd Hoffman)
Description from Gerd's message:
This patch adds a framebuffer (and kbd+mouse) backend driver. It
it based on current xen-unstable code. It has been changed to make
use of the common backend driver code. It also has been changed to
compile with xen headers older than unstable (aka soon-to-be 3.3).
Ian Jackson [Mon, 26 Jan 2009 12:08:54 +0000 (12:08 +0000)]
add libpci fixup to handle recent change in PCIUtils
The following commit of PCIUtils changes what 'base_addr' contains.
Add a fixup to make sure the pass-through works when building against
different versions of PCIUtils.
The base address flags are ignored when using sysfs method, while
the proc and generic methods combined the flags into 'base_addr'.
This inconsistency may fail some applications using libpci.
Ian Jackson [Fri, 16 Jan 2009 16:02:18 +0000 (16:02 +0000)]
Replacement PV console backend (Gerd Hoffman)
Description from Gerd's message:
xen: add console backend driver.
This patch adds a xenconsole backend driver. It it based on current
xen-unstable code. It has been changed to make use of the common
backend driver code.
Note that this driver is not used at all in the default configurations
of upstream Xen.
Ian Jackson [Fri, 16 Jan 2009 15:52:44 +0000 (15:52 +0000)]
Provide alternative Xen backend infrastructure (Gerd Hoffman)
Description from Gerd's message:
Subject: [PATCH] xen: backend driver core
This patch adds infrastructure for xen backend drivers living in qemu,
so drivers don't need to implement common stuff on their own. It's
mostly xenbus management stuff: some functions to access xentore,
setting up xenstore watches, callbacks on device discovery and state
changes, handle event channel, ...
In this patch, this is just additional machinery, which will be used
in the forthcoming change(s).
Ian Jackson [Wed, 14 Jan 2009 11:04:04 +0000 (11:04 +0000)]
stdvga improvements - new videoram allocation system
This patch is the "stdvga improvements" patch to qemu-xen-unstable with
the due changes for the new videoram allocation system.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(This is Stefano's [PATCH 4 of 4] ioemu;
1 and 2 are already applied and 3 is in xen-unstable. -iwj)
Ian Jackson [Tue, 13 Jan 2009 15:41:01 +0000 (15:41 +0000)]
populate guest videoram
This patch applies to qemu-xen-unstable and implements the new way of
populating the videoram in the guest and mapping it in qemu. Initially
the videoram is populated at the address 0xff000000 in the guest memory
address space.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(This is Stefano's [PATCH 2 of 4] ioemu;
1 is in xen-unstable and 3 and 4 will go in shortly -iwj.)
Ian Jackson [Tue, 13 Jan 2009 11:28:04 +0000 (11:28 +0000)]
Contain MSI errors in msi emulation code
If msi=0 is specified and guest want to enable msi, qemu finds it can
not enable it and quits. (This problem is not appicable for xen
unstable since the "msi=x" switch is removed.) This patch let these
cases be handled inside msi emulation code. If qemu can not enable
msi, guest will not receive MSI. But Qemu can still go on. But if
guest driver does not test MSI's functionality, guest device will stop
to function.
Cherry pick requested by Dexuan Cui:
In the latest Xen-unstable, MSI in xen was disabled temporarily and
many guests with MSI-capable NIC assigned fail to bootup. Could you
please pull the following commit of qemu-xen-3.3-testing.git into
qemu-xen-unstable.git?
Ian Jackson [Mon, 12 Jan 2009 14:28:45 +0000 (14:28 +0000)]
passthrough: MSI-INTx interrupt translation support
This patch enables Xen to use MSI for MSI-capable devices as the
underlying interrupt source even if the guest does not explicitly
use it. The guest will still see an IO-APIC based INTx interrupt
translated by Xen from the MSI irq.
If the guest enables MSI or MSI-X for the passthrough device, this
translation is automatically turned off. It can also be disabled in
the config file at domain startup time.
Ian Jackson [Thu, 8 Jan 2009 19:07:45 +0000 (19:07 +0000)]
send arp like packets for hvm live migration
When two servers connect different switch/hub and do live migration
between them, network connect will no reponse about 30 seconds,
it caused by migration finished, target server do not broadcast
guest os's network info.
In pvm, when backend changed, netfront driver will send fake arp
to network, so, hvm also need this.
Uri Lublin [wrote] the patch for it:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg09306.html
I [Joe] add send arp like packets at tap_receive(), and it looked like
work fine.
Signed-off-by: Joe Jin <joe.jin@oracle.com> Tested-by: Deepak Patel <deepak.patel@oracle.com> CC: Keir Fraser <keir.fraser@eu.citrix.com> CC: Kurt C. Hackel <kurt.hackel@oracle.com>
Ian Jackson [Wed, 7 Jan 2009 15:16:04 +0000 (15:16 +0000)]
fix usb-hid emulation SET_IDLE
there is a bug in the current usb-hid emulation code that affects the
way the idle flag is handled: the spec clearly states that when SET_IDLE
is called with a value == 0 means "do not send any event unless there is
an actual change". However we are currently assuming the opposite
meaning of the flag.
This patch fixes it and it also fixes a possible initialization issue
that is uncovered by using the default idle flag set to 0.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[supplied patch also trivially changed by Ian Jackson]
Ian Jackson [Tue, 6 Jan 2009 16:07:04 +0000 (16:07 +0000)]
xen-hooks.mak: Do not print `***' when compiling unless we fall over
make prints `***' when it stops due to an error. With make -j, and/or
with automated build systems, this error marker can be in the middle
of a large logfile. It is useful to be able to search for it.
Therefore change occurrences of `*' to `#' for information and warning
messages. `***' is reserved for cases where the build stops.
A corresponding change is being submitted to xen-unstable.hg.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Allocate product code 0xffff == 65535 for experimental pre-release
drivers. This will help by giving developers something to use which
doesn't tread on anyone's toes.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 31 Dec 2008 16:12:51 +0000 (16:12 +0000)]
magic ioport 0x10 protocol - clean up document
Clean up the README and product number registry comment:
- removing mail headers
- specifying that the magic number will be reversed
if the drivers are blacklisted
- clarifying that logging is permitted if drivers are
blacklisted
- specifying clearly when people should allocate new numbers
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 31 Dec 2008 16:00:20 +0000 (16:00 +0000)]
disable qemu PCI devices in HVM domains
Magic ioport (0x10) protocol for negotating with guest PV drivers
during startup, and allowing PV drivers to disable hardware emulations
thus preventing guest from seeing the same device through two paths.
Protocol and implementation from the Citrix Xenserver product line.
Documentation (protocol spec) will follow in a moment.
Contributed-By: Steven Smith <steven.smith@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 30 Dec 2008 16:49:29 +0000 (16:49 +0000)]
Do not install signal handlers in qemu-dm
Instead, if we get a terminating signal, just die. This means that
xend can kill us. Unlike upstream qemu, we are not at risk from being
sent random console signals as an attempt to cleanly terminate the
domain.
Thanks to report from Dexuan Cui <dexuan.cui@intel.com>. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 17 Dec 2008 11:39:21 +0000 (11:39 +0000)]
stubdom: Fix live migration of HVM domain
Live-migration fails because stubdom-dm doesn't respond to the request
from xc_save for the logdirty bitmap segment. The attached patch
simply generated from old ioemu tree will fix the issue, then.
Ian Jackson [Tue, 16 Dec 2008 16:03:12 +0000 (16:03 +0000)]
posix_aio_init: Explicitly unblock SIGUSR2 not USR1
In 1f4f23ae9fc220eec55aa742f67f5bb47716bcc6 I arranged to explicitly
unblock the wrong signal - the occurrence of SIGUSR1 was a leftover
from my various debugging trees.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 11 Dec 2008 18:04:47 +0000 (18:04 +0000)]
usb-hid.c: fix usb mouse wheel
This patch fixes the usb mouse wheel of usb devices.
[ Previously, tablets would fail to subtract dz from e->dz thus
producing an infinite stream of reports; also the wheel direction
inversions had been multipled by merge damage resulting in the wrong
number of inversions for mice. -iwj ]
Ian Jackson [Thu, 11 Dec 2008 17:38:28 +0000 (17:38 +0000)]
posix_aio_init: Explicitly unblock SIGUSR1
On Centos 4.3 as invoked by xend it seems that SIGUSR1 can be blocked.
This is almost certainly a libc bug; I checked by using sigprocmask to
obtain what was allegedly the current signal mask and printing it out
and SIGUSR1 wasn't listed, although my strace showed rt_sigprocmask
calls which clearly implied it was blocked - and indeed it wasn't
delivered.
Explicitly enabling it is an easy workaround.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 10 Dec 2008 15:30:49 +0000 (15:30 +0000)]
Always treat floppy images as raw
The fix for the image format guessing vulnerability breaks raw floppy
images. In our environment it is difficult to apply the same
configuration change as envisaged upstream, so instead we arrange to
always treat a floppy image as raw.
Two-line patch supplied by James Harper <james.harper@bendigoit.com.au> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
aliguori [Thu, 13 Nov 2008 19:23:17 +0000 (19:23 +0000)]
block: make raw aio signaling non-blocking (Gerd Hoffman)
This patch switches the read handle of the signaling pipe into
non-blocking mode. This avoids unwanted blocking reads and also
allows to read all bytes out of the signaling pipe in case we got
signaled more that once before the handler ran.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5716 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit e20e830bbdc502986d6fd30c26b06c37a5ee0611)
Ian Jackson [Tue, 28 Oct 2008 10:25:11 +0000 (10:25 +0000)]
usb-linux.c: provide our own copy of <linux/usbdevice_fs.h>
The version on the Xensource build machines is too old. And since
this is a stable ABI it is permitted to copy the headers from Linux
into applications.
Original-Author: Thomas Sailer <sailer@ife.ee.ethz.ch> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Previously, during the merge, I resolved the changeset 2cfc40201be5562a942615452fc2c4ee45d1165c
usb-uhci: correctly deal with interrupt in asynchronous completion
which came from xen-unstable
changeset: 12775:60bbcf799384d779c2a561b9d9ba30f28e31d970
date: Thu Dec 07 11:52:26 2006 +0000
files: tools/ioemu/hw/usb-hid.c tools/ioemu/hw/usb-uhci.c
description:
[HVM] qemu mouse: Adds support for USB mouse/tablet status check and
...
And UHC should leave a TD active when receiving NAK and execute this
incompleted TD in a subseqent frame. UHC only generates an interrupt
on complete after the TD with ICO bit is completed.
... Signed-off-by: Xinmei Huang <xinmei.huang@intel.com>
with the new uhci controller in upstream qemu.
However, in the context of the new uhci controller this is a broken
change; it causes the polling of the usb tablet (for example) to cease
after the first two polls.
Ian Jackson [Fri, 24 Oct 2008 18:09:49 +0000 (19:09 +0100)]
vga.c: Call dpy_update when stealing vram
When we steal the vram, we copy the old data into it. It may be the
case that the display output is already running - eg a VNC client
already connected. In this case it is necessary to call dpy_update to
ensure that the data is sent to the client.
Without this change the initial screen clearing (done by the BIOS
before vram is stole) may be missed if the vnc client is fast at VM
startup, resulting in a white vnc screen with bits of black-backed
text painted over (which can be rectified by asking for a screen
refresh).
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Fri, 24 Oct 2008 18:07:32 +0000 (19:07 +0100)]
vnc.c: fix visible_[xywh] computations for multiple-update-requesters
The spec is unclear about the semantics of several update requests
with various different regions. Some clients (eg tightvnc 1.3.9-4 as
in etch) send a number of small nonincremental requests for areas they
have lost, followed by a large incremental one.
Our code will throw away the `modified' bits for areas outside our
idea of the client's visible area, and redraw them if that idea grows
again. So any client which sends many sequential requests in this way
will end up with some pointless retransmissions.
So what we do here is a bit of a workaround: we avoid shrinking the
visible window on a nonincremental update. We assume that a client's
incremental update specifies a new visible area (possibly shrinking)
but a nonincremental one may only grow it. Hopefully the client which
has really had its visible area reduced will shortly send us an
incremental update request.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>