summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2014-08-21 10:18:42 +0000
committerdumbbell <dumbbell@FreeBSD.org>2014-08-21 10:18:42 +0000
commit9ac8060e5711317f8497c0f9c9e623976d50560f (patch)
tree9857b66e11d5d2c4491f9f808b5ca53979afcff1 /sys/arm
parent644cd5de6d91256b5541170968a9f8ddcd2e6ee5 (diff)
downloadFreeBSD-src-9ac8060e5711317f8497c0f9c9e623976d50560f.zip
FreeBSD-src-9ac8060e5711317f8497c0f9c9e623976d50560f.tar.gz
vt(4): Colors are indexed against a console palette, not a VGA palette
Rename vt_generate_vga_palette() to vt_generate_cons_palette() and change it to build a palette where the color index is the same than in terminal escape codes, not the VGA index. That's what TCHAR_CREATE() uses and passes to vt(4). The main differences between both orders are: o Blue and red are swapped (1 <-> 4) o Yellow and cyan are swapped (3 <-> 6) The problem remained unnoticed, because the RGB bit indexes passed to vt_generate_vga_palette() were reversed. This inversion was cancelled by the colors inversions in the generated palette. For instance, red (0xff0000) and blue (0x0000ff) have bytes in opposite order, but were swapped in the palette. But after changing the value of blue (see last paragraph), the modified color was in fact the red one. While here, tune the palette to better match console colors and improve the readability (especially the dark blue). This is an MFC of r269783 and r269791.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/freescale/imx/imx51_ipuv3_fbd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arm/freescale/imx/imx51_ipuv3_fbd.c b/sys/arm/freescale/imx/imx51_ipuv3_fbd.c
index 25d17c7..4828240 100644
--- a/sys/arm/freescale/imx/imx51_ipuv3_fbd.c
+++ b/sys/arm/freescale/imx/imx51_ipuv3_fbd.c
@@ -163,18 +163,18 @@ ipu3_fb_init_cmap(uint32_t *cmap, int bytespp)
switch (bytespp) {
case 8:
- return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB,
+ return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB,
0x7, 5, 0x7, 2, 0x3, 0));
case 15:
- return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB,
+ return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB,
0x1f, 10, 0x1f, 5, 0x1f, 0));
case 16:
- return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB,
+ return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB,
0x1f, 11, 0x3f, 5, 0x1f, 0));
case 24:
case 32: /* Ignore alpha. */
- return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB,
- 0xff, 16, 0xff, 8, 0xff, 0));
+ return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB,
+ 0xff, 0, 0xff, 8, 0xff, 16));
default:
return (1);
}
OpenPOWER on IntegriCloud