Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/hw/fb/vt_fb.c
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | case FBIO_GETLINEWIDTH: /* get scan line width in bytes */ | ||||
break; | break; | ||||
case FBIO_BLANK: /* blank display */ | case FBIO_BLANK: /* blank display */ | ||||
if (vd->vd_driver->vd_blank == NULL) | if (vd->vd_driver->vd_blank == NULL) | ||||
return (ENODEV); | return (ENODEV); | ||||
vd->vd_driver->vd_blank(vd, TC_BLACK); | vd->vd_driver->vd_blank(vd, TC_BLACK); | ||||
break; | break; | ||||
case FBIO_GETRGBOFFS: /* get RGB offsets */ | |||||
if (info->fb_rgboffs.red == 0 && info->fb_rgboffs.green == 0 && | |||||
info->fb_rgboffs.blue == 0) | |||||
return (ENOTTY); | |||||
memcpy((struct fb_rgboffs *)data, &info->fb_rgboffs, | |||||
sizeof(struct fb_rgboffs)); | |||||
break; | |||||
default: | default: | ||||
error = ENOIOCTL; | error = ENOIOCTL; | ||||
break; | break; | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | vt_fb_postswitch(struct vt_device *vd) | ||||
info = vd->vd_softc; | info = vd->vd_softc; | ||||
if (info->enter != NULL) | if (info->enter != NULL) | ||||
info->enter(info->fb_priv); | info->enter(info->fb_priv); | ||||
} | } | ||||
static int | static int | ||||
vt_fb_init_cmap(uint32_t *cmap, int depth) | vt_fb_init_colors(struct fb_info *info) | ||||
{ | { | ||||
switch (depth) { | switch (FBTYPE_GET_BPP(info)) { | ||||
case 8: | case 8: | ||||
return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, | return (vt_config_cons_colors(info, COLOR_FORMAT_RGB, | ||||
0x7, 5, 0x7, 2, 0x3, 0)); | 0x7, 5, 0x7, 2, 0x3, 0)); | ||||
case 15: | case 15: | ||||
return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, | return (vt_config_cons_colors(info, COLOR_FORMAT_RGB, | ||||
0x1f, 10, 0x1f, 5, 0x1f, 0)); | 0x1f, 10, 0x1f, 5, 0x1f, 0)); | ||||
case 16: | case 16: | ||||
return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, | return (vt_config_cons_colors(info, COLOR_FORMAT_RGB, | ||||
0x1f, 11, 0x3f, 5, 0x1f, 0)); | 0x1f, 11, 0x3f, 5, 0x1f, 0)); | ||||
case 24: | case 24: | ||||
case 32: /* Ignore alpha. */ | case 32: /* Ignore alpha. */ | ||||
return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, | return (vt_config_cons_colors(info, COLOR_FORMAT_RGB, | ||||
0xff, 16, 0xff, 8, 0xff, 0)); | 0xff, 16, 0xff, 8, 0xff, 0)); | ||||
default: | default: | ||||
return (1); | return (1); | ||||
} | } | ||||
} | } | ||||
int | int | ||||
vt_fb_init(struct vt_device *vd) | vt_fb_init(struct vt_device *vd) | ||||
Show All 14 Lines | vt_fb_init(struct vt_device *vd) | ||||
if (info->fb_size == 0) | if (info->fb_size == 0) | ||||
return (CN_DEAD); | return (CN_DEAD); | ||||
if (info->fb_pbase == 0 && info->fb_vbase == 0) | if (info->fb_pbase == 0 && info->fb_vbase == 0) | ||||
info->fb_flags |= FB_FLAG_NOMMAP; | info->fb_flags |= FB_FLAG_NOMMAP; | ||||
if (info->fb_cmsize <= 0) { | if (info->fb_cmsize <= 0) { | ||||
err = vt_fb_init_cmap(info->fb_cmap, FBTYPE_GET_BPP(info)); | err = vt_fb_init_colors(info); | ||||
if (err) | if (err) | ||||
return (CN_DEAD); | return (CN_DEAD); | ||||
info->fb_cmsize = 16; | info->fb_cmsize = 16; | ||||
} | } | ||||
c = TC_BLACK; | c = TC_BLACK; | ||||
if (TUNABLE_INT_FETCH("teken.bg_color", &bg) != 0) { | if (TUNABLE_INT_FETCH("teken.bg_color", &bg) != 0) { | ||||
if (bg == TC_WHITE) | if (bg == TC_WHITE) | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |