From: aoyama Date: Sun, 6 Nov 2022 13:01:22 +0000 (+0000) Subject: Change character drawing depth when 'pseudo' framebuffer depth is changed. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=369bbb89944436515463983581e6f2eb42963e1f;p=openbsd Change character drawing depth when 'pseudo' framebuffer depth is changed. Tested on LUNA-88K2 with 4bpp/8bpp framebuffer by me. --- diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c index b2730131ef4..cc41a0eaf6d 100644 --- a/sys/arch/luna88k/dev/lunafb.c +++ b/sys/arch/luna88k/dev/lunafb.c @@ -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; diff --git a/sys/arch/luna88k/dev/omrasops.c b/sys/arch/luna88k/dev/omrasops.c index 70f95280e6f..d95ebd17a5e 100644 --- a/sys/arch/luna88k/dev/omrasops.c +++ b/sys/arch/luna88k/dev/omrasops.c @@ -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