}
}
-const GraphicHwOps virtio_gpu_ops = {
+static const GraphicHwOps virtio_gpu_ops = {
.invalidate = virtio_gpu_invalidate_display,
.gfx_update = virtio_gpu_update_display,
.text_update = virtio_gpu_text_update,
g->req_state[0].width = g->conf.xres;
g->req_state[0].height = g->conf.yres;
+ g->hw_ops = &virtio_gpu_ops;
for (i = 0; i < g->conf.max_outputs; i++) {
g->scanout[i].con =
graphic_console_init(DEVICE(g), i, &virtio_gpu_ops, g);
VirtIOGPUBase *g = vvga->vgpu;
if (g->enable) {
- virtio_gpu_ops.invalidate(g);
+ g->hw_ops->invalidate(g);
} else {
vvga->vga.hw_ops->invalidate(&vvga->vga);
}
VirtIOGPUBase *g = vvga->vgpu;
if (g->enable) {
- virtio_gpu_ops.gfx_update(g);
+ g->hw_ops->gfx_update(g);
} else {
vvga->vga.hw_ops->gfx_update(&vvga->vga);
}
VirtIOGPUBase *g = vvga->vgpu;
if (g->enable) {
- if (virtio_gpu_ops.text_update) {
- virtio_gpu_ops.text_update(g, chardata);
+ if (g->hw_ops->text_update) {
+ g->hw_ops->text_update(g, chardata);
}
} else {
if (vvga->vga.hw_ops->text_update) {
VirtIOVGABase *vvga = opaque;
VirtIOGPUBase *g = vvga->vgpu;
- if (virtio_gpu_ops.ui_info) {
- return virtio_gpu_ops.ui_info(g, idx, info);
+ if (g->hw_ops->ui_info) {
+ return g->hw_ops->ui_info(g, idx, info);
}
return -1;
}
VirtIOVGABase *vvga = opaque;
VirtIOGPUBase *g = vvga->vgpu;
- if (virtio_gpu_ops.gl_block) {
- virtio_gpu_ops.gl_block(g, block);
+ if (g->hw_ops->gl_block) {
+ g->hw_ops->gl_block(g, block);
}
}
struct virtio_gpu_base_conf conf;
struct virtio_gpu_config virtio_config;
+ const GraphicHwOps *hw_ops;
bool use_virgl_renderer;
int renderer_blocked;
bool backend_blocked;
};
-extern const GraphicHwOps virtio_gpu_ops;
-
#define VIRTIO_GPU_FILL_CMD(out) do { \
size_t s; \
s = iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \