summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/sparc/dev/fb.c43
-rw-r--r--sys/arch/sparc64/dev/creator.c4
-rw-r--r--sys/arch/sparc64/dev/fb.c42
-rw-r--r--sys/dev/sbus/agten.c11
-rw-r--r--sys/dev/wscons/wsdisplayvar.h11
-rw-r--r--sys/dev/wscons/wsemul_sun.c10
6 files changed, 52 insertions, 69 deletions
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c
index 33c91e963c7..4d1d520ac03 100644
--- a/sys/arch/sparc/dev/fb.c
+++ b/sys/arch/sparc/dev/fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fb.c,v 1.37 2006/06/29 17:54:30 miod Exp $ */
+/* $OpenBSD: fb.c,v 1.38 2006/06/30 21:38:17 miod Exp $ */
/* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */
/*
@@ -370,19 +370,21 @@ fbwscons_init(struct sunfb *sf, int flags)
void
fbwscons_console_init(struct sunfb *sf, int row)
{
+ struct rasops_info *ri = &sf->sf_ro;
+ int32_t tmp;
long defattr;
if (CPU_ISSUN4 || romgetcursoraddr(&sf->sf_crowp, &sf->sf_ccolp))
sf->sf_ccolp = sf->sf_crowp = NULL;
if (sf->sf_ccolp != NULL)
- sf->sf_ro.ri_ccol = *sf->sf_ccolp;
+ ri->ri_ccol = *sf->sf_ccolp;
if (row < 0) {
if (sf->sf_crowp != NULL)
- sf->sf_ro.ri_crow = *sf->sf_crowp;
+ ri->ri_crow = *sf->sf_crowp;
else
/* assume last row */
- sf->sf_ro.ri_crow = sf->sf_ro.ri_rows - 1;
+ ri->ri_crow = ri->ri_rows - 1;
} else {
/*
* If we force the display row, this is because the screen
@@ -392,45 +394,44 @@ fbwscons_console_init(struct sunfb *sf, int row)
* upon shutdown...
*/
sf->sf_crowp = sf->sf_ccolp = NULL;
- sf->sf_ro.ri_crow = row;
+ ri->ri_crow = row;
}
/*
* Scale back rows and columns if the font would not otherwise
* fit on this display. Without this we would panic later.
*/
- if (sf->sf_ro.ri_crow >= sf->sf_ro.ri_rows)
- sf->sf_ro.ri_crow = sf->sf_ro.ri_rows - 1;
- if (sf->sf_ro.ri_ccol >= sf->sf_ro.ri_cols)
- sf->sf_ro.ri_ccol = sf->sf_ro.ri_cols - 1;
+ if (ri->ri_crow >= ri->ri_rows)
+ ri->ri_crow = ri->ri_rows - 1;
+ if (ri->ri_ccol >= ri->ri_cols)
+ ri->ri_ccol = ri->ri_cols - 1;
/*
* Take care of updating the PROM cursor position as well if we can.
*/
- if (sf->sf_ro.ri_updatecursor == NULL &&
+ if (ri->ri_updatecursor == NULL &&
(sf->sf_ccolp != NULL || sf->sf_crowp != NULL))
- sf->sf_ro.ri_updatecursor = fb_updatecursor;
+ ri->ri_updatecursor = fb_updatecursor;
/*
* Select appropriate color settings to mimic a
* black on white Sun console.
*/
if (sf->sf_depth > 8) {
- wscol_white = 0;
- wscol_black = 255;
+ tmp = ri->ri_devcmap[WSCOL_WHITE];
+ ri->ri_devcmap[WSCOL_WHITE] = ri->ri_devcmap[WSCOL_BLACK];
+ ri->ri_devcmap[WSCOL_BLACK] = tmp;
}
- if (ISSET(sf->sf_ro.ri_caps, WSSCREEN_WSCOLORS) &&
- sf->sf_depth == 8) {
- sf->sf_ro.ri_ops.alloc_attr(&sf->sf_ro,
+ if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS))
+ ri->ri_ops.alloc_attr(ri,
WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &defattr);
- } else {
- sf->sf_ro.ri_ops.alloc_attr(&sf->sf_ro, 0, 0, 0, &defattr);
- }
+ else
+ ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr);
fb_initwsd(sf);
- wsdisplay_cnattach(&sf->sf_wsd, &sf->sf_ro,
- sf->sf_ro.ri_ccol, sf->sf_ro.ri_crow, defattr);
+ wsdisplay_cnattach(&sf->sf_wsd, ri,
+ ri->ri_ccol, ri->ri_crow, defattr);
}
void
diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c
index eee2c185e6f..d384c338537 100644
--- a/sys/arch/sparc64/dev/creator.c
+++ b/sys/arch/sparc64/dev/creator.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: creator.c,v 1.35 2006/05/15 21:38:36 miod Exp $ */
+/* $OpenBSD: creator.c,v 1.36 2006/06/30 21:38:19 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -447,7 +447,7 @@ creator_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
*curyp = 0;
*curxp = 0;
sc->sc_sunfb.sf_ro.ri_ops.alloc_attr(&sc->sc_sunfb.sf_ro,
- 0, 0, 0, attrp);
+ WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, attrp);
sc->sc_nscreens++;
return (0);
}
diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c
index 4084633c93e..c299152b949 100644
--- a/sys/arch/sparc64/dev/fb.c
+++ b/sys/arch/sparc64/dev/fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fb.c,v 1.11 2006/06/29 17:54:32 miod Exp $ */
+/* $OpenBSD: fb.c,v 1.12 2006/06/30 21:38:19 miod Exp $ */
/* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */
/*
@@ -187,19 +187,21 @@ fbwscons_init(struct sunfb *sf, int flags)
void
fbwscons_console_init(struct sunfb *sf, int row)
{
+ struct rasops_info *ri = &sf->sf_ro;
+ int32_t tmp;
long defattr;
if (romgetcursoraddr(&sf->sf_crowp, &sf->sf_ccolp))
sf->sf_ccolp = sf->sf_crowp = NULL;
if (sf->sf_ccolp != NULL)
- sf->sf_ro.ri_ccol = *sf->sf_ccolp;
+ ri->ri_ccol = *sf->sf_ccolp;
if (row < 0) {
if (sf->sf_crowp != NULL)
- sf->sf_ro.ri_crow = *sf->sf_crowp;
+ ri->ri_crow = *sf->sf_crowp;
else
/* assume last row */
- sf->sf_ro.ri_crow = sf->sf_ro.ri_rows - 1;
+ ri->ri_crow = ri->ri_rows - 1;
} else {
/*
* If we force the display row, this is because the screen
@@ -209,45 +211,43 @@ fbwscons_console_init(struct sunfb *sf, int row)
* upon shutdown...
*/
sf->sf_crowp = sf->sf_ccolp = NULL;
- sf->sf_ro.ri_crow = row;
+ ri->ri_crow = row;
}
/*
* Scale back rows and columns if the font would not otherwise
* fit on this display. Without this we would panic later.
*/
- if (sf->sf_ro.ri_crow >= sf->sf_ro.ri_rows)
- sf->sf_ro.ri_crow = sf->sf_ro.ri_rows - 1;
- if (sf->sf_ro.ri_ccol >= sf->sf_ro.ri_cols)
- sf->sf_ro.ri_ccol = sf->sf_ro.ri_cols - 1;
+ if (ri->ri_crow >= ri->ri_rows)
+ ri->ri_crow = ri->ri_rows - 1;
+ if (ri->ri_ccol >= ri->ri_cols)
+ ri->ri_ccol = ri->ri_cols - 1;
/*
* Take care of updating the PROM cursor position as weel if we can.
*/
- if (sf->sf_ro.ri_updatecursor != NULL &&
+ if (ri->ri_updatecursor != NULL &&
(sf->sf_ccolp != NULL || sf->sf_crowp != NULL))
- sf->sf_ro.ri_updatecursor = fb_updatecursor;
+ ri->ri_updatecursor = fb_updatecursor;
/*
* Select appropriate color settings to mimic a
* black on white Sun console.
*/
if (sf->sf_depth > 8) {
- wscol_white = 0;
- wscol_black = 255;
+ tmp = ri->ri_devcmap[WSCOL_WHITE];
+ ri->ri_devcmap[WSCOL_WHITE] = ri->ri_devcmap[WSCOL_BLACK];
+ ri->ri_devcmap[WSCOL_BLACK] = tmp;
}
- if (ISSET(sf->sf_ro.ri_caps, WSSCREEN_WSCOLORS) &&
- sf->sf_depth == 8) {
- sf->sf_ro.ri_ops.alloc_attr(&sf->sf_ro,
+ if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS))
+ ri->ri_ops.alloc_attr(ri,
WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &defattr);
- } else {
- sf->sf_ro.ri_ops.alloc_attr(&sf->sf_ro, 0, 0, 0, &defattr);
- }
+ else
+ ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr);
fb_initwsd(sf);
- wsdisplay_cnattach(&sf->sf_wsd, &sf->sf_ro,
- sf->sf_ro.ri_ccol, sf->sf_ro.ri_crow, defattr);
+ wsdisplay_cnattach(&sf->sf_wsd, ri, ri->ri_ccol, ri->ri_crow, defattr);
}
void
diff --git a/sys/dev/sbus/agten.c b/sys/dev/sbus/agten.c
index 2db079e7a6b..94a821f191c 100644
--- a/sys/dev/sbus/agten.c
+++ b/sys/dev/sbus/agten.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agten.c,v 1.5 2006/06/02 20:00:56 miod Exp $ */
+/* $OpenBSD: agten.c,v 1.6 2006/06/30 21:38:19 miod Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
* All rights reserved.
@@ -351,13 +351,8 @@ agten_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
*cookiep = &sc->sc_sunfb.sf_ro;
*curyp = 0;
*curxp = 0;
- if (sc->sc_sunfb.sf_depth == 8) {
- sc->sc_sunfb.sf_ro.ri_ops.alloc_attr(&sc->sc_sunfb.sf_ro,
- WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, attrp);
- } else {
- sc->sc_sunfb.sf_ro.ri_ops.alloc_attr(&sc->sc_sunfb.sf_ro,
- 0, 0, 0, attrp);
- }
+ sc->sc_sunfb.sf_ro.ri_ops.alloc_attr(&sc->sc_sunfb.sf_ro,
+ WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, attrp);
sc->sc_nscreens++;
return (0);
}
diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
index 3c4fde4c8a0..3f9cb984620 100644
--- a/sys/dev/wscons/wsdisplayvar.h
+++ b/sys/dev/wscons/wsdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplayvar.h,v 1.17 2006/06/29 17:54:32 miod Exp $ */
+/* $OpenBSD: wsdisplayvar.h,v 1.18 2006/06/30 21:38:19 miod Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */
/*
@@ -68,8 +68,8 @@ struct wsdisplay_emulops {
/* fg / bg values. Made identical to ANSI terminal color codes. */
/* XXX should be #if NWSEMUL_SUN > 1 */
#if defined(__sparc__) || defined(__sparc64__)
-#define WSCOL_WHITE wscol_white
-#define WSCOL_BLACK wscol_black
+#define WSCOL_WHITE 0
+#define WSCOL_BLACK 15
#else
#define WSCOL_BLACK 0
#define WSCOL_WHITE 7
@@ -89,11 +89,6 @@ struct wsdisplay_emulops {
/* XXX need a free_attr() ??? */
};
-/* XXX should be #if NWSEMUL_SUN > 1 */
-#if defined(__sparc__) || defined(__sparc64__)
-extern int wscol_white, wscol_black;
-#endif
-
#define WSSCREEN_NAME_SIZE 16
struct wsscreen_descr {
diff --git a/sys/dev/wscons/wsemul_sun.c b/sys/dev/wscons/wsemul_sun.c
index dd58be25200..213c8c8c40f 100644
--- a/sys/dev/wscons/wsemul_sun.c
+++ b/sys/dev/wscons/wsemul_sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsemul_sun.c,v 1.14 2006/06/29 17:54:32 miod Exp $ */
+/* $OpenBSD: wsemul_sun.c,v 1.15 2006/06/30 21:38:19 miod Exp $ */
/* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */
/*
@@ -120,14 +120,6 @@ struct wsemul_sun_emuldata wsemul_sun_console_emuldata;
#define COLS_LEFT (edp->ncols - 1 - edp->ccol)
#define ROWS_LEFT (edp->nrows - 1 - edp->crow)
-/*
- * wscons color codes
- * To compensate for Sun color choices on older framebuffers, these need to
- * be variables.
- */
-int wscol_white = 0; /* 0 */
-int wscol_black = 7; /* 255 */
-
void
wsemul_sun_init(edp, type, cookie, ccol, crow, defattr)
struct wsemul_sun_emuldata *edp;