Lines Matching refs:vbox

20 void vbox_report_caps(struct vbox_private *vbox)  in vbox_report_caps()  argument
26 hgsmi_send_caps_info(vbox->guest_pool, caps); in vbox_report_caps()
28 hgsmi_send_caps_info(vbox->guest_pool, caps); in vbox_report_caps()
31 static int vbox_accel_init(struct vbox_private *vbox) in vbox_accel_init() argument
36 vbox->vbva_info = devm_kcalloc(vbox->ddev.dev, vbox->num_crtcs, in vbox_accel_init()
37 sizeof(*vbox->vbva_info), GFP_KERNEL); in vbox_accel_init()
38 if (!vbox->vbva_info) in vbox_accel_init()
42 vbox->available_vram_size -= vbox->num_crtcs * VBVA_MIN_BUFFER_SIZE; in vbox_accel_init()
44 vbox->vbva_buffers = pci_iomap_range(vbox->ddev.pdev, 0, in vbox_accel_init()
45 vbox->available_vram_size, in vbox_accel_init()
46 vbox->num_crtcs * in vbox_accel_init()
48 if (!vbox->vbva_buffers) in vbox_accel_init()
51 for (i = 0; i < vbox->num_crtcs; ++i) { in vbox_accel_init()
52 vbva_setup_buffer_context(&vbox->vbva_info[i], in vbox_accel_init()
53 vbox->available_vram_size + in vbox_accel_init()
56 vbva = (void __force *)vbox->vbva_buffers + in vbox_accel_init()
58 if (!vbva_enable(&vbox->vbva_info[i], in vbox_accel_init()
59 vbox->guest_pool, vbva, i)) { in vbox_accel_init()
68 static void vbox_accel_fini(struct vbox_private *vbox) in vbox_accel_fini() argument
72 for (i = 0; i < vbox->num_crtcs; ++i) in vbox_accel_fini()
73 vbva_disable(&vbox->vbva_info[i], vbox->guest_pool, i); in vbox_accel_fini()
77 static bool have_hgsmi_mode_hints(struct vbox_private *vbox) in have_hgsmi_mode_hints() argument
82 ret = hgsmi_query_conf(vbox->guest_pool, in have_hgsmi_mode_hints()
88 ret = hgsmi_query_conf(vbox->guest_pool, in have_hgsmi_mode_hints()
107 int vbox_hw_init(struct vbox_private *vbox) in vbox_hw_init() argument
111 vbox->full_vram_size = inl(VBE_DISPI_IOPORT_DATA); in vbox_hw_init()
112 vbox->any_pitch = vbox_check_supported(VBE_DISPI_ID_ANYX); in vbox_hw_init()
114 DRM_INFO("VRAM %08x\n", vbox->full_vram_size); in vbox_hw_init()
117 vbox->guest_heap = in vbox_hw_init()
118 pci_iomap_range(vbox->ddev.pdev, 0, GUEST_HEAP_OFFSET(vbox), in vbox_hw_init()
120 if (!vbox->guest_heap) in vbox_hw_init()
124 vbox->guest_pool = devm_gen_pool_create(vbox->ddev.dev, 4, -1, in vbox_hw_init()
126 if (!vbox->guest_pool) in vbox_hw_init()
129 ret = gen_pool_add_virt(vbox->guest_pool, in vbox_hw_init()
130 (unsigned long)vbox->guest_heap, in vbox_hw_init()
131 GUEST_HEAP_OFFSET(vbox), in vbox_hw_init()
136 ret = hgsmi_test_query_conf(vbox->guest_pool); in vbox_hw_init()
143 vbox->available_vram_size = GUEST_HEAP_OFFSET(vbox); in vbox_hw_init()
145 hgsmi_query_conf(vbox->guest_pool, VBOX_VBVA_CONF32_MONITOR_COUNT, in vbox_hw_init()
146 &vbox->num_crtcs); in vbox_hw_init()
147 vbox->num_crtcs = clamp_t(u32, vbox->num_crtcs, 1, VBOX_MAX_SCREENS); in vbox_hw_init()
149 if (!have_hgsmi_mode_hints(vbox)) { in vbox_hw_init()
154 vbox->last_mode_hints = devm_kcalloc(vbox->ddev.dev, vbox->num_crtcs, in vbox_hw_init()
157 if (!vbox->last_mode_hints) in vbox_hw_init()
160 ret = vbox_accel_init(vbox); in vbox_hw_init()
167 void vbox_hw_fini(struct vbox_private *vbox) in vbox_hw_fini() argument
169 vbox_accel_fini(vbox); in vbox_hw_fini()