Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jan 2014 15:50:02 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261269 - head/sys/dev/vt/hw/ofwfb
Message-ID:  <201401291550.s0TFo2iF017714@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Wed Jan 29 15:50:01 2014
New Revision: 261269
URL: http://svnweb.freebsd.org/changeset/base/261269

Log:
  Micro-optimize 8-bit blanking.  This is the same as in ofw_syscons.
  
  Reviewed by:	ray
  MFC after:	1 week

Modified:
  head/sys/dev/vt/hw/ofwfb/ofwfb.c   (contents, props changed)

Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c
==============================================================================
--- head/sys/dev/vt/hw/ofwfb/ofwfb.c	Wed Jan 29 14:56:48 2014	(r261268)
+++ head/sys/dev/vt/hw/ofwfb/ofwfb.c	Wed Jan 29 15:50:01 2014	(r261269)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: user/ed/newcons/sys/dev/vt/hw/ofwfb/ofwfb.c 219888 2011-03-22 21:31:31Z ed $");
+__FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -78,17 +78,19 @@ static void
 ofwfb_blank(struct vt_device *vd, term_color_t color)
 {
 	struct ofwfb_softc *sc = vd->vd_softc;
-	u_int ofs;
+	u_int ofs, size;
 	uint32_t c;
 
+	size = sc->sc_stride * vd->vd_height;
 	switch (sc->sc_depth) {
 	case 8:
-		for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++)
-			*(uint8_t *)(sc->sc_addr + ofs) = color;
+		c = (color << 24) | (color << 16) | (color << 8) | color;
+		for (ofs = 0; ofs < size/4; ofs++)
+			*(uint32_t *)(sc->sc_addr + 4*ofs) = c;
 		break;
 	case 32:
 		c = sc->sc_colormap[color];
-		for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++)
+		for (ofs = 0; ofs < size; ofs++)
 			*(uint32_t *)(sc->sc_addr + 4*ofs) = c;
 		break;
 	default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401291550.s0TFo2iF017714>