* [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault)
@ 2008-08-21 20:08 Anthony Liguori
2008-08-21 23:16 ` Paul Brook
0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-08-21 20:08 UTC (permalink / raw)
To: qemu-devel
Revision: 5056
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5056
Author: aliguori
Date: 2008-08-21 20:08:55 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
add DisplayState->idle (Samuel Thibault)
Add idle field to DisplayState struct, so drivers can figure
the display is idle and take advantage of that.
The xen framebuffer driver will use this to communicate the
idle state to the guest, so it knows it can stop doing updates
to a virtual display which is invisible anyway.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/console.h
trunk/sdl.c
trunk/vl.c
trunk/vnc.c
Modified: trunk/console.h
===================================================================
--- trunk/console.h 2008-08-21 20:08:03 UTC (rev 5055)
+++ trunk/console.h 2008-08-21 20:08:55 UTC (rev 5056)
@@ -80,6 +80,7 @@
void *opaque;
struct QEMUTimer *gui_timer;
uint64_t gui_timer_interval;
+ int idle;
void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h);
void (*dpy_resize)(struct DisplayState *s, int w, int h);
Modified: trunk/sdl.c
===================================================================
--- trunk/sdl.c 2008-08-21 20:08:03 UTC (rev 5055)
+++ trunk/sdl.c 2008-08-21 20:08:55 UTC (rev 5056)
@@ -524,9 +524,11 @@
if (ev->active.gain) {
/* Back to default interval */
ds->gui_timer_interval = 0;
+ ds->idle = 0;
} else {
/* Sleeping interval */
ds->gui_timer_interval = 500;
+ ds->idle = 1;
}
}
break;
Modified: trunk/vl.c
===================================================================
--- trunk/vl.c 2008-08-21 20:08:03 UTC (rev 5055)
+++ trunk/vl.c 2008-08-21 20:08:55 UTC (rev 5056)
@@ -5976,6 +5976,8 @@
ds->dpy_update = dumb_update;
ds->dpy_resize = dumb_resize;
ds->dpy_refresh = dumb_refresh;
+ ds->gui_timer_interval = 500;
+ ds->idle = 1;
}
/***********************************************************/
Modified: trunk/vnc.c
===================================================================
--- trunk/vnc.c 2008-08-21 20:08:03 UTC (rev 5055)
+++ trunk/vnc.c 2008-08-21 20:08:55 UTC (rev 5056)
@@ -660,6 +660,7 @@
qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL);
closesocket(vs->csock);
vs->csock = -1;
+ vs->ds->idle = 1;
buffer_reset(&vs->input);
buffer_reset(&vs->output);
vs->need_update = 0;
@@ -1920,6 +1921,7 @@
static void vnc_connect(VncState *vs)
{
VNC_DEBUG("New client on socket %d\n", vs->csock);
+ vs->ds->idle = 0;
socket_set_nonblock(vs->csock);
qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, NULL, vs);
vnc_write(vs, "RFB 003.008\n", 12);
@@ -1959,6 +1961,7 @@
exit(1);
ds->opaque = vs;
+ ds->idle = 1;
vnc_state = vs;
vs->display = NULL;
vs->password = NULL;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault)
2008-08-21 20:08 [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault) Anthony Liguori
@ 2008-08-21 23:16 ` Paul Brook
2008-08-22 1:24 ` Anthony Liguori
0 siblings, 1 reply; 3+ messages in thread
From: Paul Brook @ 2008-08-21 23:16 UTC (permalink / raw)
To: qemu-devel
On Thursday 21 August 2008, Anthony Liguori wrote:
> Revision: 5056
> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5056
> Author: aliguori
> Date: 2008-08-21 20:08:55 +0000 (Thu, 21 Aug 2008)
>
> Log Message:
> -----------
> add DisplayState->idle (Samuel Thibault)
This really needs a comment saying exactly what this field means. I'm guessing
it's set by the GUI routines to tell the emulated device that it doesn't need
to update the display.
Currently the GUI has to poll the emulated device to get updated output, which
means this flag is the exact opposite of what I'd intuitively expect.
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault)
2008-08-21 23:16 ` Paul Brook
@ 2008-08-22 1:24 ` Anthony Liguori
0 siblings, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2008-08-22 1:24 UTC (permalink / raw)
To: Paul Brook; +Cc: Markus Armbruster, Samuel Thibault, qemu-devel, Gerd Hoffmann
Paul Brook wrote:
> On Thursday 21 August 2008, Anthony Liguori wrote:
>
>> Revision: 5056
>> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5056
>> Author: aliguori
>> Date: 2008-08-21 20:08:55 +0000 (Thu, 21 Aug 2008)
>>
>> Log Message:
>> -----------
>> add DisplayState->idle (Samuel Thibault)
>>
>
> This really needs a comment saying exactly what this field means.
Fair enough. Gerd or Samuel, can you send a patch?
> I'm guessing
> it's set by the GUI routines to tell the emulated device that it doesn't need
> to update the display.
>
Yes, that's what it does AFAIUI.
> Currently the GUI has to poll the emulated device to get updated output, which
> means this flag is the exact opposite of what I'd intuitively expect.
>
The Xen PV frame buffer is a little different than the other devices we
emulate. The Linux driver provides a linear framebuffer to userspace
via the fbdev interface. There is no update interface for fbdev though
so it periodically zaps the page table mappings in order to do dirty
tracking which it then uses to send the host update regions.
Presumably, this idle flag is actually communicated to the guest to let
it know that it does not need to do dirty tracking for the time being.
Presumably, this has an observable performance advantage. I believe the
refresh rate is pretty high within the guest so I can imagine this being
significant when using guests with CONFIG_NO_HZ.
Regards,
Anthony Liguori
> Paul
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-22 1:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 20:08 [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault) Anthony Liguori
2008-08-21 23:16 ` Paul Brook
2008-08-22 1:24 ` Anthony Liguori
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).