ofwfb.c (259016) | ofwfb.c (262861) |
---|---|
1/*- 2 * Copyright (c) 2011 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2011 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: user/ed/newcons/sys/dev/vt/hw/ofwfb/ofwfb.c 219888 2011-03-22 21:31:31Z ed $"); | 28__FBSDID("$FreeBSD: stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c 262861 2014-03-06 18:30:56Z jhb $"); |
29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33 34#include <dev/vt/vt.h> 35#include <dev/vt/colors/vt_termcolors.h> 36 --- 36 unchanged lines hidden (view full) --- 73VT_CONSDEV_DECLARE(vt_ofwfb_driver, PIXEL_WIDTH(1920), PIXEL_HEIGHT(1200), 74 &ofwfb_conssoftc); 75/* XXX: hardcoded max size */ 76 77static void 78ofwfb_blank(struct vt_device *vd, term_color_t color) 79{ 80 struct ofwfb_softc *sc = vd->vd_softc; | 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33 34#include <dev/vt/vt.h> 35#include <dev/vt/colors/vt_termcolors.h> 36 --- 36 unchanged lines hidden (view full) --- 73VT_CONSDEV_DECLARE(vt_ofwfb_driver, PIXEL_WIDTH(1920), PIXEL_HEIGHT(1200), 74 &ofwfb_conssoftc); 75/* XXX: hardcoded max size */ 76 77static void 78ofwfb_blank(struct vt_device *vd, term_color_t color) 79{ 80 struct ofwfb_softc *sc = vd->vd_softc; |
81 u_int ofs; | 81 u_int ofs, size; |
82 uint32_t c; 83 | 82 uint32_t c; 83 |
84 size = sc->sc_stride * vd->vd_height; |
|
84 switch (sc->sc_depth) { 85 case 8: | 85 switch (sc->sc_depth) { 86 case 8: |
86 for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++) 87 *(uint8_t *)(sc->sc_addr + ofs) = color; | 87 c = (color << 24) | (color << 16) | (color << 8) | color; 88 for (ofs = 0; ofs < size/4; ofs++) 89 *(uint32_t *)(sc->sc_addr + 4*ofs) = c; |
88 break; 89 case 32: 90 c = sc->sc_colormap[color]; | 90 break; 91 case 32: 92 c = sc->sc_colormap[color]; |
91 for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++) | 93 for (ofs = 0; ofs < size; ofs++) |
92 *(uint32_t *)(sc->sc_addr + 4*ofs) = c; 93 break; 94 default: 95 /* panic? */ 96 break; 97 } 98} 99 --- 249 unchanged lines hidden --- | 94 *(uint32_t *)(sc->sc_addr + 4*ofs) = c; 95 break; 96 default: 97 /* panic? */ 98 break; 99 } 100} 101 --- 249 unchanged lines hidden --- |