Example #1
0
static void
newport_eraserows(void *c, int startrow, int nrows, long attr)
{
	struct newport_devconfig *dc = (void *)c;
	struct wsdisplay_font *font = dc->dc_fontdata;

	newport_fill_rectangle(dc,
	    0,							/* x1 */
	    startrow * font->fontheight,			/* y1 */
	    dc->dc_xres,					/* x2 */
	    (startrow + nrows + 1) * font->fontheight - 1,	/* y2 */
	    NEWPORT_ATTR_BG(attr));
}
Example #2
0
static void
newport_erasecols(void *c, int row, int startcol, int ncols,
    long attr)
{
	struct newport_devconfig *dc = (void *)c;
	struct wsdisplay_font *font = dc->dc_fontdata;

	newport_fill_rectangle(dc,
	    startcol * font->fontwidth,				/* x1 */
	    row * font->fontheight,				/* y1 */
	    (startcol + ncols + 1) * font->fontwidth - 1,	/* x2 */
	    (row + 1) * font->fontheight - 1,			/* y2 */
	    NEWPORT_ATTR_BG(attr));
}
Example #3
0
static void
newport_putchar(void *c, int row, int col, u_int ch, long attr)
{
	struct rasops_info *ri = c;
	struct vcons_screen *scr = ri->ri_hw;
	struct newport_devconfig *dc = scr->scr_cookie;
	struct wsdisplay_font *font = ri->ri_font;
	uint8_t *bitmap = (u_int8_t *)font->data + (ch - font->firstchar) * 
	    font->fontheight * font->stride;
	uint32_t pattern;
	int i;
	int x = col * font->fontwidth + ri->ri_xorigin;
	int y = row * font->fontheight + ri->ri_yorigin;

	rex3_wait_gfifo(dc);
	
	rex3_write(dc, REX3_REG_DRAWMODE0, REX3_DRAWMODE0_OPCODE_DRAW |
	    REX3_DRAWMODE0_ADRMODE_BLOCK | REX3_DRAWMODE0_STOPONX |
	    REX3_DRAWMODE0_ENZPATTERN | REX3_DRAWMODE0_ZPOPAQUE);

	rex3_write(dc, REX3_REG_DRAWMODE1,
	    REX3_DRAWMODE1_PLANES_CI |
	    REX3_DRAWMODE1_DD_DD8 |
	    REX3_DRAWMODE1_RWPACKED |
	    REX3_DRAWMODE1_HD_HD8 |
	    REX3_DRAWMODE1_COMPARE_LT |
	    REX3_DRAWMODE1_COMPARE_EQ |
	    REX3_DRAWMODE1_COMPARE_GT |
	    REX3_DRAWMODE1_LO_SRC);

	rex3_write(dc, REX3_REG_XYSTARTI, (x << REX3_XYSTARTI_XSHIFT) | y);
	rex3_write(dc, REX3_REG_XYENDI,
	    (x + font->fontwidth - 1) << REX3_XYENDI_XSHIFT);

	rex3_write(dc, REX3_REG_COLORI, NEWPORT_ATTR_FG(attr));
	rex3_write(dc, REX3_REG_COLORBACK, NEWPORT_ATTR_BG(attr));

	rex3_write(dc, REX3_REG_WRMASK, 0xffffffff);

	for (i = 0; i < font->fontheight; i++) {
		/* XXX Works only with font->fontwidth == 8 XXX */
		pattern = *bitmap << 24;
		
		rex3_write_go(dc, REX3_REG_ZPATTERN, pattern);

		bitmap += font->stride;
	}
	rex3_wait_gfifo(dc);
}
Example #4
0
static void
newport_eraserows(void *c, int startrow, int nrows, long attr)
{
	struct rasops_info *ri = c;
	struct vcons_screen *scr = ri->ri_hw;
	struct newport_devconfig *dc = scr->scr_cookie;
	struct wsdisplay_font *font = dc->dc_fontdata;

	newport_fill_rectangle(dc,
	    0,							/* x1 */
	    startrow * font->fontheight,			/* y1 */
	    dc->dc_xres,					/* x2 */
	    (startrow + nrows) * font->fontheight - 1,		/* y2 */
	    NEWPORT_ATTR_BG(attr));
}
Example #5
0
static void
newport_erasecols(void *c, int row, int startcol, int ncols,
    long attr)
{
	struct rasops_info *ri = c;
	struct vcons_screen *scr = ri->ri_hw;
	struct newport_devconfig *dc = scr->scr_cookie;
	struct wsdisplay_font *font = dc->dc_fontdata;

	newport_fill_rectangle(dc,
	    startcol * font->fontwidth,				/* x1 */
	    row * font->fontheight,				/* y1 */
	    (startcol + ncols) * font->fontwidth - 1,		/* x2 */
	    (row + 1) * font->fontheight - 1,			/* y2 */
	    NEWPORT_ATTR_BG(attr));
}
Example #6
0
static void
newport_putchar(void *c, int row, int col, u_int ch, long attr)
{
	struct newport_devconfig *dc = (void *)c;
	struct wsdisplay_font *font = dc->dc_fontdata;
	uint8_t *bitmap = (u_int8_t *)font->data + (ch - font->firstchar) * 
	    font->fontheight * font->stride;
	uint32_t pattern;
	int i;
	int x = col * font->fontwidth;
	int y = row * font->fontheight;

	rex3_wait_gfifo(dc);
	
	rex3_write(dc, REX3_REG_DRAWMODE0, REX3_DRAWMODE0_OPCODE_DRAW |
	    REX3_DRAWMODE0_ADRMODE_BLOCK | REX3_DRAWMODE0_STOPONX |
	    REX3_DRAWMODE0_ENZPATTERN | REX3_DRAWMODE0_ZPOPAQUE);

	rex3_write(dc, REX3_REG_XYSTARTI, (x << REX3_XYSTARTI_XSHIFT) | y);
	rex3_write(dc, REX3_REG_XYENDI,
	    (x + font->fontwidth - 1) << REX3_XYENDI_XSHIFT);

	rex3_write(dc, REX3_REG_COLORI, NEWPORT_ATTR_FG(attr));
	rex3_write(dc, REX3_REG_COLORBACK, NEWPORT_ATTR_BG(attr));

	rex3_write(dc, REX3_REG_WRMASK, 0xffffffff);

	for (i=0; i<font->fontheight; i++) {
		/* XXX Works only with font->fontwidth == 8 XXX */
		pattern = *bitmap << 24;
		
		rex3_write_go(dc, REX3_REG_ZPATTERN, pattern);

		bitmap += font->stride;
	}
}