From owner-svn-src-head@FreeBSD.ORG Wed Jan 29 15:50:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BA27A54; Wed, 29 Jan 2014 15:50:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8618217E9; Wed, 29 Jan 2014 15:50:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0TFo28C017716; Wed, 29 Jan 2014 15:50:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0TFo2iF017714; Wed, 29 Jan 2014 15:50:02 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201401291550.s0TFo2iF017714@svn.freebsd.org> From: Justin Hibbits Date: Wed, 29 Jan 2014 15:50:02 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2014 15:50:02 -0000 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 -__FBSDID("$FreeBSD: user/ed/newcons/sys/dev/vt/hw/ofwfb/ofwfb.c 219888 2011-03-22 21:31:31Z ed $"); +__FBSDID("$FreeBSD$"); #include #include @@ -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: