[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [Qemu-devel] [RFC PATCH] vga: Start supporting resolution not multiple of 16 correctly.
Il 18/06/2013 12:17, Frediano Ziglio ha
scritto:
Modern notebook support 1366x768 resolution. The
resolution width is
not multiple of 16 causing some problems.
QEMU VGA emulation requires width resolution to be
multiple of 8.
VNC implementation requires width resolution to be
multiple of 16.
Signed-off-by: Frediano Ziglio < frediano.ziglio@xxxxxxxxxx>
Tested-by: Fabio Fantoni <fabio.fantoni@xxxxxxx>
I tested it for a long time with spice on xen (because qxl will be
fully working only after adding SSE support on hvm domUs). It works,
I think it is good to add this and the respective vgabios patch on
upstream.
---
Âhw/display/vga.c |ÂÂÂ 2 +-
Âui/vnc.cÂÂÂÂÂÂÂÂ |ÂÂ 34
+++++++++++++++++++---------------
Â2 files changed, 20 insertions(+), 16 deletions(-)
Updates:
- rebased
- fixed style problems
- fixed typos in comment
Attached patch for last vgabios in order to get some new
resolutions.
Still had no time to test deeply.
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 21a108d..0053b0f 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -648,7 +648,7 @@ void vbe_ioport_write_data(void
*opaque, uint32_t addr, uint32_t val)
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂ case VBE_DISPI_INDEX_XRES:
-ÂÂÂÂÂÂÂÂÂÂÂ if ((val <= VBE_DISPI_MAX_XRES)
&& ((val & 7) == 0)) {
+ÂÂÂÂÂÂÂÂÂÂÂ if ((val <= VBE_DISPI_MAX_XRES)
&& ((val & 1) == 0)) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ s->vbe_regs[s->vbe_index] = val;
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ break;
diff --git a/ui/vnc.c b/ui/vnc.c
index dfc7459..2a2bb90 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -911,26 +911,30 @@ static int
vnc_update_client(VncState *vs, int has_dirty)
ÂÂÂÂÂÂÂÂ for (y = 0; y < height; y++) {
ÂÂÂÂÂÂÂÂÂÂÂÂ int x;
ÂÂÂÂÂÂÂÂÂÂÂÂ int last_x = -1;
-ÂÂÂÂÂÂÂÂÂÂÂ for (x = 0; x < width / 16; x++) {
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (test_and_clear_bit(x,
vs->dirty[y])) {
+ÂÂÂÂÂÂÂÂÂÂÂ for (x = 0; x < width; x += 16) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (test_and_clear_bit(x/16,
vs->dirty[y])) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (last_x == -1) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ last_x = x;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ } else {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (last_x != -1) {
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int h =
find_and_clear_dirty_height(vs, y, last_x, x,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
height);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int h =
find_and_clear_dirty_height(vs, y, last_x/16,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
x/16, height);
Â
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ n += vnc_job_add_rect(job,
last_x * 16, y,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ (x -
last_x) * 16, h);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ n += vnc_job_add_rect(job,
last_x, y,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ (x -
last_x), h);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ last_x = -1;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ if (last_x != -1) {
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int h = find_and_clear_dirty_height(vs,
y, last_x, x, height);
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ n += vnc_job_add_rect(job, last_x * 16,
y,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ (x - last_x) *
16, h);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int h = find_and_clear_dirty_height(vs,
y, last_x/16, x/16,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
height);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (x > width) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ x = width;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ n += vnc_job_add_rect(job, last_x, y,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ (x - last_x), h);
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂ }
Â
@@ -1861,7 +1865,7 @@ static void
framebuffer_update_request(VncState *vs, int
incremental,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int w, int h)
Â{
ÂÂÂÂ int i;
-ÂÂÂ const size_t width =
surface_width(vs->vd->ds) / 16;
+ÂÂÂ const size_t width =
(surface_width(vs->vd->ds)+15) / 16;
ÂÂÂÂ const size_t height =
surface_height(vs->vd->ds);
Â
ÂÂÂÂ if (y_position > height) {
@@ -2686,10 +2690,6 @@ static int
vnc_refresh_server_surface(VncDisplay *vd)
ÂÂÂÂÂ * Check and copy modified bits from guest to
server surface.
ÂÂÂÂÂ * Update server dirty map.
ÂÂÂÂÂ */
-ÂÂÂ cmp_bytes = 64;
-ÂÂÂ if (cmp_bytes > vnc_server_fb_stride(vd)) {
-ÂÂÂÂÂÂÂ cmp_bytes = vnc_server_fb_stride(vd);
-ÂÂÂ }
ÂÂÂÂ if (vd->guest.format != VNC_SERVER_FB_FORMAT) {
ÂÂÂÂÂÂÂÂ int width =
pixman_image_get_width(vd->server);
ÂÂÂÂÂÂÂÂ tmpbuf =
qemu_pixman_linebuf_create(VNC_SERVER_FB_FORMAT, width);
@@ -2710,8 +2710,12 @@ static int
vnc_refresh_server_surface(VncDisplay *vd)
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ server_ptr = server_row;
Â
-ÂÂÂÂÂÂÂÂÂÂÂ for (x = 0; x + 15 < width;
+ÂÂÂÂÂÂÂÂÂÂÂ cmp_bytes = 64;
+ÂÂÂÂÂÂÂÂÂÂÂ for (x = 0; x < width;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ x += 16, guest_ptr += cmp_bytes,
server_ptr += cmp_bytes) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (width - x < 16) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ cmp_bytes = 4 * (width - x);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (!test_and_clear_bit((x / 16),
vd->guest.dirty[y]))
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ continue;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (memcmp(server_ptr, guest_ptr,
cmp_bytes) == 0)
--
1.7.10.4
Nessun virus
nel messaggio.
Controllato da AVG - www.avg.com
Versione: 2013.0.3345 / Database dei virus: 3199/6420 - Data di
rilascio: 18/06/2013
|
Attachment:
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|