Module Name: src Committed By: macallan Date: Wed Mar 5 07:03:16 UTC 2025
Modified Files: src/sys/arch/hppa/dev: hyperfb.c Log Message: now that we can draw rectangles in exactly the size we want without abusing the pixel mask, we no longer need to draw characters in two passes - just disable transparency, set fore- and background, and go. Only clear the character cell when drawing blanks. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/dev/hyperfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hppa/dev/hyperfb.c diff -u src/sys/arch/hppa/dev/hyperfb.c:1.20 src/sys/arch/hppa/dev/hyperfb.c:1.21 --- src/sys/arch/hppa/dev/hyperfb.c:1.20 Wed Mar 5 04:36:59 2025 +++ src/sys/arch/hppa/dev/hyperfb.c Wed Mar 5 07:03:16 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: hyperfb.c,v 1.20 2025/03/05 04:36:59 macallan Exp $ */ +/* $NetBSD: hyperfb.c,v 1.21 2025/03/05 07:03:16 macallan Exp $ */ /* * Copyright (c) 2024 Michael Lorenz @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.20 2025/03/05 04:36:59 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.21 2025/03/05 07:03:16 macallan Exp $"); #include "opt_cputype.h" #include "opt_hyperfb.h" @@ -978,11 +978,9 @@ hyperfb_set_video(struct hyperfb_softc * } } -static void -hyperfb_rectfill(struct hyperfb_softc *sc, int x, int y, int wi, int he, - uint32_t bg) +static inline void +hyperfb_fillmode(struct hyperfb_softc *sc) { - if (sc->sc_hwmode != HW_FILL) { hyperfb_wait_fifo(sc, 3); /* plane mask */ @@ -990,15 +988,23 @@ hyperfb_rectfill(struct hyperfb_softc *s /* bitmap op */ hyperfb_write4(sc, NGLE_REG_14, IBOvals(RopSrc, 0, BitmapExtent08, 1, DataDynamic, 0, - 1 /* bg transparent */, 0)); + 0, 0)); /* dst bitmap access */ hyperfb_write4(sc, NGLE_REG_11, BA(IndexedDcd, Otc32, OtsIndirect, AddrLong, 0, BINovly, 0)); sc->sc_hwmode = HW_FILL; } - hyperfb_wait_fifo(sc, 4); +} + +static void +hyperfb_rectfill(struct hyperfb_softc *sc, int x, int y, int wi, int he, + uint32_t bg) +{ + hyperfb_fillmode(sc); + + hyperfb_wait_fifo(sc, 4); /* * XXX - the NGLE code calls this 'transfer data' * in reality it's a bit mask applied per pixel, @@ -1111,12 +1117,13 @@ hyperfb_putchar(void *cookie, int row, i bg = ri->ri_devcmap[(attr >> 16) & 0xf]; fg = ri->ri_devcmap[(attr >> 24) & 0x0f]; - /* clear the character cell */ - hyperfb_rectfill(sc, x, y, wi, he, bg); /* if we're drawing a space we're done here */ - if (c == 0x20) + if (c == 0x20) { + /* clear the character cell */ + hyperfb_rectfill(sc, x, y, wi, he, bg); return; + } #if 0 rv = glyphcache_try(&sc->sc_gc, c, x, y, attr); @@ -1126,10 +1133,13 @@ hyperfb_putchar(void *cookie, int row, i data = WSFONT_GLYPH(c, font); - hyperfb_wait_fifo(sc, 2); + hyperfb_fillmode(sc); + + hyperfb_wait_fifo(sc, 3); /* character colour */ hyperfb_write4(sc, NGLE_REG_35, fg); + hyperfb_write4(sc, NGLE_REG_36, bg); /* dst XY */ hyperfb_write4(sc, NGLE_REG_6, (x << 16) | y);