diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-19 12:30:57 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-27 08:08:07 +0200 |
commit | 979f7ef8966bc4495a710ed9e4af42098f92ee79 (patch) | |
tree | 2448aaa06248822fd814bef43b85451ef5e9f874 /hw/display/qxl-render.c | |
parent | d46b40fce2e3f5187bb9a67d348e8bfd4f73ad3b (diff) |
qxl: use guest_monitor_config for local renderer.
When processing monitor config from guest store head0 width and height
for single-head configurations. Use these when creating the
DisplaySurface in the local renderer.
This fixes a rendering issue with wayland. Wayland rounds up the
framebuffer width and height to a multiple of 64, so with odd
resolutions (800x600 for example) the framebuffer is larger than the
actual screen. The monitor config has the actual screen size though.
This fixes guest display for anything using the local renderer
(non-spice UI, screendump monitor command).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20180919103057.9666-1-kraxel@redhat.com
Diffstat (limited to 'hw/display/qxl-render.c')
-rw-r--r-- | hw/display/qxl-render.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index c62b9a5e75..6debe8fc11 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -98,6 +98,8 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) { VGACommonState *vga = &qxl->vga; DisplaySurface *surface; + int width = qxl->guest_head0_width ?: qxl->guest_primary.surface.width; + int height = qxl->guest_head0_height ?: qxl->guest_primary.surface.height; int i; if (qxl->guest_primary.resized) { @@ -111,8 +113,8 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) qxl_set_rect_to_surface(qxl, &qxl->dirty[0]); qxl->num_dirty_rects = 1; trace_qxl_render_guest_primary_resized( - qxl->guest_primary.surface.width, - qxl->guest_primary.surface.height, + width, + height, qxl->guest_primary.qxl_stride, qxl->guest_primary.bytes_pp, qxl->guest_primary.bits_pp); @@ -120,15 +122,15 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) pixman_format_code_t format = qemu_default_pixman_format(qxl->guest_primary.bits_pp, true); surface = qemu_create_displaysurface_from - (qxl->guest_primary.surface.width, - qxl->guest_primary.surface.height, + (width, + height, format, qxl->guest_primary.abs_stride, qxl->guest_primary.data); } else { surface = qemu_create_displaysurface - (qxl->guest_primary.surface.width, - qxl->guest_primary.surface.height); + (width, + height); } dpy_gfx_replace_surface(vga->con, surface); } @@ -144,8 +146,8 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) qxl->dirty[i].top < 0 || qxl->dirty[i].left > qxl->dirty[i].right || qxl->dirty[i].top > qxl->dirty[i].bottom || - qxl->dirty[i].right > qxl->guest_primary.surface.width || - qxl->dirty[i].bottom > qxl->guest_primary.surface.height) { + qxl->dirty[i].right > width || + qxl->dirty[i].bottom > height) { continue; } qxl_blit(qxl, qxl->dirty+i); |