summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-08-09 21:23:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-08-09 21:23:52 +0000
commit50d2b3ac02bac162eeeee9b6e9dec6cd01e1ef16 (patch)
treef644fe5c2cfec7d2bd41c1cc9c30ca8d3533ca4e /sys/arch
parent71de212ab01f2777518c37c196906337b336042c (diff)
Use the blitter again for the cursor on non-mono frame buffers.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hp300/dev/diofb.c24
-rw-r--r--sys/arch/hp300/dev/diofbvar.h11
2 files changed, 25 insertions, 10 deletions
diff --git a/sys/arch/hp300/dev/diofb.c b/sys/arch/hp300/dev/diofb.c
index 8c15b840e04..b3376daed79 100644
--- a/sys/arch/hp300/dev/diofb.c
+++ b/sys/arch/hp300/dev/diofb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diofb.c,v 1.12 2006/08/05 09:57:24 miod Exp $ */
+/* $OpenBSD: diofb.c,v 1.13 2006/08/09 21:23:51 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -86,6 +86,7 @@ void diofb_copycols(void *, int, int, int, int);
void diofb_erasecols(void *, int, int, int, long);
void diofb_copyrows(void *, int, int, int);
void diofb_eraserows(void *, int, int, long);
+void diofb_do_cursor(struct rasops_info *);
/*
* Frame buffer geometry initialization
@@ -203,6 +204,7 @@ diofb_fbsetup(struct diofb *fb)
if (ri->ri_depth != 1) {
ri->ri_ops.copyrows = diofb_copyrows;
ri->ri_ops.eraserows = diofb_eraserows;
+ ri->ri_do_cursor = diofb_do_cursor;
}
/* Clear entire display, including non visible areas */
@@ -371,9 +373,9 @@ diofb_erasecols(void *cookie, int row, int col, int num, long attr)
{
struct rasops_info *ri = cookie;
struct diofb *fb = ri->ri_hw;
- int fg, bg, uline;
+ int fg, bg;
- rasops_unpack_attr(attr, &fg, &bg, &uline);
+ rasops_unpack_attr(attr, &fg, &bg, NULL);
/*
* If the background color is not black, this is a bit too tricky
@@ -398,9 +400,9 @@ diofb_eraserows(void *cookie, int row, int num, long attr)
{
struct rasops_info *ri = cookie;
struct diofb *fb = ri->ri_hw;
- int fg, bg, uline;
+ int fg, bg;
- rasops_unpack_attr(attr, &fg, &bg, &uline);
+ rasops_unpack_attr(attr, &fg, &bg, NULL);
/*
* If the background color is not black, this is a bit too tricky
@@ -424,6 +426,18 @@ diofb_eraserows(void *cookie, int row, int num, long attr)
}
}
+void
+diofb_do_cursor(struct rasops_info *ri)
+{
+ struct diofb *fb = ri->ri_hw;
+ int x, y;
+
+ x = ri->ri_ccol * ri->ri_font->fontwidth + ri->ri_xorigin;
+ y = ri->ri_crow * ri->ri_font->fontheight + ri->ri_yorigin;
+ (*fb->bmv)(fb, x, y, x, y, ri->ri_font->fontwidth,
+ ri->ri_font->fontheight, RR_INVERT);
+}
+
/*
* Common wsdisplay accessops for DIO frame buffers
*/
diff --git a/sys/arch/hp300/dev/diofbvar.h b/sys/arch/hp300/dev/diofbvar.h
index 99b9b950388..9d11b22fd36 100644
--- a/sys/arch/hp300/dev/diofbvar.h
+++ b/sys/arch/hp300/dev/diofbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: diofbvar.h,v 1.8 2006/04/14 21:05:43 miod Exp $ */
+/* $OpenBSD: diofbvar.h,v 1.9 2006/08/09 21:23:51 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -102,10 +102,11 @@ struct diofb {
};
/* Replacement Rules (rops) */
-#define RR_CLEAR 0x0
-#define RR_COPY 0x3
-#define RR_XOR 0x6
-#define RR_COPYINVERTED 0xc
+#define RR_CLEAR 0x0
+#define RR_COPY 0x3
+#define RR_XOR 0x6
+#define RR_INVERT 0xa
+#define RR_COPYINVERTED 0xc
void diofb_cnattach(struct diofb *);
void diofb_end_attach(void *, struct wsdisplay_accessops *, struct diofb *,