Lines Matching +full:hot +full:- +full:plug
1 // SPDX-License-Identifier: MIT
3 * Copyright (C) 2016-2017 Oracle Corporation
27 return readl(vbox->guest_heap + HOST_FLAGS_OFFSET); in vbox_get_flags()
32 schedule_work(&vbox->hotplug_work); in vbox_report_hotplug()
45 * Due to a bug in the initial host implementation of hot-plug irqs, in vbox_irq_handler()
46 * the hot-plug and cursor capability flags were never cleared. in vbox_irq_handler()
73 for (i = 0; i < vbox->num_crtcs; ++i) { in validate_or_set_position_hints()
75 hintsi = &vbox->last_mode_hints[i]; in validate_or_set_position_hints()
76 hintsj = &vbox->last_mode_hints[j]; in validate_or_set_position_hints()
78 if (hintsi->enabled && hintsj->enabled) { in validate_or_set_position_hints()
79 if (hintsi->dx >= 0xffff || in validate_or_set_position_hints()
80 hintsi->dy >= 0xffff || in validate_or_set_position_hints()
81 hintsj->dx >= 0xffff || in validate_or_set_position_hints()
82 hintsj->dy >= 0xffff || in validate_or_set_position_hints()
83 (hintsi->dx < in validate_or_set_position_hints()
84 hintsj->dx + (hintsj->cx & 0x8fff) && in validate_or_set_position_hints()
85 hintsi->dx + (hintsi->cx & 0x8fff) > in validate_or_set_position_hints()
86 hintsj->dx) || in validate_or_set_position_hints()
87 (hintsi->dy < in validate_or_set_position_hints()
88 hintsj->dy + (hintsj->cy & 0x8fff) && in validate_or_set_position_hints()
89 hintsi->dy + (hintsi->cy & 0x8fff) > in validate_or_set_position_hints()
90 hintsj->dy)) in validate_or_set_position_hints()
96 for (i = 0; i < vbox->num_crtcs; ++i) { in validate_or_set_position_hints()
97 if (vbox->last_mode_hints[i].enabled) { in validate_or_set_position_hints()
98 vbox->last_mode_hints[i].dx = currentx; in validate_or_set_position_hints()
99 vbox->last_mode_hints[i].dy = 0; in validate_or_set_position_hints()
101 vbox->last_mode_hints[i].cx & 0x8fff; in validate_or_set_position_hints()
110 struct drm_device *dev = &vbox->ddev; in vbox_update_mode_hints()
119 ret = hgsmi_get_mode_hints(vbox->guest_pool, vbox->num_crtcs, in vbox_update_mode_hints()
120 vbox->last_mode_hints); in vbox_update_mode_hints()
128 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); in vbox_update_mode_hints()
133 hints = &vbox->last_mode_hints[vbox_conn->vbox_crtc->crtc_id]; in vbox_update_mode_hints()
134 if (hints->magic != VBVAMODEHINT_MAGIC) in vbox_update_mode_hints()
137 disconnected = !(hints->enabled); in vbox_update_mode_hints()
138 crtc_id = vbox_conn->vbox_crtc->crtc_id; in vbox_update_mode_hints()
139 vbox_conn->mode_hint.width = hints->cx; in vbox_update_mode_hints()
140 vbox_conn->mode_hint.height = hints->cy; in vbox_update_mode_hints()
141 vbox_conn->vbox_crtc->x_hint = hints->dx; in vbox_update_mode_hints()
142 vbox_conn->vbox_crtc->y_hint = hints->dy; in vbox_update_mode_hints()
143 vbox_conn->mode_hint.disconnected = disconnected; in vbox_update_mode_hints()
145 if (vbox_conn->vbox_crtc->disconnected == disconnected) in vbox_update_mode_hints()
153 hgsmi_process_display_info(vbox->guest_pool, crtc_id, 0, 0, 0, in vbox_update_mode_hints()
154 hints->cx * 4, hints->cx, in vbox_update_mode_hints()
155 hints->cy, 0, flags); in vbox_update_mode_hints()
157 vbox_conn->vbox_crtc->disconnected = disconnected; in vbox_update_mode_hints()
160 drm_modeset_unlock(&dev->mode_config.connection_mutex); in vbox_update_mode_hints()
169 drm_kms_helper_hotplug_event(&vbox->ddev); in vbox_hotplug_worker()
174 struct drm_device *dev = &vbox->ddev; in vbox_irq_init()
175 struct pci_dev *pdev = to_pci_dev(dev->dev); in vbox_irq_init()
177 INIT_WORK(&vbox->hotplug_work, vbox_hotplug_worker); in vbox_irq_init()
181 return request_irq(pdev->irq, vbox_irq_handler, IRQF_SHARED, dev->driver->name, dev); in vbox_irq_init()
186 struct drm_device *dev = &vbox->ddev; in vbox_irq_fini()
187 struct pci_dev *pdev = to_pci_dev(dev->dev); in vbox_irq_fini()
189 free_irq(pdev->irq, dev); in vbox_irq_fini()
190 flush_work(&vbox->hotplug_work); in vbox_irq_fini()