Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/freescale/imx/imx51_ipuv3_fbd.c
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | ipu3_fb_init(struct ipu3sc_softc *sc) | ||||
/* XXX: fetch or set it from/to IPU. */ | /* XXX: fetch or set it from/to IPU. */ | ||||
sc->sc_info.fb_bpp = sc->sc_info.fb_depth = sc->sc_info.fb_stride / | sc->sc_info.fb_bpp = sc->sc_info.fb_depth = sc->sc_info.fb_stride / | ||||
sc->sc_info.fb_width * 8; | sc->sc_info.fb_width * 8; | ||||
} | } | ||||
/* Use own color map, because of different RGB offset. */ | /* Use own color map, because of different RGB offset. */ | ||||
static int | static int | ||||
ipu3_fb_init_cmap(uint32_t *cmap, int bytespp) | ipu3_fb_init_colors(struct fb_info *info) | ||||
{ | { | ||||
switch (bytespp) { | switch (info->fb_depth) { | ||||
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, 0, 0xff, 8, 0xff, 16)); | 0xff, 0, 0xff, 8, 0xff, 16)); | ||||
default: | default: | ||||
return (1); | return (1); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
ipu3_fb_probe(device_t dev) | ipu3_fb_probe(device_t dev) | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* We have to wait until interrupts are enabled. | * We have to wait until interrupts are enabled. | ||||
* Mailbox relies on it to get data from VideoCore | * Mailbox relies on it to get data from VideoCore | ||||
*/ | */ | ||||
ipu3_fb_init(sc); | ipu3_fb_init(sc); | ||||
sc->sc_info.fb_name = device_get_nameunit(dev); | sc->sc_info.fb_name = device_get_nameunit(dev); | ||||
ipu3_fb_init_cmap(sc->sc_info.fb_cmap, sc->sc_info.fb_depth); | ipu3_fb_init_colors(&sc->sc_info); | ||||
sc->sc_info.fb_cmsize = 16; | sc->sc_info.fb_cmsize = 16; | ||||
/* Ask newbus to attach framebuffer device to me. */ | /* Ask newbus to attach framebuffer device to me. */ | ||||
sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); | sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); | ||||
if (sc->sc_fbd == NULL) | if (sc->sc_fbd == NULL) | ||||
device_printf(dev, "Can't attach fbd device\n"); | device_printf(dev, "Can't attach fbd device\n"); | ||||
return (bus_generic_attach(dev)); | return (bus_generic_attach(dev)); | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |