Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/vt_core.c
Show First 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | |||||
/* Initialize locks/mem depended members. */ | /* Initialize locks/mem depended members. */ | ||||
static void | static void | ||||
vt_update_static(void *dummy) | vt_update_static(void *dummy) | ||||
{ | { | ||||
if (!vty_enabled(VTY_VT)) | if (!vty_enabled(VTY_VT)) | ||||
return; | return; | ||||
if (vm_guest != VM_GUEST_HV) { | |||||
if (main_vd->vd_driver != NULL) | if (main_vd->vd_driver != NULL) | ||||
printf("VT(%s): %s %ux%u\n", main_vd->vd_driver->vd_name, | printf("VT(%s): %s %ux%u\n", main_vd->vd_driver->vd_name, | ||||
(main_vd->vd_flags & VDF_TEXTMODE) ? "text" : "resolution", | (main_vd->vd_flags & VDF_TEXTMODE) ? "text" : "resolution", | ||||
main_vd->vd_width, main_vd->vd_height); | main_vd->vd_width, main_vd->vd_height); | ||||
else | else | ||||
printf("VT: init without driver.\n"); | printf("VT: init without driver.\n"); | ||||
} | |||||
mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); | mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); | ||||
cv_init(&main_vd->vd_winswitch, "vtwswt"); | cv_init(&main_vd->vd_winswitch, "vtwswt"); | ||||
} | } | ||||
static void | static void | ||||
vt_schedule_flush(struct vt_device *vd, int ms) | vt_schedule_flush(struct vt_device *vd, int ms) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 2,838 Lines • ▼ Show 20 Lines | |||||
vt_allocate(const struct vt_driver *drv, void *softc) | vt_allocate(const struct vt_driver *drv, void *softc) | ||||
{ | { | ||||
if (!vty_enabled(VTY_VT)) | if (!vty_enabled(VTY_VT)) | ||||
return; | return; | ||||
if (main_vd->vd_driver == NULL) { | if (main_vd->vd_driver == NULL) { | ||||
main_vd->vd_driver = drv; | main_vd->vd_driver = drv; | ||||
if (vm_guest != VM_GUEST_HV) | |||||
printf("VT: initialize with new VT driver \"%s\".\n", | printf("VT: initialize with new VT driver \"%s\".\n", | ||||
drv->vd_name); | drv->vd_name); | ||||
} else { | } else { | ||||
/* | /* | ||||
* Check if have rights to replace current driver. For example: | * Check if have rights to replace current driver. For example: | ||||
* it is bad idea to replace KMS driver with generic VGA one. | * it is bad idea to replace KMS driver with generic VGA one. | ||||
*/ | */ | ||||
if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { | if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { | ||||
if (vm_guest != VM_GUEST_HV) | |||||
printf("VT: Driver priority %d too low. Current %d\n ", | printf("VT: Driver priority %d too low. Current %d\n ", | ||||
drv->vd_priority, main_vd->vd_driver->vd_priority); | drv->vd_priority, main_vd->vd_driver->vd_priority); | ||||
return; | return; | ||||
} | } | ||||
if (vm_guest != VM_GUEST_HV) | |||||
printf("VT: Replacing driver \"%s\" with new \"%s\".\n", | printf("VT: Replacing driver \"%s\" with new \"%s\".\n", | ||||
main_vd->vd_driver->vd_name, drv->vd_name); | main_vd->vd_driver->vd_name, drv->vd_name); | ||||
} | } | ||||
vt_replace_backend(drv, softc); | vt_replace_backend(drv, softc); | ||||
} | } | ||||
void | void | ||||
vt_deallocate(const struct vt_driver *drv, void *softc) | vt_deallocate(const struct vt_driver *drv, void *softc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |