Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sun don't set clipping parameters and such every tim...
details: https://anonhg.NetBSD.org/src/rev/876bd9244951
branches: trunk
changeset: 780078:876bd9244951
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jul 11 15:03:14 2012 +0000
description:
don't set clipping parameters and such every time we send a blitter command
diffstat:
sys/dev/sun/cgsix.c | 92 ++++++++++++++++++----------------------------------
1 files changed, 32 insertions(+), 60 deletions(-)
diffs (185 lines):
diff -r 43fd69dede6e -r 876bd9244951 sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c Wed Jul 11 13:34:45 2012 +0000
+++ b/sys/dev/sun/cgsix.c Wed Jul 11 15:03:14 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $ */
+/* $NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -318,6 +318,7 @@
#if defined(RASTERCONSOLE) && defined(CG6_BLIT_CURSOR)
static void cg6_ras_do_cursor(struct rasops_info *);
#endif
+
static void
cg6_ras_init(struct cgsix_softc *sc)
{
@@ -326,6 +327,16 @@
CG6_DRAIN(fbc);
fbc->fbc_mode &= ~CG6_MODE_MASK;
fbc->fbc_mode |= CG6_MODE;
+
+ /* set some common drawing engine parameters */
+ fbc->fbc_clip = 0;
+ fbc->fbc_s = 0;
+ fbc->fbc_offx = 0;
+ fbc->fbc_offy = 0;
+ fbc->fbc_clipminx = 0;
+ fbc->fbc_clipminy = 0;
+ fbc->fbc_clipmaxx = 0x3fff;
+ fbc->fbc_clipmaxy = 0x3fff;
}
static void
@@ -355,15 +366,10 @@
n *= ri->ri_font->fontheight;
src *= ri->ri_font->fontheight;
dst *= ri->ri_font->fontheight;
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
+
fbc->fbc_alu = CG6_ALU_COPY;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_x0 = ri->ri_xorigin;
fbc->fbc_y0 = ri->ri_yorigin + src;
fbc->fbc_x1 = ri->ri_xorigin + ri->ri_emuwidth - 1;
@@ -406,15 +412,10 @@
src *= ri->ri_font->fontwidth;
dst *= ri->ri_font->fontwidth;
row *= ri->ri_font->fontheight;
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
+
fbc->fbc_alu = CG6_ALU_COPY;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_x0 = ri->ri_xorigin + src;
fbc->fbc_y0 = ri->ri_yorigin + row;
fbc->fbc_x1 = ri->ri_xorigin + src + n - 1;
@@ -450,15 +451,10 @@
n *= ri->ri_font->fontwidth;
col *= ri->ri_font->fontwidth;
row *= ri->ri_font->fontheight;
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
+
fbc->fbc_alu = CG6_ALU_FILL;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_fg = ri->ri_devcmap[(attr >> 16) & 0xff];
fbc->fbc_arecty = ri->ri_yorigin + row;
fbc->fbc_arectx = ri->ri_xorigin + col;
@@ -485,15 +481,10 @@
n = ri->ri_rows - row;
if (n <= 0)
return;
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
+
fbc->fbc_alu = CG6_ALU_FILL;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_fg = ri->ri_devcmap[(attr >> 16) & 0xff];
if ((n == ri->ri_rows) && (ri->ri_flg & RI_FULLCLEAR)) {
fbc->fbc_arecty = 0;
@@ -1286,15 +1277,10 @@
volatile struct cg6_fbc *fbc = sc->sc_fbc;
CG6_DRAIN(fbc);
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = sc->sc_width - 1;
- fbc->fbc_clipmaxy = sc->sc_height - 1;
+
fbc->fbc_alu = CG6_ALU_FILL;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_fg = col;
fbc->fbc_arecty = ys;
fbc->fbc_arectx = xs;
@@ -1398,7 +1384,6 @@
}
/* put the chip back to normal */
fbc->fbc_incy = 0;
- fbc->fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR8;
}
}
}
@@ -1448,15 +1433,10 @@
volatile struct cg6_fbc *fbc = sc->sc_fbc;
CG6_DRAIN(fbc);
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
+
fbc->fbc_alu = CG6_ALU_FILL;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
fbc->fbc_fg = ri->ri_devcmap[sc->sc_bg];
fbc->fbc_arectx = 0;
fbc->fbc_arecty = 0;
@@ -1473,18 +1453,10 @@
cg6_invert(struct cgsix_softc *sc, int x, int y, int wi, int he)
{
volatile struct cg6_fbc *fbc = sc->sc_fbc;
- struct rasops_info *ri = &cg6_console_screen.scr_ri;
CG6_DRAIN(fbc);
- fbc->fbc_clip = 0;
- fbc->fbc_s = 0;
- fbc->fbc_offx = 0;
- fbc->fbc_offy = 0;
- fbc->fbc_clipminx = 0;
- fbc->fbc_clipminy = 0;
- fbc->fbc_clipmaxx = ri->ri_width - 1;
- fbc->fbc_clipmaxy = ri->ri_height - 1;
fbc->fbc_alu = CG6_ALU_FLIP;
+ fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
fbc->fbc_arecty = y;
fbc->fbc_arectx = x;
fbc->fbc_arecty = y + he - 1;
Home |
Main Index |
Thread Index |
Old Index