aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-13 16:06:29 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-13 16:12:14 -0800
commit8757d29f82fbb4edfbfe2010e34a0d3b198edf9f (patch)
tree2990737fe8eb171f68536582cfbf89b4908a38ab
parentf7122d423f1eba4e2c620c7599d59d78e9315112 (diff)
downloadsyslinux-8757d29f82fbb4edfbfe2010e34a0d3b198edf9f.tar.gz
syslinux-8757d29f82fbb4edfbfe2010e34a0d3b198edf9f.tar.xz
syslinux-8757d29f82fbb4edfbfe2010e34a0d3b198edf9f.zip
VESA: Support 15-bit RGB modes.
If there are manufacturers which don't support linear framebuffers out there, then there is probably someone who want a 15-bit mode, too.
-rw-r--r--com32/lib/sys/vesa/fmtpixel.h12
-rw-r--r--com32/lib/sys/vesa/initvesa.c5
-rw-r--r--com32/lib/sys/vesa/video.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/com32/lib/sys/vesa/fmtpixel.h b/com32/lib/sys/vesa/fmtpixel.h
index 6221c0ec..dcde0109 100644
--- a/com32/lib/sys/vesa/fmtpixel.h
+++ b/com32/lib/sys/vesa/fmtpixel.h
@@ -66,6 +66,18 @@ static inline __attribute__((always_inline))
}
break;
+ case PXF_LE_RGB15_555:
+ {
+ uint16_t pxv =
+ ((bgra >> 3) & 0x1f) +
+ ((bgra >> (2+8-5)) & (0x1f << 5)) +
+ ((bgra >> (3+16-10)) & (0x1f << 10));
+
+ *(uint16_t *)ptr = pxv;
+ ptr = (uint16_t *)ptr + 1;
+ }
+ break;
+
case PXF_NONE: /* Shuts up gcc */
break;
}
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index d8fb85d3..abea95aa 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -212,6 +212,11 @@ static int vesacon_set_mode(void)
(mi->memory_layout == 6 && mi->rpos == 11 && mi->gpos == 5 &&
mi->bpos == 0)))
pxf = PXF_LE_RGB16_565;
+ else if (mi->bpp == 15 &&
+ (mi->memory_layout == 4 ||
+ (mi->memory_layout == 6 && mi->rpos == 10 && mi->gpos == 5 &&
+ mi->bpos == 0)))
+ pxf = PXF_LE_RGB15_555;
if (pxf < bestpxf) {
debug("Best mode so far, pxf = %d\n", pxf);
diff --git a/com32/lib/sys/vesa/video.h b/com32/lib/sys/vesa/video.h
index f9b3e5da..699d4e9a 100644
--- a/com32/lib/sys/vesa/video.h
+++ b/com32/lib/sys/vesa/video.h
@@ -55,6 +55,7 @@ enum vesa_pixel_format {
PXF_BGR24, /* 24-bit BGR */
PXF_BGRA32, /* 32-bit BGRA */
PXF_LE_RGB16_565, /* 16-bit littleendian 5:6:5 RGB */
+ PXF_LE_RGB15_555, /* 15-bit littleendian 5:5:5 RGB */
PXF_NONE
};