summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-03-31 17:34:16 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-03-31 17:34:16 +0000
commitcf3885a7e2cad8f88ec46d49abf29cf90926ca49 (patch)
tree752c8c89c49ef53b5d75230ffd6811ae01a967ab /sys/dev/wscons
parent2dba0c0f5d8a7bf90d6d659b8566c1ffe32ef68f (diff)
add a new mode to wsdisplay, WSDISPLAYIO_MODE_DUMBFB. This mode is
functionally equivalent what used to be WSDISPLAYIO_MODE_MAPPED, which now means a "native" mapping. vgafb_mmap() returns pci relative mappings in WSDISPLAYIO_MODE_MAPPED and linear framebuffer mappings in WSDISPLAYIO_MODE_DUMBFB
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r--sys/dev/wscons/wsconsio.h3
-rw-r--r--sys/dev/wscons/wsdisplay.c24
2 files changed, 20 insertions, 7 deletions
diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h
index d36a48966fe..1e3d98ea86f 100644
--- a/sys/dev/wscons/wsconsio.h
+++ b/sys/dev/wscons/wsconsio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsconsio.h,v 1.15 2002/03/27 18:54:09 jbm Exp $ */
+/* $OpenBSD: wsconsio.h,v 1.16 2002/03/31 17:34:15 jason Exp $ */
/* $NetBSD: wsconsio.h,v 1.31.2.1 2000/07/07 09:49:17 hannken Exp $ */
/*
@@ -314,6 +314,7 @@ struct wsdisplay_cursor {
#define WSDISPLAYIO_SMODE _IOW('W', 76, u_int)
#define WSDISPLAYIO_MODE_EMUL 0 /* emulation (text) mode */
#define WSDISPLAYIO_MODE_MAPPED 1 /* mapped (graphics) mode */
+#define WSDISPLAYIO_MODE_DUMBFB 2 /* mapped (graphics) fb mode */
struct wsdisplay_font {
char name[WSFONT_NAME_SIZE];
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 50ac76f1cd5..e83ad68a370 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.41 2002/03/27 18:54:09 jbm Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.42 2002/03/31 17:34:15 jason Exp $ */
/* $NetBSD: wsdisplay.c,v 1.37.4.1 2000/06/30 16:27:53 simonb Exp $ */
/*
@@ -98,6 +98,7 @@ struct wsscreen {
#define SCR_OPEN 1 /* is it open? */
#define SCR_WAITACTIVE 2 /* someone waiting on activation */
#define SCR_GRAPHICS 4 /* graphics mode, no text (emulation) output */
+#define SCR_DUMBFB 8 /* in use as dumb framebuffer (iff SCR_GRAPHICS) */
const struct wscons_syncops *scr_syncops;
void *scr_synccookie;
@@ -1066,19 +1067,30 @@ wsdisplay_internal_ioctl(sc, scr, cmd, data, flag, p)
switch (cmd) {
case WSDISPLAYIO_GMODE:
- *(u_int *)data = (scr->scr_flags & SCR_GRAPHICS ?
- WSDISPLAYIO_MODE_MAPPED : WSDISPLAYIO_MODE_EMUL);
+ if (scr->scr_flags & SCR_GRAPHICS) {
+ if (scr->scr_flags & SCR_DUMBFB)
+ *(u_int *)data = WSDISPLAYIO_MODE_DUMBFB;
+ else
+ *(u_int *)data = WSDISPLAYIO_MODE_MAPPED;
+ } else
+ *(u_int *)data = WSDISPLAYIO_MODE_EMUL;
return (0);
case WSDISPLAYIO_SMODE:
#define d (*(int *)data)
- if (d != WSDISPLAYIO_MODE_EMUL && d != WSDISPLAYIO_MODE_MAPPED)
+ if (d != WSDISPLAYIO_MODE_EMUL &&
+ d != WSDISPLAYIO_MODE_MAPPED &&
+ d != WSDISPLAYIO_MODE_DUMBFB)
return (EINVAL);
if (WSSCREEN_HAS_EMULATOR(scr)) {
scr->scr_flags &= ~SCR_GRAPHICS;
- if (d == WSDISPLAYIO_MODE_MAPPED) {
- scr->scr_flags |= SCR_GRAPHICS;
+ if (d == WSDISPLAYIO_MODE_MAPPED ||
+ d == WSDISPLAYIO_MODE_DUMBFB) {
+ scr->scr_flags |= SCR_GRAPHICS |
+ ((d == WSDISPLAYIO_MODE_DUMBFB) ?
+ SCR_DUMBFB : 0);
+
/*
* wsmoused cohabitation with X-Window support
* X-Window is starting