Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/fb/vesa.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
static vi_blank_display_t vesa_blank_display; | static vi_blank_display_t vesa_blank_display; | ||||
static vi_mmap_t vesa_mmap; | static vi_mmap_t vesa_mmap; | ||||
static vi_ioctl_t vesa_ioctl; | static vi_ioctl_t vesa_ioctl; | ||||
static vi_clear_t vesa_clear; | static vi_clear_t vesa_clear; | ||||
static vi_fill_rect_t vesa_fill_rect; | static vi_fill_rect_t vesa_fill_rect; | ||||
static vi_bitblt_t vesa_bitblt; | static vi_bitblt_t vesa_bitblt; | ||||
static vi_diag_t vesa_diag; | static vi_diag_t vesa_diag; | ||||
static int vesa_bios_info(int level); | static int vesa_bios_info(int level); | ||||
static int vesa_late_load(int flags); | |||||
static video_switch_t vesavidsw = { | static video_switch_t vesavidsw = { | ||||
vesa_probe, | vesa_probe, | ||||
vesa_init, | vesa_init, | ||||
vesa_get_info, | vesa_get_info, | ||||
vesa_query_mode, | vesa_query_mode, | ||||
vesa_set_mode, | vesa_set_mode, | ||||
vesa_save_font, | vesa_save_font, | ||||
▲ Show 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | vesa_configure(int flags) | ||||
/* | /* | ||||
* The VGA adapter is not found. This is because either | * The VGA adapter is not found. This is because either | ||||
* 1) the VGA driver has not been initialized, or 2) the VGA card | * 1) the VGA driver has not been initialized, or 2) the VGA card | ||||
* is not present. If 1) is the case, we shall defer | * is not present. If 1) is the case, we shall defer | ||||
* initialization for now and try again later. | * initialization for now and try again later. | ||||
*/ | */ | ||||
if (adp == NULL) { | if (adp == NULL) { | ||||
vga_sub_configure = vesa_configure; | vga_sub_configure = vesa_late_load; | ||||
return (ENODEV); | return (ENODEV); | ||||
} | } | ||||
/* count number of registered adapters */ | /* count number of registered adapters */ | ||||
for (++i; vid_get_adapter(i) != NULL; ++i) | for (++i; vid_get_adapter(i) != NULL; ++i) | ||||
; | ; | ||||
adapters = i; | adapters = i; | ||||
▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Lines | #endif /* VESA_DEBUG > 1 */ | ||||
return (0); | return (0); | ||||
} | } | ||||
/* module loading */ | /* module loading */ | ||||
static int | static int | ||||
vesa_load(void) | vesa_load(void) | ||||
{ | { | ||||
return (vesa_late_load(0)); | |||||
} | |||||
/* | |||||
* To be called from the vga_sub_configure hook in case the VGA adapter is | |||||
* not found when VESA is loaded. | |||||
*/ | |||||
static int | |||||
vesa_late_load(int flags) | |||||
{ | |||||
int error; | int error; | ||||
if (vesa_init_done) | if (vesa_init_done) | ||||
return (0); | return (0); | ||||
mtx_init(&vesa_lock, "VESA lock", NULL, MTX_DEF); | mtx_init(&vesa_lock, "VESA lock", NULL, MTX_DEF); | ||||
/* locate a VGA adapter */ | /* locate a VGA adapter */ | ||||
vesa_adp = NULL; | vesa_adp = NULL; | ||||
error = vesa_configure(0); | error = vesa_configure(flags); | ||||
if (error == 0) | if (error == 0) | ||||
vesa_bios_info(bootverbose); | vesa_bios_info(bootverbose); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |