Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2013 03:09:45 +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: r253979 - head/sys/powerpc/ofw
Message-ID:  <201308060309.r7639jTi020050@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Tue Aug  6 03:09:44 2013
New Revision: 253979
URL: http://svnweb.freebsd.org/changeset/base/253979

Log:
  Micro-optimize OFW syscons 8-bit blank.
  
  MFC after:	1 week

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_syscons.c	Tue Aug  6 02:58:16 2013	(r253978)
+++ head/sys/powerpc/ofw/ofw_syscons.c	Tue Aug  6 03:09:44 2013	(r253979)
@@ -586,14 +586,22 @@ ofwfb_blank_display8(video_adapter_t *ad
 {
 	struct ofwfb_softc *sc;
 	int i;
-	uint8_t *addr;
+	uint32_t *addr;
+	uint32_t color;
+	uint32_t end;
 
 	sc = (struct ofwfb_softc *)adp;
-	addr = (uint8_t *) sc->sc_addr;
+	addr = (uint32_t *) sc->sc_addr;
+	end = (sc->sc_stride/4) * sc->sc_height;
+
+	/* Splat 4 pixels at once. */
+	color = (ofwfb_background(SC_NORM_ATTR) << 24) |
+	    (ofwfb_background(SC_NORM_ATTR) << 16) |
+	    (ofwfb_background(SC_NORM_ATTR) << 8) |
+	    (ofwfb_background(SC_NORM_ATTR));
 
-	/* Could be done a lot faster e.g. 32-bits, or Altivec'd */
-	for (i = 0; i < sc->sc_stride*sc->sc_height; i++)
-		*(addr + i) = ofwfb_background(SC_NORM_ATTR);
+	for (i = 0; i < end; i++)
+		*(addr + i) = color;
 
 	return (0);
 }



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