diff options
author | Leandro Lupori <luporl@FreeBSD.org> | 2021-11-25 18:54:11 +0000 |
---|---|---|
committer | Leandro Lupori <luporl@FreeBSD.org> | 2021-11-25 19:39:25 +0000 |
commit | b9f3b63ab21ed5d1288de1acff511eb733201139 (patch) | |
tree | 9fb18ee9c34c0b60fd1ddfcf3f74ff867e587f99 /sys/arm/freescale/imx/imx51_ipuv3_fbd.c | |
parent | b19740f4ce7a542783f87de2fee48476a7801d86 (diff) | |
download | src-b9f3b63ab21ed5d1288de1acff511eb733201139.tar.gz src-b9f3b63ab21ed5d1288de1acff511eb733201139.zip |
vt: export RGB offsets with FBIO_GETRGBOFFS
Add a new ioctl to vt to make it possible to export RGB offsets
set by vt drivers. This is needed to fix colors on X and Mesa
on some machines, especially on modern PowerPC64 BE ones.
With the appropriate changes in SCFB, to use this ioctl to find
out the correct RGB offsets, this fixes wrong colors on Talos II
and Blackbird, when used with their built-in video cards.
Reviewed by: alfredo
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D29000
Diffstat (limited to 'sys/arm/freescale/imx/imx51_ipuv3_fbd.c')
-rw-r--r-- | sys/arm/freescale/imx/imx51_ipuv3_fbd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arm/freescale/imx/imx51_ipuv3_fbd.c b/sys/arm/freescale/imx/imx51_ipuv3_fbd.c index 644664fa8aa3..be1526228bf4 100644 --- a/sys/arm/freescale/imx/imx51_ipuv3_fbd.c +++ b/sys/arm/freescale/imx/imx51_ipuv3_fbd.c @@ -156,22 +156,22 @@ ipu3_fb_init(struct ipu3sc_softc *sc) /* Use own color map, because of different RGB offset. */ 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: - return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, + return (vt_config_cons_colors(info, COLOR_FORMAT_RGB, 0x7, 5, 0x7, 2, 0x3, 0)); 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)); 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)); case 24: 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)); default: return (1); @@ -303,7 +303,7 @@ ipu3_fb_attach(device_t 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; /* Ask newbus to attach framebuffer device to me. */ |