static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)

{

    VGACommonState *vga = &qxl->vga;

    DisplaySurface *surface;

    int i;



    if (qxl->guest_primary.resized) {

        qxl->guest_primary.resized = 0;

        qxl->guest_primary.data = qxl_phys2virt(qxl,

                                                qxl->guest_primary.surface.mem,

                                                MEMSLOT_GROUP_GUEST);

        if (!qxl->guest_primary.data) {

            return;

        }

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

            surface = 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,

                 false);

        } else {

            surface = qemu_create_displaysurface

                (qxl->guest_primary.surface.width,

                 qxl->guest_primary.surface.height);

        }

        dpy_gfx_replace_surface(vga->con, surface);

    }



    if (!qxl->guest_primary.data) {

        return;

    }

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

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

            break;

        }

        if (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) {

            continue;

        }

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

        dpy_gfx_update(vga->con,

                       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;

    DisplaySurface *surface;

    int i;



    if (qxl->guest_primary.resized) {

        qxl->guest_primary.resized = 0;

        qxl->guest_primary.data = qxl_phys2virt(qxl,

                                                qxl->guest_primary.surface.mem,

                                                MEMSLOT_GROUP_GUEST);

        if (!qxl->guest_primary.data) {

            return;

        }

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

            surface = 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,

                 false);

        } else {

            surface = qemu_create_displaysurface

                (qxl->guest_primary.surface.width,

                 qxl->guest_primary.surface.height);

        }

        dpy_gfx_replace_surface(vga->con, surface);

    }



    if (!qxl->guest_primary.data) {

        return;

    }

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

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

            break;

        }

        if (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) {

            continue;

        }

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

        dpy_gfx_update(vga->con,

                       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;

}

        if (qxl->dirty[i].left > qxl->dirty[i].right ||
static void FUNC_0(PCIQXLDevice *VAR_0)

{

    VGACommonState *vga = &VAR_0->vga;

    DisplaySurface *surface;

    int VAR_1;



    if (VAR_0->guest_primary.resized) {

        VAR_0->guest_primary.resized = 0;

        VAR_0->guest_primary.data = qxl_phys2virt(VAR_0,

                                                VAR_0->guest_primary.surface.mem,

                                                MEMSLOT_GROUP_GUEST);

        if (!VAR_0->guest_primary.data) {

            return;

        }

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

            surface = 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,

                 false);

        } else {

            surface = qemu_create_displaysurface

                (VAR_0->guest_primary.surface.width,

                 VAR_0->guest_primary.surface.height);

        }

        dpy_gfx_replace_surface(vga->con, surface);

    }



    if (!VAR_0->guest_primary.data) {

        return;

    }

    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;

        }

        if (VAR_0->dirty[VAR_1].left > VAR_0->dirty[VAR_1].right ||

            VAR_0->dirty[VAR_1].top > VAR_0->dirty[VAR_1].bottom ||

            VAR_0->dirty[VAR_1].right > VAR_0->guest_primary.surface.width ||

            VAR_0->dirty[VAR_1].bottom > VAR_0->guest_primary.surface.height) {

            continue;

        }

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

        dpy_gfx_update(vga->con,

                       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; DisplaySurface *surface; int VAR_1; if (VAR_0->guest_primary.resized) { VAR_0->guest_primary.resized = 0; VAR_0->guest_primary.data = qxl_phys2virt(VAR_0,
VAR_0->guest_primary.surface.mem,
MEMSLOT_GROUP_GUEST); if (!VAR_0->guest_primary.data) { return; } 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) { surface = 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,
false); } else { surface = qemu_create_displaysurface
(VAR_0->guest_primary.surface.width,
VAR_0->guest_primary.surface.height); } dpy_gfx_replace_surface(vga->con, surface); } if (!VAR_0->guest_primary.data) { return; } 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; } if (VAR_0->dirty[VAR_1].left > VAR_0->dirty[VAR_1].right ||
VAR_0->dirty[VAR_1].top > VAR_0->dirty[VAR_1].bottom ||
VAR_0->dirty[VAR_1].right > VAR_0->guest_primary.surface.width ||
VAR_0->dirty[VAR_1].bottom > VAR_0->guest_primary.surface.height) { continue; } qxl_blit(VAR_0, VAR_0->dirty+VAR_1); dpy_gfx_update(vga->con,
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; }