static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)

{

    VGACommonState *vga = &qxl->vga;

    int i;



    if (qxl->guest_primary.resized) {

        qxl->guest_primary.resized = 0;

        qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram);

        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,

               qxl->guest_primary.qxl_stride,

               qxl->guest_primary.bytes_pp,

               qxl->guest_primary.bits_pp);

        if (qxl->guest_primary.qxl_stride > 0) {

            qemu_free_displaysurface(vga->ds);

            qemu_create_displaysurface_from(qxl->guest_primary.surface.width,

                                            qxl->guest_primary.surface.height,

                                            qxl->guest_primary.bits_pp,

                                            qxl->guest_primary.abs_stride,

                                            qxl->guest_primary.data);

        } else {

            qemu_resize_displaysurface(vga->ds,

                    qxl->guest_primary.surface.width,

                    qxl->guest_primary.surface.height);

        }

        dpy_gfx_resize(vga->ds);

    }

    for (i = 0; i < qxl->num_dirty_rects; i++) {

        if (qemu_spice_rect_is_empty(qxl->dirty+i)) {

            break;

        }

        qxl_blit(qxl, qxl->dirty+i);

        dpy_gfx_update(vga->ds,

                       qxl->dirty[i].left, qxl->dirty[i].top,

                       qxl->dirty[i].right - qxl->dirty[i].left,

                       qxl->dirty[i].bottom - qxl->dirty[i].top);

    }

    qxl->num_dirty_rects = 0;

}

static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)

{

    VGACommonState *vga = &qxl->vga;

    int i;



    if (qxl->guest_primary.resized) {

        qxl->guest_primary.resized = 0;

        qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram);

        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,

               qxl->guest_primary.qxl_stride,

               qxl->guest_primary.bytes_pp,

               qxl->guest_primary.bits_pp);

        if (qxl->guest_primary.qxl_stride > 0) {

            qemu_free_displaysurface(vga->ds);

            qemu_create_displaysurface_from(qxl->guest_primary.surface.width,

                                            qxl->guest_primary.surface.height,

                                            qxl->guest_primary.bits_pp,

                                            qxl->guest_primary.abs_stride,

                                            qxl->guest_primary.data);

        } else {

            qemu_resize_displaysurface(vga->ds,

                    qxl->guest_primary.surface.width,

                    qxl->guest_primary.surface.height);

        }

        dpy_gfx_resize(vga->ds);

    }

    for (i = 0; i < qxl->num_dirty_rects; i++) {

        if (qemu_spice_rect_is_empty(qxl->dirty+i)) {

            break;

        }

        qxl_blit(qxl, qxl->dirty+i);

        dpy_gfx_update(vga->ds,

                       qxl->dirty[i].left, qxl->dirty[i].top,

                       qxl->dirty[i].right - qxl->dirty[i].left,

                       qxl->dirty[i].bottom - qxl->dirty[i].top);

    }

    qxl->num_dirty_rects = 0;

}

static void FUNC_0(PCIQXLDevice *VAR_0)

{

    VGACommonState *vga = &VAR_0->vga;

    int VAR_1;



    if (VAR_0->guest_primary.resized) {

        VAR_0->guest_primary.resized = 0;

        VAR_0->guest_primary.data = memory_region_get_ram_ptr(&VAR_0->vga.vram);

        qxl_set_rect_to_surface(VAR_0, &VAR_0->dirty[0]);

        VAR_0->num_dirty_rects = 1;

        trace_qxl_render_guest_primary_resized(

               VAR_0->guest_primary.surface.width,

               VAR_0->guest_primary.surface.height,

               VAR_0->guest_primary.qxl_stride,

               VAR_0->guest_primary.bytes_pp,

               VAR_0->guest_primary.bits_pp);

        if (VAR_0->guest_primary.qxl_stride > 0) {

            qemu_free_displaysurface(vga->ds);

            qemu_create_displaysurface_from(VAR_0->guest_primary.surface.width,

                                            VAR_0->guest_primary.surface.height,

                                            VAR_0->guest_primary.bits_pp,

                                            VAR_0->guest_primary.abs_stride,

                                            VAR_0->guest_primary.data);

        } else {

            qemu_resize_displaysurface(vga->ds,

                    VAR_0->guest_primary.surface.width,

                    VAR_0->guest_primary.surface.height);

        }

        dpy_gfx_resize(vga->ds);

    }

    for (VAR_1 = 0; VAR_1 < VAR_0->num_dirty_rects; VAR_1++) {

        if (qemu_spice_rect_is_empty(VAR_0->dirty+VAR_1)) {

            break;

        }

        qxl_blit(VAR_0, VAR_0->dirty+VAR_1);

        dpy_gfx_update(vga->ds,

                       VAR_0->dirty[VAR_1].left, VAR_0->dirty[VAR_1].top,

                       VAR_0->dirty[VAR_1].right - VAR_0->dirty[VAR_1].left,

                       VAR_0->dirty[VAR_1].bottom - VAR_0->dirty[VAR_1].top);

    }

    VAR_0->num_dirty_rects = 0;

}

static void FUNC_0(PCIQXLDevice *VAR_0)
{ VGACommonState *vga = &VAR_0->vga; int VAR_1; if (VAR_0->guest_primary.resized) { VAR_0->guest_primary.resized = 0; VAR_0->guest_primary.data = memory_region_get_ram_ptr(&VAR_0->vga.vram); qxl_set_rect_to_surface(VAR_0, &VAR_0->dirty[0]); VAR_0->num_dirty_rects = 1; trace_qxl_render_guest_primary_resized(
VAR_0->guest_primary.surface.width,
VAR_0->guest_primary.surface.height,
VAR_0->guest_primary.qxl_stride,
VAR_0->guest_primary.bytes_pp,
VAR_0->guest_primary.bits_pp); if (VAR_0->guest_primary.qxl_stride > 0) { qemu_free_displaysurface(vga->ds); qemu_create_displaysurface_from(VAR_0->guest_primary.surface.width,
VAR_0->guest_primary.surface.height,
VAR_0->guest_primary.bits_pp,
VAR_0->guest_primary.abs_stride,
VAR_0->guest_primary.data); } else { qemu_resize_displaysurface(vga->ds,
VAR_0->guest_primary.surface.width,
VAR_0->guest_primary.surface.height); } dpy_gfx_resize(vga->ds); } for (VAR_1 = 0; VAR_1 < VAR_0->num_dirty_rects; VAR_1++) { if (qemu_spice_rect_is_empty(VAR_0->dirty+VAR_1)) { break; } qxl_blit(VAR_0, VAR_0->dirty+VAR_1); dpy_gfx_update(vga->ds,
VAR_0->dirty[VAR_1].left, VAR_0->dirty[VAR_1].top,
VAR_0->dirty[VAR_1].right - VAR_0->dirty[VAR_1].left,
VAR_0->dirty[VAR_1].bottom - VAR_0->dirty[VAR_1].top); } VAR_0->num_dirty_rects = 0; }