Lines Matching +full:- +full:- +full:-

3 #include "hw/qdev-properties.h"
4 #include "hw/virtio/virtio-gpu.h"
7 #include "virtio-vga.h"
13 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_invalidate_display()
15 if (g->enable) { in virtio_vga_base_invalidate_display()
16 g->hw_ops->invalidate(g); in virtio_vga_base_invalidate_display()
18 vvga->vga.hw_ops->invalidate(&vvga->vga); in virtio_vga_base_invalidate_display()
25 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_update_display()
27 if (g->enable) { in virtio_vga_base_update_display()
28 g->hw_ops->gfx_update(g); in virtio_vga_base_update_display()
30 vvga->vga.hw_ops->gfx_update(&vvga->vga); in virtio_vga_base_update_display()
37 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_text_update()
39 if (g->enable) { in virtio_vga_base_text_update()
40 if (g->hw_ops->text_update) { in virtio_vga_base_text_update()
41 g->hw_ops->text_update(g, chardata); in virtio_vga_base_text_update()
44 if (vvga->vga.hw_ops->text_update) { in virtio_vga_base_text_update()
45 vvga->vga.hw_ops->text_update(&vvga->vga, chardata); in virtio_vga_base_text_update()
53 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_ui_info()
55 if (g->hw_ops->ui_info) { in virtio_vga_base_ui_info()
56 g->hw_ops->ui_info(g, idx, info); in virtio_vga_base_ui_info()
63 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_gl_block()
65 if (g->hw_ops->gl_block) { in virtio_vga_base_gl_block()
66 g->hw_ops->gl_block(g, block); in virtio_vga_base_gl_block()
73 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_get_flags()
75 return g->hw_ops->get_flags(g); in virtio_vga_base_get_flags()
88 .name = "virtio-vga",
103 VirtIOGPUBase *g = vvga->vgpu; in virtio_vga_base_realize()
104 VGACommonState *vga = &vvga->vga; in virtio_vga_base_realize()
109 vga->vram_size_mb = 8; in virtio_vga_base_realize()
113 vga_init(vga, OBJECT(vpci_dev), pci_address_space(&vpci_dev->pci_dev), in virtio_vga_base_realize()
114 pci_address_space_io(&vpci_dev->pci_dev), true); in virtio_vga_base_realize()
115 pci_register_bar(&vpci_dev->pci_dev, 0, in virtio_vga_base_realize()
116 PCI_BASE_ADDRESS_MEM_PREFETCH, &vga->vram); in virtio_vga_base_realize()
118 vpci_dev->modern_io_bar_idx = 5; in virtio_vga_base_realize()
120 if (!virtio_gpu_hostmem_enabled(g->conf)) { in virtio_vga_base_realize()
128 vpci_dev->modern_mem_bar_idx = 2; in virtio_vga_base_realize()
129 vpci_dev->msix_bar_idx = 4; in virtio_vga_base_realize()
131 vpci_dev->msix_bar_idx = 1; in virtio_vga_base_realize()
132 vpci_dev->modern_mem_bar_idx = 2; in virtio_vga_base_realize()
133 memory_region_init(&g->hostmem, OBJECT(g), "virtio-gpu-hostmem", in virtio_vga_base_realize()
134 g->conf.hostmem); in virtio_vga_base_realize()
135 pci_register_bar(&vpci_dev->pci_dev, 4, in virtio_vga_base_realize()
139 &g->hostmem); in virtio_vga_base_realize()
140 virtio_pci_add_shm_cap(vpci_dev, 4, 0, g->conf.hostmem, in virtio_vga_base_realize()
144 if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) { in virtio_vga_base_realize()
146 * with page-per-vq=off there is no padding space we can use in virtio_vga_base_realize()
150 vpci_dev->common.size /= 2; in virtio_vga_base_realize()
151 vpci_dev->isr.size /= 2; in virtio_vga_base_realize()
154 offset = memory_region_size(&vpci_dev->modern_bar); in virtio_vga_base_realize()
155 offset -= vpci_dev->notify.size; in virtio_vga_base_realize()
156 vpci_dev->notify.offset = offset; in virtio_vga_base_realize()
157 offset -= vpci_dev->device.size; in virtio_vga_base_realize()
158 vpci_dev->device.offset = offset; in virtio_vga_base_realize()
159 offset -= vpci_dev->isr.size; in virtio_vga_base_realize()
160 vpci_dev->isr.offset = offset; in virtio_vga_base_realize()
161 offset -= vpci_dev->common.size; in virtio_vga_base_realize()
162 vpci_dev->common.offset = offset; in virtio_vga_base_realize()
166 if (!qdev_realize(DEVICE(g), BUS(&vpci_dev->bus), errp)) { in virtio_vga_base_realize()
171 pci_std_vga_mmio_region_init(vga, OBJECT(vvga), &vpci_dev->modern_bar, in virtio_vga_base_realize()
172 vvga->vga_mrs, true, false); in virtio_vga_base_realize()
174 vga->con = g->scanout[0].con; in virtio_vga_base_realize()
175 graphic_console_set_hwops(vga->con, &virtio_vga_base_ops, vvga); in virtio_vga_base_realize()
177 for (i = 0; i < g->conf.max_outputs; i++) { in virtio_vga_base_realize()
178 object_property_set_link(OBJECT(g->scanout[i].con), "device", in virtio_vga_base_realize()
188 /* reset virtio-gpu */ in virtio_vga_base_reset_hold()
189 if (klass->parent_phases.hold) { in virtio_vga_base_reset_hold()
190 klass->parent_phases.hold(obj, type); in virtio_vga_base_reset_hold()
194 vga_common_reset(&vvga->vga); in virtio_vga_base_reset_hold()
195 vga_dirty_log_start(&vvga->vga); in virtio_vga_base_reset_hold()
202 return d->vga.big_endian_fb; in virtio_vga_get_big_endian_fb()
209 d->vga.big_endian_fb = value; in virtio_vga_set_big_endian_fb()
224 set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); in virtio_vga_base_class_init()
226 dc->vmsd = &vmstate_virtio_vga_base; in virtio_vga_base_class_init()
227 dc->hotpluggable = false; in virtio_vga_base_class_init()
229 NULL, &v->parent_phases); in virtio_vga_base_class_init()
231 k->realize = virtio_vga_base_realize; in virtio_vga_base_class_init()
232 pcidev_k->romfile = "vgabios-virtio.bin"; in virtio_vga_base_class_init()
233 pcidev_k->class_id = PCI_CLASS_DISPLAY_VGA; in virtio_vga_base_class_init()
236 object_class_property_add_bool(klass, "big-endian-framebuffer", in virtio_vga_base_class_init()
252 #define TYPE_VIRTIO_VGA "virtio-vga"
268 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), in virtio_vga_inst_initfn()
270 VIRTIO_VGA_BASE(dev)->vgpu = VIRTIO_GPU_BASE(&dev->vdev); in virtio_vga_inst_initfn()