add separate flags for putchar() based copycols() and copyrows() methods

for hw that can accelerate one but not the other, like Sun's Creator series
VCONS_DONT_READ does the same as before
This commit is contained in:
macallan 2010-09-21 03:33:14 +00:00
parent 9912ffbb92
commit 42092a5f99
2 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay_vcons.c,v 1.17 2010/08/18 16:46:51 macallan Exp $ */
/* $NetBSD: wsdisplay_vcons.c,v 1.18 2010/09/21 03:33:14 macallan Exp $ */
/*-
* Copyright (c) 2005, 2006 Michael Lorenz
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.17 2010/08/18 16:46:51 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.18 2010/09/21 03:33:14 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -234,14 +234,18 @@ vcons_init_screen(struct vcons_data *vd, struct vcons_screen *scr,
ri->ri_ops.putchar = vcons_putchar;
ri->ri_ops.cursor = vcons_cursor;
if (scr->scr_flags & VCONS_DONT_READ) {
ri->ri_ops.copyrows = vcons_copyrows_noread;
if (scr->scr_flags & VCONS_NO_COPYCOLS) {
ri->ri_ops.copycols = vcons_copycols_noread;
} else {
ri->ri_ops.copyrows = vcons_copyrows;
ri->ri_ops.copycols = vcons_copycols;
}
if (scr->scr_flags & VCONS_NO_COPYROWS) {
ri->ri_ops.copyrows = vcons_copyrows_noread;
} else {
ri->ri_ops.copyrows = vcons_copyrows;
}
ri->ri_hw = scr;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay_vconsvar.h,v 1.11 2010/08/18 16:46:51 macallan Exp $ */
/* $NetBSD: wsdisplay_vconsvar.h,v 1.12 2010/09/21 03:33:14 macallan Exp $ */
/*-
* Copyright (c) 2005, 2006 Michael Lorenz
@ -53,7 +53,14 @@ struct vcons_screen {
* - for drivers that use software
* drawing */
#define VCONS_DONT_DRAW 8 /* don't draw on this screen at all */
#define VCONS_DONT_READ 0x10 /* avoid framebuffer reads */
/*
* the following flags are for drivers which either can't accelerate (all) copy
* operations or where drawing characters is faster than the blitter
* for example, Sun's Creator boards can't accelerate copycols()
*/
#define VCONS_NO_COPYCOLS 0x10 /* use putchar() based copycols() */
#define VCONS_NO_COPYROWS 0x20 /* use putchar() basec copyrows() */
#define VCONS_DONT_READ 0x30 /* avoid framebuffer reads */
/* status flags used by vcons */
uint32_t scr_status;
#define VCONS_IS_VISIBLE 1 /* this screen is currently visible */