qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu vnc.c
@ 2006-05-01 10:38 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2006-05-01 10:38 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard@savannah.gnu.org>	06/05/01 10:38:19

Modified files:
	.              : vnc.c 

Log message:
	copyright

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/vnc.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2006-05-01 21:44 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2006-05-01 21:44 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard@savannah.gnu.org>	06/05/01 21:44:22

Modified files:
	.              : vnc.c 

Log message:
	uppercase fix (Anthony Liguori)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/vnc.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2006-05-03 21:18 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2006-05-03 21:18 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard@savannah.gnu.org>	06/05/03 21:18:59

Modified files:
	.              : vnc.c 

Log message:
	removed ssize_t for win32 compatibility

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/vnc.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2006-06-13 16:35 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2006-06-13 16:35 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Fabrice Bellard <bellard>	06/06/13 16:35:24

Modified files:
	.              : vnc.c 

Log message:
	support for higher resolutions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.6&r2=1.7

Patches:
Index: vnc.c
===================================================================
RCS file: /sources/qemu/qemu/vnc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- vnc.c	14 May 2006 18:11:49 -0000	1.6
+++ vnc.c	13 Jun 2006 16:35:24 -0000	1.7
@@ -50,6 +50,10 @@
                                 uint32_t *last_fg,
                                 int *has_bg, int *has_fg);
 
+#define VNC_MAX_WIDTH 2048
+#define VNC_MAX_HEIGHT 2048
+#define VNC_DIRTY_WORDS (VNC_MAX_WIDTH / (16 * 32))
+
 struct VncState
 {
     QEMUTimer *timer;
@@ -59,7 +63,7 @@
     int need_update;
     int width;
     int height;
-    uint64_t dirty_row[768];
+    uint32_t dirty_row[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
     char *old_data;
     int depth; /* internal VNC frame buffer byte per pixel */
     int has_resize;
@@ -95,6 +99,47 @@
 static void vnc_update_client(void *opaque);
 static void vnc_client_read(void *opaque);
 
+static inline void vnc_set_bit(uint32_t *d, int k)
+{
+    d[k >> 5] |= 1 << (k & 0x1f);
+}
+
+static inline void vnc_clear_bit(uint32_t *d, int k)
+{
+    d[k >> 5] &= ~(1 << (k & 0x1f));
+}
+
+static inline void vnc_set_bits(uint32_t *d, int n, int nb_words)
+{
+    int j;
+
+    j = 0;
+    while (n >= 32) {
+        d[j++] = -1;
+        n -= 32;
+    }
+    if (n > 0) 
+        d[j++] = (1 << n) - 1;
+    while (j < nb_words)
+        d[j++] = 0;
+}
+
+static inline int vnc_get_bit(const uint32_t *d, int k)
+{
+    return (d[k >> 5] >> (k & 0x1f)) & 1;
+}
+
+static inline int vnc_and_bits(const uint32_t *d1, const uint32_t *d2, 
+                               int nb_words)
+{
+    int i;
+    for(i = 0; i < nb_words; i++) {
+        if ((d1[i] & d2[i]) != 0)
+            return 1;
+    }
+    return 0;
+}
+
 static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
 {
     VncState *vs = ds->opaque;
@@ -104,7 +149,7 @@
 
     for (; y < h; y++)
 	for (i = 0; i < w; i += 16)
-	    vs->dirty_row[y] |= (1ULL << ((x + i) / 16));
+	    vnc_set_bit(vs->dirty_row[y], (x + i) / 16);
 }
 
 static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
@@ -316,10 +361,10 @@
 
     for (h = 1; h < (vs->height - y); h++) {
 	int tmp_x;
-	if (!(vs->dirty_row[y + h] & (1ULL << last_x)))
+	if (!vnc_get_bit(vs->dirty_row[y + h], last_x))
 	    break;
 	for (tmp_x = last_x; tmp_x < x; tmp_x++)
-	    vs->dirty_row[y + h] &= ~(1ULL << tmp_x);
+	    vnc_clear_bit(vs->dirty_row[y + h], tmp_x);
     }
 
     return h;
@@ -333,15 +378,12 @@
 	int y;
 	char *row;
 	char *old_row;
-	uint64_t width_mask;
+	uint32_t width_mask[VNC_DIRTY_WORDS];
 	int n_rectangles;
 	int saved_offset;
 	int has_dirty = 0;
 
-	width_mask = (1ULL << (vs->width / 16)) - 1;
-
-	if (vs->width == 1024)
-	    width_mask = ~(0ULL);
+        vnc_set_bits(width_mask, (vs->width / 16), VNC_DIRTY_WORDS);
 
 	/* Walk through the dirty map and eliminate tiles that
 	   really aren't dirty */
@@ -349,7 +391,7 @@
 	old_row = vs->old_data;
 
 	for (y = 0; y < vs->height; y++) {
-	    if (vs->dirty_row[y] & width_mask) {
+	    if (vnc_and_bits(vs->dirty_row[y], width_mask, VNC_DIRTY_WORDS)) {
 		int x;
 		char *ptr, *old_ptr;
 
@@ -358,7 +400,7 @@
 
 		for (x = 0; x < vs->ds->width; x += 16) {
 		    if (memcmp(old_ptr, ptr, 16 * vs->depth) == 0) {
-			vs->dirty_row[y] &= ~(1ULL << (x / 16));
+			vnc_clear_bit(vs->dirty_row[y], (x / 16));
 		    } else {
 			has_dirty = 1;
 			memcpy(old_ptr, ptr, 16 * vs->depth);
@@ -389,11 +431,11 @@
 	    int x;
 	    int last_x = -1;
 	    for (x = 0; x < vs->width / 16; x++) {
-		if (vs->dirty_row[y] & (1ULL << x)) {
+		if (vnc_get_bit(vs->dirty_row[y], x)) {
 		    if (last_x == -1) {
 			last_x = x;
 		    }
-		    vs->dirty_row[y] &= ~(1ULL << x);
+		    vnc_clear_bit(vs->dirty_row[y], x);
 		} else {
 		    if (last_x != -1) {
 			int h = find_dirty_height(vs, y, last_x, x);
@@ -688,10 +730,8 @@
 	char *old_row = vs->old_data + y_position * vs->ds->linesize;
 
 	for (i = 0; i < h; i++) {
-	    vs->dirty_row[y_position + i] = (1ULL << (vs->ds->width / 16)) - 1;
-	    if (vs->ds->width == 1024) {
-	      vs->dirty_row[y_position + i] = ~(0ULL);
-	    }
+            vnc_set_bits(vs->dirty_row[y_position + i], 
+                         (vs->ds->width / 16), VNC_DIRTY_WORDS);
 	    memset(old_row, 42, vs->ds->width * vs->depth);
 	    old_row += vs->ds->linesize;
 	}

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2006-08-24 20:36 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2006-08-24 20:36 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Fabrice Bellard <bellard>	06/08/24 20:36:44

Modified files:
	.              : vnc.c 

Log message:
	signed fixes - VNC console switch (initial patch by Andrzej Zaborowski)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.7&r2=1.8

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2006-12-14 13:36 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2006-12-14 13:36 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	06/12/14 13:36:02

Modified files:
	.              : vnc.c 

Log message:
	Reduce VNC resize traffic, thanks Eduardo Felipe.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.8&r2=1.9

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-02-05 20:14 Fabrice Bellard
  0 siblings, 0 replies; 26+ messages in thread
From: Fabrice Bellard @ 2007-02-05 20:14 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Fabrice Bellard <bellard>	07/02/05 20:14:10

Modified files:
	.              : vnc.c 

Log message:
	Mouse relative offset VNC extension (Anthony Liguori)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.10&r2=1.11

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-04-29  1:53 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-04-29  1:53 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/04/29 01:53:20

Modified files:
	.              : vnc.c 

Log message:
	Crop VNC update requests to avoid segfaults, by Thomas Tuttle.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.13&r2=1.14

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-08-25  1:38 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-08-25  1:38 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/08/25 01:38:37

Modified files:
	.              : vnc.c 

Log message:
	x509 certificate for server, by Daniel P. Berrange.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.18&r2=1.19

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-08-25  1:39 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-08-25  1:39 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/08/25 01:39:10

Modified files:
	.              : vnc.c 

Log message:
	x509 client certificate verification, by Daniel P. Berrange.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.19&r2=1.20

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-08-25  1:39 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-08-25  1:39 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/08/25 01:39:57

Modified files:
	.              : vnc.c 

Log message:
	Custom location for x509 cert paths, by Daniel P. Berrange.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.20&r2=1.21

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-09-13 12:41 Thiemo Seufer
  2007-09-14 21:26 ` Matthew Kent
  2007-09-17 17:43 ` Matthew Kent
  0 siblings, 2 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-09-13 12:41 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/09/13 12:41:43

Modified files:
	.              : vnc.c 

Log message:
	Fix infinite loop in VNC support, by Marc Bevand.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.21&r2=1.22

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2007-09-13 12:41 Thiemo Seufer
@ 2007-09-14 21:26 ` Matthew Kent
  2007-09-17 17:43 ` Matthew Kent
  1 sibling, 0 replies; 26+ messages in thread
From: Matthew Kent @ 2007-09-14 21:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel

On Thu, 2007-13-09 at 12:41 +0000, Thiemo Seufer wrote:
> CVSROOT:	/sources/qemu
> Module name:	qemu
> Changes by:	Thiemo Seufer <ths>	07/09/13 12:41:43
> 
> Modified files:
> 	.              : vnc.c 
> 
> Log message:
> 	Fix infinite loop in VNC support, by Marc Bevand.
> 
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.21&r2=1.22
> 
> 

Hmm dang,

http://xenbits.xensource.com/xen-unstable.hg?file/a00cc97b392a/tools/ioemu/patches/vnc-protocol-fixes

changeset:   11622:ca3abb3804f4
user:        Steven Smith <ssmith@xensource.com>
date:        Tue Sep 26 16:46:47 2006 +0100
summary:     [HVM][VNC] Make sure that qemu doesn't go into an infinite
loop when

:(

Are there any plans from the Xen community to submit some of the patches
I see there upstream?

Of course I'd do it myself but I'm not qualified nor familiar with vnc's
operation, just hate to see work duplicated.
-- 
Matthew Kent <mkent@magoazul.com>
http://magoazul.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2007-09-13 12:41 Thiemo Seufer
  2007-09-14 21:26 ` Matthew Kent
@ 2007-09-17 17:43 ` Matthew Kent
  1 sibling, 0 replies; 26+ messages in thread
From: Matthew Kent @ 2007-09-17 17:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel

[sorry, resending.. didn't make it to xen-devel]

On Thu, 2007-13-09 at 12:41 +0000, Thiemo Seufer wrote:
> CVSROOT:	/sources/qemu
> Module name:	qemu
> Changes by:	Thiemo Seufer <ths>	07/09/13 12:41:43
> 
> Modified files:
> 	.              : vnc.c 
> 
> Log message:
> 	Fix infinite loop in VNC support, by Marc Bevand.
> 
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.21&r2=1.22
> 
> 

Hmm dang,

http://xenbits.xensource.com/xen-unstable.hg?file/a00cc97b392a/tools/ioemu/patches/vnc-protocol-fixes

changeset:   11622:ca3abb3804f4
user:        Steven Smith <ssmith@xensource.com>
date:        Tue Sep 26 16:46:47 2006 +0100
summary:     [HVM][VNC] Make sure that qemu doesn't go into an infinite
loop when

:(

Are there any plans from the Xen community to submit some of the patches
I see there upstream?

Of course I'd do it myself but I'm not qualified nor familiar with vnc's
operation, just hate to see work duplicated.
-- 
Matthew Kent <mkent@magoazul.com>
http://magoazul.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-09-30 13:01 Thiemo Seufer
  0 siblings, 0 replies; 26+ messages in thread
From: Thiemo Seufer @ 2007-09-30 13:01 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/09/30 13:01:16

Modified files:
	.              : vnc.c 

Log message:
	Support UltraVNC clients, by Eduardo Felipe.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.24&r2=1.25

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-10-31  1:58 Andrzej Zaborowski
  0 siblings, 0 replies; 26+ messages in thread
From: Andrzej Zaborowski @ 2007-10-31  1:58 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Andrzej Zaborowski <balrog>	07/10/31 01:58:56

Modified files:
	.              : vnc.c 

Log message:
	Handle 3.7 VNC clients authentication correctly (Dan Kenigsberg).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.26&r2=1.27

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2007-12-11 22:31 Andrzej Zaborowski
  0 siblings, 0 replies; 26+ messages in thread
From: Andrzej Zaborowski @ 2007-12-11 22:31 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Andrzej Zaborowski <balrog>	07/12/11 22:31:32

Modified files:
	.              : vnc.c 

Log message:
	Fix fragments due to incomplete dirty tracking in CGA mode (Anthony Liguori).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.29&r2=1.30

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2008-01-13 23:51 Andrzej Zaborowski
  2008-01-14 20:05 ` Anders Melchiorsen
  0 siblings, 1 reply; 26+ messages in thread
From: Andrzej Zaborowski @ 2008-01-13 23:51 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Andrzej Zaborowski <balrog>	08/01/13 23:51:53

Modified files:
	.              : vnc.c 

Log message:
	Reduce redundant timer ticks in VNC, by Anders Melchiorsen.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.31&r2=1.32

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-13 23:51 Andrzej Zaborowski
@ 2008-01-14 20:05 ` Anders Melchiorsen
  2008-01-14 20:19   ` Johannes Schindelin
  0 siblings, 1 reply; 26+ messages in thread
From: Anders Melchiorsen @ 2008-01-14 20:05 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Andrzej Zaborowski <balrogg@gmail.com> writes:

> Log message:
> 	Reduce redundant timer ticks in VNC, by Anders Melchiorsen.
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.31&r2=1.32

That is great, thanks. However, I have found a small error in the
original patch. An additional vga_hw_update() is needed when accepting
the VNC connection.

Without this fix, resolution changes are not caught while no client is
connected, and the display can be clipped when reconnecting.

I am also resending my patch for disabling VGA refresh with -nographic


Cheers,
Anders.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu-vnc-update-on-accept.diff --]
[-- Type: text/x-diff, Size: 413 bytes --]

diff --git a/vnc.c b/vnc.c
index b5921a3..64889de 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1904,6 +1904,9 @@ static void vnc_listen_read(void *opaque)
     struct sockaddr_in addr;
     socklen_t addrlen = sizeof(addr);
 
+    /* Catch-up */
+    vga_hw_update();
+
     vs->csock = accept(vs->lsock, (struct sockaddr *)&addr, &addrlen);
     if (vs->csock != -1) {
 	VNC_DEBUG("New client on socket %d\n", vs->csock);

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: qemu-disable-dummy-vga-refresh.patch --]
[-- Type: text/x-diff, Size: 659 bytes --]

diff --git a/qemu/vl.c b/qemu/vl.c
index 30c9537..8d67314 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4902,13 +4902,6 @@ static void dumb_resize(DisplayState *ds, int w, int h)
 {
 }
 
-static void dumb_refresh(DisplayState *ds)
-{
-#if defined(CONFIG_SDL)
-    vga_hw_update();
-#endif
-}
-
 static void dumb_display_init(DisplayState *ds)
 {
     ds->data = NULL;
@@ -4916,7 +4909,7 @@ static void dumb_display_init(DisplayState *ds)
     ds->depth = 0;
     ds->dpy_update = dumb_update;
     ds->dpy_resize = dumb_resize;
-    ds->dpy_refresh = dumb_refresh;
+    ds->dpy_refresh = NULL;
 }
 
 /***********************************************************/

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 20:05 ` Anders Melchiorsen
@ 2008-01-14 20:19   ` Johannes Schindelin
  2008-01-14 20:38     ` Anders Melchiorsen
  0 siblings, 1 reply; 26+ messages in thread
From: Johannes Schindelin @ 2008-01-14 20:19 UTC (permalink / raw)
  To: Anders Melchiorsen; +Cc: qemu-devel

Hi,

On Mon, 14 Jan 2008, Anders Melchiorsen wrote:

> [an attached patch]

Since you attached the patch, I will not quote the part that I am 
commenting on.

By your change to dumb_refresh() you are affecting definitely more than 
just VNC.  I have doubts that this is intended, or good.

Ciao,
Dscho
 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 20:19   ` Johannes Schindelin
@ 2008-01-14 20:38     ` Anders Melchiorsen
  2008-01-14 21:06       ` Johannes Schindelin
  2008-01-16 20:18       ` Anders Melchiorsen
  0 siblings, 2 replies; 26+ messages in thread
From: Anders Melchiorsen @ 2008-01-14 20:38 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: qemu-devel

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Since you attached the patch, I will not quote the part that I am 
> commenting on.

Yes, I attach to preserve formatting. Am I supposed to put it inline? 
Anyway, here it is, for discussion:

diff --git a/qemu/vl.c b/qemu/vl.c
index 30c9537..8d67314 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4902,13 +4902,6 @@ static void dumb_resize(DisplayState *ds, int w, int h)
 {
 }
 
-static void dumb_refresh(DisplayState *ds)
-{
-#if defined(CONFIG_SDL)
-    vga_hw_update();
-#endif
-}
-
 static void dumb_display_init(DisplayState *ds)
 {
     ds->data = NULL;
@@ -4916,7 +4909,7 @@ static void dumb_display_init(DisplayState *ds)
     ds->depth = 0;
     ds->dpy_update = dumb_update;
     ds->dpy_resize = dumb_resize;
-    ds->dpy_refresh = dumb_refresh;
+    ds->dpy_refresh = NULL;
 }
 
 /***********************************************************/


> By your change to dumb_refresh() you are affecting definitely more than 
> just VNC.  I have doubts that this is intended, or good.

This patch is not for VNC, but for -nographic. I resent it because it
is part of my timer optimization crusade as well.

About the "good" part: I tried stepping through the dumb_refresh()
call before removing it, and it ended up doing nothing. Is it needed
anyway? (in that case, the VNC patch is also wrong, as it stops the
periodic timer when no client is connected).

Also, the CONFIG_SDL thing that can make the function into a noop made
me quite confident that nothing globally important was going on with
the refresh.


Cheers,
Anders.

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 20:38     ` Anders Melchiorsen
@ 2008-01-14 21:06       ` Johannes Schindelin
  2008-01-14 22:19         ` Anders Melchiorsen
  2008-01-16 20:18       ` Anders Melchiorsen
  1 sibling, 1 reply; 26+ messages in thread
From: Johannes Schindelin @ 2008-01-14 21:06 UTC (permalink / raw)
  To: Anders Melchiorsen; +Cc: qemu-devel

Hi,

On Mon, 14 Jan 2008, Anders Melchiorsen wrote:

> diff --git a/qemu/vl.c b/qemu/vl.c
> index 30c9537..8d67314 100644
> --- a/qemu/vl.c
> +++ b/qemu/vl.c
> @@ -4902,13 +4902,6 @@ static void dumb_resize(DisplayState *ds, int w, int h)
>  {
>  }
>  
> -static void dumb_refresh(DisplayState *ds)
> -{
> -#if defined(CONFIG_SDL)
> -    vga_hw_update();
> -#endif
> -}
> -
>  static void dumb_display_init(DisplayState *ds)
>  {
>      ds->data = NULL;
> @@ -4916,7 +4909,7 @@ static void dumb_display_init(DisplayState *ds)
>      ds->depth = 0;
>      ds->dpy_update = dumb_update;
>      ds->dpy_resize = dumb_resize;
> -    ds->dpy_refresh = dumb_refresh;
> +    ds->dpy_refresh = NULL;
>  }
>  
>  /***********************************************************/
> 
> 
> > By your change to dumb_refresh() you are affecting definitely more 
> > than just VNC.  I have doubts that this is intended, or good.
> 
> This patch is not for VNC, but for -nographic. I resent it because it
> is part of my timer optimization crusade as well.
> 
> About the "good" part: I tried stepping through the dumb_refresh() call 
> before removing it, and it ended up doing nothing. Is it needed anyway? 
> (in that case, the VNC patch is also wrong, as it stops the periodic 
> timer when no client is connected).

With stepping, you mean that you took one specific setup, and did not 
inspect what vga_hw_update actually does?

> Also, the CONFIG_SDL thing that can make the function into a noop made 
> me quite confident that nothing globally important was going on with the 
> refresh.

I haven't looked that deeply myself, but your explanations do not give me 
a cozy feeling about your patch.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] qemu vnc.c
@ 2008-01-14 21:45 Andrzej Zaborowski
  0 siblings, 0 replies; 26+ messages in thread
From: Andrzej Zaborowski @ 2008-01-14 21:45 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Andrzej Zaborowski <balrog>	08/01/14 21:45:56

Modified files:
	.              : vnc.c 

Log message:
	Add a missing vga_hw_update() when accepting a connection (Anders Melchiorsen).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vnc.c?cvsroot=qemu&r1=1.32&r2=1.33

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 21:06       ` Johannes Schindelin
@ 2008-01-14 22:19         ` Anders Melchiorsen
  2008-01-15 11:03           ` Johannes Schindelin
  0 siblings, 1 reply; 26+ messages in thread
From: Anders Melchiorsen @ 2008-01-14 22:19 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: qemu-devel

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> I haven't looked that deeply myself, but your explanations do not
> give me a cozy feeling about your patch.

I see your point, and I would love to discuss the merits of the patch
(which is why I sent it in the first place). However, your gut feeling
alone does not give me much to work with.


Anders.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 22:19         ` Anders Melchiorsen
@ 2008-01-15 11:03           ` Johannes Schindelin
  0 siblings, 0 replies; 26+ messages in thread
From: Johannes Schindelin @ 2008-01-15 11:03 UTC (permalink / raw)
  To: Anders Melchiorsen; +Cc: qemu-devel

Hi,

On Mon, 14 Jan 2008, Anders Melchiorsen wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> I haven't looked that deeply myself, but your explanations do not give 
>> me a cozy feeling about your patch.
>
> I see your point, and I would love to discuss the merits of the patch 
> (which is why I sent it in the first place). However, your gut feeling 
> alone does not give me much to work with.

Okay, I tried to be nice.  It is not my "gut feeling" that was offended, 
but my intelligence.  So I try to be more explicit.

You said that you tried stepping through the code, and that it apparently 
did not change anything.  Sorry, that is not good enough for me.

>From just a cursory inspection, I know that there are possibly different 
console instances stored in the active_console variable.

_At least_ you have to enumerate which type they can be, and what their 
hw_update() does, and why they are not affected by your patch.

Your analysis must be _more_ thorough than mine, because you provided the 
patch.  And no, a non-static analysis is not sufficient.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] qemu vnc.c
  2008-01-14 20:38     ` Anders Melchiorsen
  2008-01-14 21:06       ` Johannes Schindelin
@ 2008-01-16 20:18       ` Anders Melchiorsen
  1 sibling, 0 replies; 26+ messages in thread
From: Anders Melchiorsen @ 2008-01-16 20:18 UTC (permalink / raw)
  To: qemu-devel

Anders Melchiorsen <mail@flac.kalibalik.dk> writes:

> --- a/qemu/vl.c
> +++ b/qemu/vl.c
> @@ -4902,13 +4902,6 @@ static void dumb_resize(DisplayState *ds, int w, int h)
>  {
>  }
>  
> -static void dumb_refresh(DisplayState *ds)
> -{
> -#if defined(CONFIG_SDL)
> -    vga_hw_update();
> -#endif
> -}
> -
>  static void dumb_display_init(DisplayState *ds)
>  {
>      ds->data = NULL;
> @@ -4916,7 +4909,7 @@ static void dumb_display_init(DisplayState *ds)
>      ds->depth = 0;
>      ds->dpy_update = dumb_update;
>      ds->dpy_resize = dumb_resize;
> -    ds->dpy_refresh = dumb_refresh;
> +    ds->dpy_refresh = NULL;
>  }


Hi again.

My understanding is that the vga_hw_update() call pushes VRAM contents
into whatever ->data buffer the display (SDL, VNC, etc.) has provided,
and calls ->dpy_update() to have it shown. As the dumb driver has no
data area, this is not needed.

The ->dpy_refresh pointer can safely be NULL, as it is only called
from gui_update(). The gui_update() function is a timer callback that
is only set up if the ->dpy_refresh value is indeed non-NULL.


All the removed code was added in this patch,

  http://www.mail-archive.com/qemu-devel@nongnu.org/msg10829.html

Stefan, can you maybe confirm that this part of your patch is in fact
not needed?


Cheers,
Anders.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2008-01-16 20:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-30 13:01 [Qemu-devel] qemu vnc.c Thiemo Seufer
  -- strict thread matches above, loose matches on Subject: below --
2008-01-14 21:45 Andrzej Zaborowski
2008-01-13 23:51 Andrzej Zaborowski
2008-01-14 20:05 ` Anders Melchiorsen
2008-01-14 20:19   ` Johannes Schindelin
2008-01-14 20:38     ` Anders Melchiorsen
2008-01-14 21:06       ` Johannes Schindelin
2008-01-14 22:19         ` Anders Melchiorsen
2008-01-15 11:03           ` Johannes Schindelin
2008-01-16 20:18       ` Anders Melchiorsen
2007-12-11 22:31 Andrzej Zaborowski
2007-10-31  1:58 Andrzej Zaborowski
2007-09-13 12:41 Thiemo Seufer
2007-09-14 21:26 ` Matthew Kent
2007-09-17 17:43 ` Matthew Kent
2007-08-25  1:39 Thiemo Seufer
2007-08-25  1:39 Thiemo Seufer
2007-08-25  1:38 Thiemo Seufer
2007-04-29  1:53 Thiemo Seufer
2007-02-05 20:14 Fabrice Bellard
2006-12-14 13:36 Thiemo Seufer
2006-08-24 20:36 Fabrice Bellard
2006-06-13 16:35 Fabrice Bellard
2006-05-03 21:18 Fabrice Bellard
2006-05-01 21:44 Fabrice Bellard
2006-05-01 10:38 Fabrice Bellard

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).