summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-08-24 22:35:53 +0000
committerdelphij <delphij@FreeBSD.org>2009-08-24 22:35:53 +0000
commit61c6f92db746bbaecfcb483bc8fa324850441377 (patch)
tree187aa455a488727beb12177256456d18dc1419c5 /sys/dev/syscons
parent3a41c4b88f4f3873ec4514afdfcaf68f8915fe2e (diff)
downloadFreeBSD-src-61c6f92db746bbaecfcb483bc8fa324850441377.zip
FreeBSD-src-61c6f92db746bbaecfcb483bc8fa324850441377.tar.gz
Fix VESA modes and allow 8bit depth modes.
PR: i386/124902 Submitted by: paradox <ddkprog yahoo com> MFC after: 2 months
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/scvgarndr.c20
-rw-r--r--sys/dev/syscons/scvidctl.c4
2 files changed, 23 insertions, 1 deletions
diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c
index 1ab41d2..fd823ce 100644
--- a/sys/dev/syscons/scvgarndr.c
+++ b/sys/dev/syscons/scvgarndr.c
@@ -193,6 +193,8 @@ static u_short mouse_or_mask[16] = {
case 15: \
writew(pos, vga_palette15[color]); \
break; \
+ case 8: \
+ writeb(pos, (uint8_t)color); \
}
static uint32_t vga_palette32[16] = {
@@ -215,6 +217,7 @@ static uint16_t vga_palette15[16] = {
#ifndef SC_NO_CUTPASTE
static uint32_t mouse_buf32[256];
static uint16_t mouse_buf16[256];
+static uint8_t mouse_buf8[256];
#endif
#endif
@@ -498,7 +501,9 @@ vga_rndrinit(scr_stat *scp)
scp->rndr->draw_cursor = vga_pxlcursor_planar;
scp->rndr->blink_cursor = vga_pxlblink_planar;
scp->rndr->draw_mouse = vga_pxlmouse_planar;
- } else if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) {
+ } else
+ if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT ||
+ scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_PACKED) {
scp->rndr->clear = vga_pxlclear_direct;
scp->rndr->draw_border = vga_pxlborder_direct;
scp->rndr->draw = vga_vgadraw_direct;
@@ -1148,6 +1153,7 @@ vga_pxlmouse_direct(scr_stat *scp, int x, int y, int on)
int i, j;
uint32_t *u32;
uint16_t *u16;
+ uint8_t *u8;
int bpp;
if (!on)
@@ -1179,6 +1185,10 @@ vga_pxlmouse_direct(scr_stat *scp, int x, int y, int on)
u16 = (uint16_t*)(p + j * pixel_size);
writew(u16, mouse_buf16[i * 16 + j]);
break;
+ case 8:
+ u8 = (uint8_t*)(p + j * pixel_size);
+ writeb(u8, mouse_buf8[i * 16 + j]);
+ break;
}
}
@@ -1214,6 +1224,14 @@ vga_pxlmouse_direct(scr_stat *scp, int x, int y, int on)
else if (mouse_and_mask[i] & (1 << (15 - j)))
writew(u16, 0);
break;
+ case 8:
+ u8 = (uint8_t*)(p + j * pixel_size);
+ mouse_buf8[i * 16 + j] = *u8;
+ if (mouse_or_mask[i] & (1 << (15 - j)))
+ writeb(u8, 15);
+ else if (mouse_and_mask[i] & (1 << (15 - j)))
+ writeb(u8, 0);
+ break;
}
}
diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c
index 045f79f..d481e06 100644
--- a/sys/dev/syscons/scvidctl.c
+++ b/sys/dev/syscons/scvidctl.c
@@ -391,6 +391,10 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
(info.vi_depth != 15) && (info.vi_depth != 16) &&
(info.vi_depth != 24) && (info.vi_depth != 32))
return ENODEV;
+ } else if (info.vi_mem_model == V_INFO_MM_PACKED) {
+ if (!(info.vi_flags & V_INFO_LINEAR) &&
+ (info.vi_depth != 8))
+ return ENODEV;
} else
return ENODEV;
OpenPOWER on IntegriCloud