int i;
g->enable = 0;
- g->use_virgl_renderer = false;
for (i = 0; i < g->conf.max_outputs; i++) {
g->scanout[i].resource_id = 0;
return false;
}
- g->use_virgl_renderer = false;
if (virtio_gpu_virgl_enabled(g->conf)) {
error_setg(&g->migration_blocker, "virgl is not yet migratable");
if (migrate_add_blocker(g->migration_blocker, errp) < 0) {
virtio_gpu_base_set_features(VirtIODevice *vdev, uint64_t features)
{
static const uint32_t virgl = (1 << VIRTIO_GPU_F_VIRGL);
- VirtIOGPUBase *g = VIRTIO_GPU_BASE(vdev);
- g->use_virgl_renderer = ((features & virgl) == virgl);
- trace_virtio_gpu_features(g->use_virgl_renderer);
+ trace_virtio_gpu_features(((features & virgl) == virgl));
}
static void
uint32_t width, height;
uint32_t pixels, *data;
- if (g->parent_obj.use_virgl_renderer) {
- data = virgl_renderer_get_cursor_data(resource_id, &width, &height);
- if (!data) {
- return;
- }
-
- if (width != s->current_cursor->width ||
- height != s->current_cursor->height) {
- free(data);
- return;
- }
-
- pixels = s->current_cursor->width * s->current_cursor->height;
- memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t));
- free(data);
+ data = virgl_renderer_get_cursor_data(resource_id, &width, &height);
+ if (!data) {
return;
}
- virtio_gpu_update_cursor_data(g, s, resource_id);
-}
-static void virtio_gpu_gl_process_cmd(VirtIOGPU *g,
- struct virtio_gpu_ctrl_command *cmd)
-{
- if (g->parent_obj.use_virgl_renderer) {
- virtio_gpu_virgl_process_cmd(g, cmd);
+ if (width != s->current_cursor->width ||
+ height != s->current_cursor->height) {
+ free(data);
return;
}
- virtio_gpu_simple_process_cmd(g, cmd);
+
+ pixels = s->current_cursor->width * s->current_cursor->height;
+ memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t));
+ free(data);
}
static void virtio_gpu_gl_flushed(VirtIOGPUBase *b)
return;
}
- if (!g->renderer_inited && g->parent_obj.use_virgl_renderer) {
+ if (!g->renderer_inited) {
virtio_gpu_virgl_init(g);
g->renderer_inited = true;
}
}
virtio_gpu_process_cmdq(g);
-
- if (g->parent_obj.use_virgl_renderer) {
- virtio_gpu_virgl_fence_poll(g);
- }
+ virtio_gpu_virgl_fence_poll(g);
}
static void virtio_gpu_gl_reset(VirtIODevice *vdev)
virtio_gpu_reset(vdev);
- if (g->parent_obj.use_virgl_renderer) {
+ if (g->renderer_inited) {
if (g->parent_obj.renderer_blocked) {
g->renderer_reset = true;
} else {
virtio_gpu_virgl_reset(g);
}
- g->parent_obj.use_virgl_renderer = false;
}
}
vbc->gl_flushed = virtio_gpu_gl_flushed;
vgc->handle_ctrl = virtio_gpu_gl_handle_ctrl;
- vgc->process_cmd = virtio_gpu_gl_process_cmd;
+ vgc->process_cmd = virtio_gpu_virgl_process_cmd;
vgc->update_cursor_data = virtio_gpu_gl_update_cursor_data;
vdc->realize = virtio_gpu_gl_device_realize;