vnc.c (6c71a539c3cb3927fdea230c3ddb9e273142570f) | vnc.c (80e0c8c39b663cd44ea8d47efe256897b7102f50) |
---|---|
1/* 2 * QEMU VNC display driver 3 * 4 * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws> 5 * Copyright (C) 2006 Fabrice Bellard 6 * Copyright (C) 2009 Red Hat, Inc 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 2373 unchanged lines hidden (view full) --- 2382 int y; 2383 uint8_t *guest_row; 2384 uint8_t *server_row; 2385 int cmp_bytes; 2386 unsigned long width_mask[VNC_DIRTY_WORDS]; 2387 VncState *vs; 2388 int has_dirty = 0; 2389 | 1/* 2 * QEMU VNC display driver 3 * 4 * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws> 5 * Copyright (C) 2006 Fabrice Bellard 6 * Copyright (C) 2009 Red Hat, Inc 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 2373 unchanged lines hidden (view full) --- 2382 int y; 2383 uint8_t *guest_row; 2384 uint8_t *server_row; 2385 int cmp_bytes; 2386 unsigned long width_mask[VNC_DIRTY_WORDS]; 2387 VncState *vs; 2388 int has_dirty = 0; 2389 |
2390 struct timeval tv; | 2390 struct timeval tv = { 0, 0 }; |
2391 | 2391 |
2392 gettimeofday(&tv, NULL); 2393 has_dirty = vnc_update_stats(vd, &tv); | 2392 if (!vd->non_adaptive) { 2393 gettimeofday(&tv, NULL); 2394 has_dirty = vnc_update_stats(vd, &tv); 2395 } |
2394 2395 /* 2396 * Walk through the guest dirty map. 2397 * Check and copy modified bits from guest to server surface. 2398 * Update server dirty map. 2399 */ 2400 bitmap_set(width_mask, 0, (ds_get_width(vd->ds) / 16)); 2401 bitmap_clear(width_mask, (ds_get_width(vd->ds) / 16), --- 12 unchanged lines hidden (view full) --- 2414 2415 for (x = 0; x < vd->guest.ds->width; 2416 x += 16, guest_ptr += cmp_bytes, server_ptr += cmp_bytes) { 2417 if (!test_and_clear_bit((x / 16), vd->guest.dirty[y])) 2418 continue; 2419 if (memcmp(server_ptr, guest_ptr, cmp_bytes) == 0) 2420 continue; 2421 memcpy(server_ptr, guest_ptr, cmp_bytes); | 2396 2397 /* 2398 * Walk through the guest dirty map. 2399 * Check and copy modified bits from guest to server surface. 2400 * Update server dirty map. 2401 */ 2402 bitmap_set(width_mask, 0, (ds_get_width(vd->ds) / 16)); 2403 bitmap_clear(width_mask, (ds_get_width(vd->ds) / 16), --- 12 unchanged lines hidden (view full) --- 2416 2417 for (x = 0; x < vd->guest.ds->width; 2418 x += 16, guest_ptr += cmp_bytes, server_ptr += cmp_bytes) { 2419 if (!test_and_clear_bit((x / 16), vd->guest.dirty[y])) 2420 continue; 2421 if (memcmp(server_ptr, guest_ptr, cmp_bytes) == 0) 2422 continue; 2423 memcpy(server_ptr, guest_ptr, cmp_bytes); |
2422 vnc_rect_updated(vd, x, y, &tv); | 2424 if (!vd->non_adaptive) 2425 vnc_rect_updated(vd, x, y, &tv); |
2423 QTAILQ_FOREACH(vs, &vd->clients, next) { 2424 set_bit((x / 16), vs->dirty[y]); 2425 } 2426 has_dirty++; 2427 } 2428 } 2429 guest_row += ds_get_linesize(vd->ds); 2430 server_row += ds_get_linesize(vd->ds); --- 318 unchanged lines hidden (view full) --- 2749 } 2750#endif 2751#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL) 2752 } else if (strncmp(options, "acl", 3) == 0) { 2753 acl = 1; 2754#endif 2755 } else if (strncmp(options, "lossy", 5) == 0) { 2756 vs->lossy = true; | 2426 QTAILQ_FOREACH(vs, &vd->clients, next) { 2427 set_bit((x / 16), vs->dirty[y]); 2428 } 2429 has_dirty++; 2430 } 2431 } 2432 guest_row += ds_get_linesize(vd->ds); 2433 server_row += ds_get_linesize(vd->ds); --- 318 unchanged lines hidden (view full) --- 2752 } 2753#endif 2754#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL) 2755 } else if (strncmp(options, "acl", 3) == 0) { 2756 acl = 1; 2757#endif 2758 } else if (strncmp(options, "lossy", 5) == 0) { 2759 vs->lossy = true; |
2760 } else if (strncmp(options, "non-adapative", 13) == 0) { 2761 vs->non_adaptive = true; |
|
2757 } 2758 } 2759 2760#ifdef CONFIG_VNC_TLS 2761 if (acl && x509 && vs->tls.x509verify) { 2762 if (!(vs->tls.acl = qemu_acl_init("vnc.x509dname"))) { 2763 fprintf(stderr, "Failed to create x509 dname ACL\n"); 2764 exit(1); --- 137 unchanged lines hidden --- | 2762 } 2763 } 2764 2765#ifdef CONFIG_VNC_TLS 2766 if (acl && x509 && vs->tls.x509verify) { 2767 if (!(vs->tls.acl = qemu_acl_init("vnc.x509dname"))) { 2768 fprintf(stderr, "Failed to create x509 dname ACL\n"); 2769 exit(1); --- 137 unchanged lines hidden --- |