summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/sbus/cgsix.c13
-rw-r--r--sys/dev/sbus/cgsixreg.h6
2 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 3e3646ea4cf..fc9cba7cf8e 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.25 2002/07/30 18:07:02 jason Exp $ */
+/* $OpenBSD: cgsix.c,v 1.26 2002/07/30 23:03:30 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -319,13 +319,18 @@ cgsix_ioctl(v, cmd, data, flags, p)
struct wsdisplay_cmap *cm;
struct wsdisplay_fbinfo *wdf;
int error;
+ u_int mode;
switch (cmd) {
case WSDISPLAYIO_GTYPE:
*(u_int *)data = WSDISPLAY_TYPE_UNKNOWN;
break;
case WSDISPLAYIO_SMODE:
- sc->sc_mode = *(u_int *)data;
+ mode = *(u_int *)data;
+ if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL &&
+ mode == WSDISPLAYIO_MODE_EMUL)
+ cgsix_ras_init(sc);
+ sc->sc_mode = mode;
break;
case WSDISPLAYIO_GINFO:
wdf = (void *)data;
@@ -734,12 +739,8 @@ cgsix_ras_init(sc)
CG6_DRAIN(sc);
m = FBC_READ(sc, CG6_FBC_MODE);
m &= ~FBC_MODE_MASK;
-#if 0
- /* XXX doesn't work as advertised */
- FBC_WRITE(sc, CG6_FBC_MODE, m);
m |= FBC_MODE_VAL;
FBC_WRITE(sc, CG6_FBC_MODE, m);
-#endif
}
void
diff --git a/sys/dev/sbus/cgsixreg.h b/sys/dev/sbus/cgsixreg.h
index 31478041dfa..226b9e196bc 100644
--- a/sys/dev/sbus/cgsixreg.h
+++ b/sys/dev/sbus/cgsixreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsixreg.h,v 1.2 2002/07/30 18:07:02 jason Exp $ */
+/* $OpenBSD: cgsixreg.h,v 1.3 2002/07/30 23:03:30 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -111,7 +111,7 @@ union bt_cmap {
#define CG6_FBC_ARECTX 0x900 /* rectangle drawing, x coord */
#define CG6_FBC_ARECTY 0x904 /* rectangle drawing, y coord */
-#define FBC_MODE_MASK ( \
+#define FBC_MODE_VAL ( \
0x00200000 /* GX_BLIT_SRC */ \
| 0x00020000 /* GX_MODE_COLOR8 */ \
| 0x00008000 /* GX_DRAW_RENDER */ \
@@ -120,7 +120,7 @@ union bt_cmap {
| 0x00000200 /* GX_BREAD_0 */ \
| 0x00000080 /* GX_BDISP_0 */ \
)
-#define FBC_MODE_VAL ( \
+#define FBC_MODE_MASK ( \
0x00300000 /* GX_BLIT_ALL */ \
| 0x00060000 /* GX_MODE_ALL */ \
| 0x00018000 /* GX_DRAW_ALL */ \