Module Name: src
Committed By: macallan
Date: Wed Nov 13 08:21:16 UTC 2024
Modified Files:
src/sys/arch/hppa/dev: gftfb.c hyperfb.c
Log Message:
set things up even if we're not the console
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hppa/dev/gftfb.c
cvs rdiff -u -r1.18 -r1.19 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/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.26 src/sys/arch/hppa/dev/gftfb.c:1.27
--- src/sys/arch/hppa/dev/gftfb.c:1.26 Sun Oct 27 19:23:47 2024
+++ src/sys/arch/hppa/dev/gftfb.c Wed Nov 13 08:21:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: gftfb.c,v 1.26 2024/10/27 19:23:47 riastradh Exp $ */
+/* $NetBSD: gftfb.c,v 1.27 2024/11/13 08:21:16 macallan Exp $ */
/* $OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $ */
@@ -295,52 +295,32 @@ gftfb_attach(device_t parent, device_t s
sc->sc_gc.gc_blitcookie = sc;
sc->sc_gc.gc_rop = RopSrc;
- if (is_console) {
- vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
- sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
-
- sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
- sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
- sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
- sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
-
- glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
- sc->sc_scr.fbheight - sc->sc_height - 5,
- sc->sc_scr.fbwidth,
- ri->ri_font->fontwidth,
- ri->ri_font->fontheight,
- defattr);
+ vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1, &defattr);
+ sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
+
+ sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
+ sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
+ sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
+ sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
+
+ glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
+ sc->sc_scr.fbheight - sc->sc_height - 5,
+ sc->sc_scr.fbwidth,
+ ri->ri_font->fontwidth,
+ ri->ri_font->fontheight,
+ defattr);
+
+ gftfb_restore_palette(sc);
+ gftfb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
+ ri->ri_devcmap[(defattr >> 16) & 0xff]);
+ if (is_console) {
wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
defattr);
- gftfb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
- ri->ri_devcmap[(defattr >> 16) & 0xff]);
-
vcons_replay_msgbuf(&sc->sc_console_screen);
- } else {
- /*
- * since we're not the console we can postpone the rest
- * until someone actually allocates a screen for us
- */
- if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
- /* do some minimal setup to avoid weirdnesses later */
- vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
- } else
- (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
-
- glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
- sc->sc_scr.fbheight - sc->sc_height - 5,
- sc->sc_scr.fbwidth,
- ri->ri_font->fontwidth,
- ri->ri_font->fontheight,
- defattr);
}
- gftfb_restore_palette(sc);
-
/* no suspend/resume support yet */
if (!pmf_device_register(sc->sc_dev, NULL, NULL))
aprint_error_dev(sc->sc_dev,
Index: src/sys/arch/hppa/dev/hyperfb.c
diff -u src/sys/arch/hppa/dev/hyperfb.c:1.18 src/sys/arch/hppa/dev/hyperfb.c:1.19
--- src/sys/arch/hppa/dev/hyperfb.c:1.18 Wed Oct 16 09:56:34 2024
+++ src/sys/arch/hppa/dev/hyperfb.c Wed Nov 13 08:21:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: hyperfb.c,v 1.18 2024/10/16 09:56:34 macallan Exp $ */
+/* $NetBSD: hyperfb.c,v 1.19 2024/11/13 08:21:16 macallan Exp $ */
/*
* Copyright (c) 2024 Michael Lorenz
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.18 2024/10/16 09:56:34 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.19 2024/11/13 08:21:16 macallan Exp $");
#include "opt_cputype.h"
#include "opt_hyperfb.h"
@@ -430,55 +430,34 @@ hyperfb_attach(device_t parent, device_t
//sc->sc_gc.gc_blitcookie = sc;
//sc->sc_gc.gc_rop = RopSrc;
- if (sc->sc_is_console) {
- vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
- sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
-
- sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
- sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
- sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
- sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
+ vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1, &defattr);
+ sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
+
+ sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
+ sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
+ sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
+ sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
#if 0
- glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
- sc->sc_scr.fbheight - sc->sc_height - 5,
- sc->sc_scr.fbwidth,
- ri->ri_font->fontwidth,
- ri->ri_font->fontheight,
- defattr);
+ glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
+ sc->sc_scr.fbheight - sc->sc_height - 5,
+ sc->sc_scr.fbwidth,
+ ri->ri_font->fontwidth,
+ ri->ri_font->fontheight,
+ defattr);
#endif
- wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
- defattr);
- hyperfb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
- ri->ri_devcmap[(defattr >> 16) & 0xff]);
+ hyperfb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
+ ri->ri_devcmap[(defattr >> 16) & 0xff]);
+ hyperfb_restore_palette(sc);
- vcons_replay_msgbuf(&sc->sc_console_screen);
- } else {
- /*
- * since we're not the console we can postpone the rest
- * until someone actually allocates a screen for us
- */
- if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
- /* do some minimal setup to avoid weirdnesses later */
- vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
- } else
- (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+ if (sc->sc_is_console) {
-#if 0
- glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
- sc->sc_scr.fbheight - sc->sc_height - 5,
- sc->sc_scr.fbwidth,
- ri->ri_font->fontwidth,
- ri->ri_font->fontheight,
- defattr);
-#endif
+ wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
+ defattr);
+ vcons_replay_msgbuf(&sc->sc_console_screen);
}
- hyperfb_restore_palette(sc);
-
/* no suspend/resume support yet */
if (!pmf_device_register(sc->sc_dev, NULL, NULL))
aprint_error_dev(sc->sc_dev,
@@ -914,7 +893,7 @@ hyperfb_setup(struct hyperfb_softc *sc)
0, 0));
/* dst bitmap access */
hyperfb_write4(sc, NGLE_REG_11,
- BA(IndexedDcd, Otc32, OtsIndirect, AddrLong, 0, BINapp0F8,
+ BA(FractDcd, Otc32, OtsIndirect, AddrLong, 0, BINapp0F8,
0));
hyperfb_wait_fifo(sc, 3);
hyperfb_write4(sc, NGLE_REG_35, 0x00ffffff); /* fg colour */