summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-01-31 17:00:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-01-31 17:00:20 +0000
commit06411e0cbe5f45be876dcf54a32b9f800a883495 (patch)
tree00611c177a7f8f2b3835b4cb5e5ff7373e89eaad /sys/dev/ic
parenta75fcd575a93a167bc930041171d925a14d32d0e (diff)
Working wscons attachment and block move operations; joint debug by mickey
and myself. wsdisplay at sti will be enabled as soon as byte-size rom font loading is done.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/sti.c59
-rw-r--r--sys/dev/ic/stireg.h3
-rw-r--r--sys/dev/ic/stivar.h3
3 files changed, 44 insertions, 21 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index 6420752f427..475860957b1 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.16 2003/01/31 03:44:26 mickey Exp $ */
+/* $OpenBSD: sti.c,v 1.17 2003/01/31 17:00:19 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -193,7 +193,7 @@ sti_attach_common(sc)
"end=%x, mmap=%x, msto=%x, timo=%d, mont=%x, ua=%x\n"
"memrq=%x, pwr=%d, bus=%x, ebus=%x, altt=%x, cfb=%x\n"
"code=",
- dd->dd_type, dd->dd_grrev, dd->dd_lrrev,
+ dd->dd_type & 0xff, dd->dd_grrev, dd->dd_lrrev,
dd->dd_grid[0], dd->dd_grid[1],
dd->dd_fntaddr, dd->dd_maxst, dd->dd_romend,
dd->dd_reglst, dd->dd_maxreent,
@@ -342,13 +342,20 @@ sti_attach_common(sc)
{
struct wsemuldisplaydev_attach_args waa;
- /* attach WSDISPLAY */
- bzero(&waa, sizeof(waa));
waa.console = sc->sc_flags & STI_CONSOLE? 1 : 0;
waa.scrdata = &sti_default_screenlist;
waa.accessops = &sti_accessops;
waa.accesscookie = sc;
+ /* attach as console if required */
+ if (waa.console) {
+ long defattr;
+
+ sti_alloc_attr(sc, 0, 0, 0, &defattr);
+ wsdisplay_cnattach(&sti_default_screen, sc,
+ 0, sti_default_screen.nrows - 1, defattr);
+ }
+
config_found(&sc->sc_dev, &waa, wsemuldisplaydevprint);
}
#endif
@@ -467,6 +474,7 @@ sti_bmove(sc, x1, y1, x2, y2, h, w, f)
a.in.bg_colour = 0;
break;
case bmf_invert:
+ a.flags.flags |= STI_BLKMVF_COLR;
a.in.fg_colour = 0;
a.in.bg_colour = 1;
break;
@@ -506,7 +514,7 @@ sti_mmap(v, offset, prot)
int prot;
{
/* XXX not finished */
- return offset;
+ return -1;
}
int
@@ -517,7 +525,17 @@ sti_alloc_screen(v, type, cookiep, cxp, cyp, defattr)
int *cxp, *cyp;
long *defattr;
{
- return -1;
+ struct sti_softc *sc = v;
+
+ if (sc->sc_nscreens > 0)
+ return ENOMEM;
+
+ *cookiep = sc;
+ *cxp = 0;
+ *cyp = 0;
+ sti_alloc_attr(sc, 0, 0, 0, defattr);
+ sc->sc_nscreens++;
+ return 0;
}
void
@@ -525,6 +543,9 @@ sti_free_screen(v, cookie)
void *v;
void *cookie;
{
+ struct sti_softc *sc = v;
+
+ sc->sc_nscreens--;
}
int
@@ -556,9 +577,9 @@ sti_cursor(v, on, row, col)
struct sti_font *fp = sc->sc_curfont;
sti_bmove(sc,
- row * fp->height, col * fp->width,
- row * fp->height, col * fp->width,
- fp->width, fp->height, bmf_invert);
+ col * fp->width, row * fp->height,
+ col * fp->width, row * fp->height,
+ fp->height, fp->width, bmf_invert);
}
int
@@ -610,9 +631,9 @@ sti_copycols(v, row, srccol, dstcol, ncols)
struct sti_font *fp = sc->sc_curfont;
sti_bmove(sc,
- row * fp->height, srccol * fp->width,
- row * fp->height, dstcol * fp->width,
- ncols * fp->width, fp->height, bmf_copy);
+ srccol * fp->width, row * fp->height,
+ dstcol * fp->width, row * fp->height,
+ fp->height, ncols * fp->width, bmf_copy);
}
void
@@ -625,9 +646,9 @@ sti_erasecols(v, row, startcol, ncols, attr)
struct sti_font *fp = sc->sc_curfont;
sti_bmove(sc,
- row * fp->height, startcol * fp->width,
- row * fp->height, startcol * fp->width,
- ncols * fp->width, fp->height, bmf_clear);
+ startcol * fp->width, row * fp->height,
+ startcol * fp->width, row * fp->height,
+ fp->height, ncols * fp->width, bmf_clear);
}
void
@@ -638,8 +659,8 @@ sti_copyrows(v, srcrow, dstrow, nrows)
struct sti_softc *sc = v;
struct sti_font *fp = sc->sc_curfont;
- sti_bmove(sc, srcrow * fp->height, 0, dstrow * fp->height, 0,
- sc->sc_cfg.fb_width, nrows + fp->height, bmf_copy);
+ sti_bmove(sc, 0, srcrow * fp->height, 0, dstrow * fp->height,
+ nrows * fp->height, sc->sc_cfg.fb_width, bmf_copy);
}
void
@@ -651,8 +672,8 @@ sti_eraserows(v, srcrow, nrows, attr)
struct sti_softc *sc = v;
struct sti_font *fp = sc->sc_curfont;
- sti_bmove(sc, srcrow * fp->height, 0, srcrow * fp->height, 0,
- sc->sc_cfg.fb_width, nrows + fp->height, bmf_clear);
+ sti_bmove(sc, 0, srcrow * fp->height, 0, srcrow * fp->height,
+ nrows * fp->height, sc->sc_cfg.fb_width, bmf_clear);
}
int
diff --git a/sys/dev/ic/stireg.h b/sys/dev/ic/stireg.h
index 49c8c4f47e8..12167657925 100644
--- a/sys/dev/ic/stireg.h
+++ b/sys/dev/ic/stireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stireg.h,v 1.4 2002/03/14 01:26:55 millert Exp $ */
+/* $OpenBSD: stireg.h,v 1.5 2003/01/31 17:00:19 miod Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -317,6 +317,7 @@ typedef struct sti_blkmvin {
u_int8_t bg_colour;
u_int16_t srcx, srcy, dstx, dsty;
u_int16_t width, height;
+ u_int16_t pad;
void *future;
} *sti_blkmvin_t;
diff --git a/sys/dev/ic/stivar.h b/sys/dev/ic/stivar.h
index b6f79387599..42b38d2b9df 100644
--- a/sys/dev/ic/stivar.h
+++ b/sys/dev/ic/stivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stivar.h,v 1.6 2003/01/31 03:44:26 mickey Exp $ */
+/* $OpenBSD: stivar.h,v 1.7 2003/01/31 17:00:19 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -45,6 +45,7 @@ struct sti_softc {
#define STI_CLEARSCR 0x0002
#define STI_CONSOLE 0x0004
int sc_devtype;
+ int sc_nscreens;
bus_space_tag_t iot, memt;
bus_space_handle_t ioh, romh, fbh;