static void virtio_gpu_reset(VirtIODevice *vdev)

{

    VirtIOGPU *g = VIRTIO_GPU(vdev);

    struct virtio_gpu_simple_resource *res, *tmp;

    int i;



    g->enable = 0;



    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {

        virtio_gpu_resource_destroy(g, res);

    }

    for (i = 0; i < g->conf.max_outputs; i++) {

#if 0

        g->req_state[i].x = 0;

        g->req_state[i].y = 0;

        if (i == 0) {

            g->req_state[0].width = 1024;

            g->req_state[0].height = 768;

        } else {

            g->req_state[i].width = 0;

            g->req_state[i].height = 0;

        }

#endif

        g->scanout[i].resource_id = 0;

        g->scanout[i].width = 0;

        g->scanout[i].height = 0;

        g->scanout[i].x = 0;

        g->scanout[i].y = 0;

        g->scanout[i].ds = NULL;

    }

    g->enabled_output_bitmask = 1;



#ifdef CONFIG_VIRGL

    if (g->use_virgl_renderer) {

        virtio_gpu_virgl_reset(g);

        g->use_virgl_renderer = 0;

    }

#endif

}

static void virtio_gpu_reset(VirtIODevice *vdev)

{

    VirtIOGPU *g = VIRTIO_GPU(vdev);

    struct virtio_gpu_simple_resource *res, *tmp;

    int i;



    g->enable = 0;



    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {

        virtio_gpu_resource_destroy(g, res);

    }

    for (i = 0; i < g->conf.max_outputs; i++) {

#if 0

        g->req_state[i].x = 0;

        g->req_state[i].y = 0;

        if (i == 0) {

            g->req_state[0].width = 1024;

            g->req_state[0].height = 768;

        } else {

            g->req_state[i].width = 0;

            g->req_state[i].height = 0;

        }

#endif

        g->scanout[i].resource_id = 0;

        g->scanout[i].width = 0;

        g->scanout[i].height = 0;

        g->scanout[i].x = 0;

        g->scanout[i].y = 0;

        g->scanout[i].ds = NULL;

    }

    g->enabled_output_bitmask = 1;



#ifdef CONFIG_VIRGL

    if (g->use_virgl_renderer) {

        virtio_gpu_virgl_reset(g);

        g->use_virgl_renderer = 0;

    }

#endif

}

#if 0         g->req_state[i].x = 0;         g->req_state[i].y = 0;         if (i == 0) {             g->req_state[0].width = 1024;             g->req_state[0].height = 768;         } else {             g->req_state[i].width = 0;             g->req_state[i].height = 0; #endif     g->enabled_output_bitmask = 1;
static void FUNC_0(VirtIODevice *VAR_0)

{

    VirtIOGPU *g = VIRTIO_GPU(VAR_0);

    struct virtio_gpu_simple_resource *VAR_1, *VAR_2;

    int VAR_3;



    g->enable = 0;



    QTAILQ_FOREACH_SAFE(VAR_1, &g->reslist, next, VAR_2) {

        virtio_gpu_resource_destroy(g, VAR_1);

    }

    for (VAR_3 = 0; VAR_3 < g->conf.max_outputs; VAR_3++) {

#if 0

        g->req_state[VAR_3].x = 0;

        g->req_state[VAR_3].y = 0;

        if (VAR_3 == 0) {

            g->req_state[0].width = 1024;

            g->req_state[0].height = 768;

        } else {

            g->req_state[VAR_3].width = 0;

            g->req_state[VAR_3].height = 0;

        }

#endif

        g->scanout[VAR_3].resource_id = 0;

        g->scanout[VAR_3].width = 0;

        g->scanout[VAR_3].height = 0;

        g->scanout[VAR_3].x = 0;

        g->scanout[VAR_3].y = 0;

        g->scanout[VAR_3].ds = NULL;

    }

    g->enabled_output_bitmask = 1;



#ifdef CONFIG_VIRGL

    if (g->use_virgl_renderer) {

        virtio_gpu_virgl_reset(g);

        g->use_virgl_renderer = 0;

    }

#endif

}

static void FUNC_0(VirtIODevice *VAR_0)
{ VirtIOGPU *g = VIRTIO_GPU(VAR_0); struct virtio_gpu_simple_resource *VAR_1, *VAR_2; int VAR_3; g->enable = 0; QTAILQ_FOREACH_SAFE(VAR_1, &g->reslist, next, VAR_2) { virtio_gpu_resource_destroy(g, VAR_1); } for (VAR_3 = 0; VAR_3 < g->conf.max_outputs; VAR_3++) { #if 0
g->req_state[VAR_3].x = 0; g->req_state[VAR_3].y = 0; if (VAR_3 == 0) { g->req_state[0].width = 1024; g->req_state[0].height = 768; } else { g->req_state[VAR_3].width = 0; g->req_state[VAR_3].height = 0; } #endif
g->scanout[VAR_3].resource_id = 0; g->scanout[VAR_3].width = 0; g->scanout[VAR_3].height = 0; g->scanout[VAR_3].x = 0; g->scanout[VAR_3].y = 0; g->scanout[VAR_3].ds = NULL; } g->enabled_output_bitmask = 1; #ifdef CONFIG_VIRGL
if (g->use_virgl_renderer) { virtio_gpu_virgl_reset(g); g->use_virgl_renderer = 0; } #endif
}