Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/hw/ofwfb/ofwfb.c
Show First 20 Lines • Show All 394 Lines • ▼ Show 20 Lines | find_pci_host_address(phandle_t node) | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
ofwfb_initialize(struct vt_device *vd) | ofwfb_initialize(struct vt_device *vd) | ||||
{ | { | ||||
struct ofwfb_softc *sc = vd->vd_softc; | struct ofwfb_softc *sc = vd->vd_softc; | ||||
int i, err; | int i, err, r, g, b; | ||||
cell_t retval; | cell_t retval; | ||||
sc->fb.fb_cmsize = 16; | sc->fb.fb_cmsize = 16; | ||||
if (sc->fb.fb_flags & FB_FLAG_NOWRITE) | if (sc->fb.fb_flags & FB_FLAG_NOWRITE) | ||||
return; | return; | ||||
/* | /* | ||||
* Set up the color map | * Set up the color map | ||||
*/ | */ | ||||
sc->iso_palette = 0; | sc->iso_palette = 0; | ||||
switch (sc->fb.fb_bpp) { | switch (sc->fb.fb_bpp) { | ||||
case 8: | case 8: | ||||
/* | /* | ||||
* No color format issues here, since we are passing the RGB | * No color format issues here, since we are passing the RGB | ||||
* components separately to Open Firmware. | * components separately to Open Firmware. | ||||
*/ | */ | ||||
vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, | vt_config_cons_colors(&sc->fb, COLOR_FORMAT_RGB, 255, | ||||
16, 255, 8, 255, 0); | 16, 255, 8, 255, 0); | ||||
for (i = 0; i < 16; i++) { | for (i = 0; i < 16; i++) { | ||||
err = OF_call_method("color!", sc->sc_handle, 4, 1, | err = OF_call_method("color!", sc->sc_handle, 4, 1, | ||||
(cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff), | (cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff), | ||||
(cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff), | (cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff), | ||||
(cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff), | (cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff), | ||||
(cell_t)i, &retval); | (cell_t)i, &retval); | ||||
Show All 21 Lines | case 32: | ||||
if (sc->vendor_id == PCI_VID_NVIDIA) | if (sc->vendor_id == PCI_VID_NVIDIA) | ||||
sc->argb = 0; | sc->argb = 0; | ||||
else | else | ||||
sc->argb = 1; | sc->argb = 1; | ||||
TUNABLE_INT_FETCH("hw.ofwfb.argb32_pixel", &sc->argb); | TUNABLE_INT_FETCH("hw.ofwfb.argb32_pixel", &sc->argb); | ||||
if (sc->endian_flip) { | if (sc->endian_flip) { | ||||
if (sc->argb) | if (sc->argb) | ||||
vt_generate_cons_palette(sc->fb.fb_cmap, | r = 8, g = 16, b = 24; | ||||
COLOR_FORMAT_RGB, 255, 8, 255, 16, 255, 24); | |||||
else | else | ||||
vt_generate_cons_palette(sc->fb.fb_cmap, | r = 24, g = 16, b = 8; | ||||
COLOR_FORMAT_RGB, 255, 24, 255, 16, 255, 8); | |||||
} else { | } else { | ||||
if (sc->argb) | if (sc->argb) | ||||
vt_generate_cons_palette(sc->fb.fb_cmap, | r = 16, g = 8, b = 0; | ||||
COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); | |||||
else | else | ||||
vt_generate_cons_palette(sc->fb.fb_cmap, | r = 0, g = 8, b = 16; | ||||
COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16); | |||||
} | } | ||||
vt_config_cons_colors(&sc->fb, | |||||
COLOR_FORMAT_RGB, 255, r, 255, g, 255, b); | |||||
break; | break; | ||||
default: | default: | ||||
panic("Unknown color space depth %d", sc->fb.fb_bpp); | panic("Unknown color space depth %d", sc->fb.fb_bpp); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines |