diff options
Diffstat (limited to 'sys/arch/sparc64/dev/fb.c')
-rw-r--r-- | sys/arch/sparc64/dev/fb.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c index e947e23391c..6613fedd878 100644 --- a/sys/arch/sparc64/dev/fb.c +++ b/sys/arch/sparc64/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.23 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.24 2013/08/15 18:29:56 kettenis Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -303,6 +303,7 @@ void fbwscons_console_init(struct sunfb *sf, int row) { struct rasops_info *ri = &sf->sf_ro; + void *cookie; long defattr; if (romgetcursoraddr(&sf->sf_crowp, &sf->sf_ccolp)) @@ -349,14 +350,20 @@ fbwscons_console_init(struct sunfb *sf, int row) (sf->sf_ccolp != NULL || sf->sf_crowp != NULL)) ri->ri_updatecursor = fb_updatecursor; + if (ri->ri_flg & RI_VCONS) + cookie = ri->ri_active; + else + cookie = ri; + if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS)) - ri->ri_ops.alloc_attr(ri, + ri->ri_ops.alloc_attr(cookie, WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &defattr); else - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.alloc_attr(cookie, 0, 0, 0, &defattr); fb_initwsd(sf); - wsdisplay_cnattach(&sf->sf_wsd, ri, ri->ri_ccol, ri->ri_crow, defattr); + wsdisplay_cnattach(&sf->sf_wsd, cookie, + ri->ri_ccol, ri->ri_crow, defattr); } void @@ -430,18 +437,24 @@ fb_alloc_screen(void *v, const struct wsscreen_descr *type, { struct sunfb *sf = v; struct rasops_info *ri = &sf->sf_ro; + void *cookie; if (sf->sf_nscreens > 0) return (ENOMEM); - *cookiep = ri; + if (ri->ri_flg & RI_VCONS) + cookie = ri->ri_active; + else + cookie = ri; + + *cookiep = cookie; *curyp = 0; *curxp = 0; if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS)) - ri->ri_ops.alloc_attr(ri, + ri->ri_ops.alloc_attr(cookie, WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, attrp); else - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.alloc_attr(cookie, 0, 0, 0, attrp); sf->sf_nscreens++; return (0); } |