Change character drawing depth when 'pseudo' framebuffer depth is changed.
authoraoyama <aoyama@openbsd.org>
Sun, 6 Nov 2022 13:01:22 +0000 (13:01 +0000)
committeraoyama <aoyama@openbsd.org>
Sun, 6 Nov 2022 13:01:22 +0000 (13:01 +0000)
Tested on LUNA-88K2 with 4bpp/8bpp framebuffer by me.

sys/arch/luna88k/dev/lunafb.c
sys/arch/luna88k/dev/omrasops.c

index b273013..cc41a0e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunafb.c,v 1.30 2022/08/12 13:36:19 aoyama Exp $ */
+/* $OpenBSD: lunafb.c,v 1.31 2022/11/06 13:01:22 aoyama Exp $ */
 /* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
 
 /*-
@@ -542,11 +542,13 @@ omfb_set_gfxmode(struct omfb_softc *sc, struct wsdisplay_gfx_mode *wsd_gfxmode)
                /* all frame buffer support this */
                sc->sc_dc->dc_depth = 1;
                sc->sc_dc->dc_cmsize = 0;
+               setup_omrasops1(&sc->sc_dc->dc_ri);
                break;
        case 4:
                if ((hwplanebits == 4) || (hwplanebits == 8)) {
                        sc->sc_dc->dc_depth = 4;
                        sc->sc_dc->dc_cmsize = 16;
+                       setup_omrasops4(&sc->sc_dc->dc_ri);
                        break;
                } else
                        return -1;
@@ -554,6 +556,7 @@ omfb_set_gfxmode(struct omfb_softc *sc, struct wsdisplay_gfx_mode *wsd_gfxmode)
                if (hwplanebits == 8) {
                        sc->sc_dc->dc_depth = 8;
                        sc->sc_dc->dc_cmsize = 256;
+                       setup_omrasops4(&sc->sc_dc->dc_ri);
                        break;
                } else
                        return -1;
index 70f9528..d95ebd1 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: omrasops.c,v 1.17 2021/07/31 05:22:36 aoyama Exp $ */
+/* $OpenBSD: omrasops.c,v 1.18 2022/11/06 13:01:22 aoyama Exp $ */
 /* $NetBSD: omrasops.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */
 
 /*-
@@ -75,6 +75,7 @@ int   om4_windowmove(struct rasops_info *, u_int16_t, u_int16_t, u_int16_t,
 
 /* MI function in src/sys/dev/rasops/rasops.c */
 int     rasops_pack_cattr(void *, int, int, int, uint32_t *);
+int     rasops_pack_mattr(void *, int, int, int, uint32_t *);
 
 static int (*om_windowmove)(struct rasops_info *, u_int16_t, u_int16_t,
                u_int16_t, u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t);
@@ -522,6 +523,7 @@ setup_omrasops1(struct rasops_info *ri)
        ri->ri_ops.putchar = om1_putchar;
        omfb_stdscreen.capabilities
                = ri->ri_caps & ~WSSCREEN_UNDERLINE;
+       ri->ri_ops.pack_attr = rasops_pack_mattr;
 }
 
 void