Module Name: src Committed By: macallan Date: Tue Feb 14 08:22:02 UTC 2023
Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c wsdisplay_vconsvar.h Log Message: add flags for drivers to requesr R2L bit/byte-ordered fonts, default to L2R, chack them in vcons_load_font() instead of just trusting that we'd get what we need To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/wscons/wsdisplay_vcons.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsdisplay_vconsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.65 src/sys/dev/wscons/wsdisplay_vcons.c:1.66 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.65 Tue Feb 14 08:14:02 2023 +++ src/sys/dev/wscons/wsdisplay_vcons.c Tue Feb 14 08:22:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -478,7 +478,14 @@ vcons_load_font(void *v, void *cookie, s flags |= WSFONT_FIND_ALPHA; } - fcookie = wsfont_find(f->name, 0, 0, 0, 0, 0, flags); + fcookie = wsfont_find(f->name, 0, 0, 0, + /* bitorder */ + scr->scr_flags & VCONS_FONT_BITS_R2L ? + WSDISPLAY_FONTORDER_R2L : WSDISPLAY_FONTORDER_L2R, + /* byteorder */ + scr->scr_flags & VCONS_FONT_BYTES_R2L ? + WSDISPLAY_FONTORDER_R2L : WSDISPLAY_FONTORDER_L2R, + flags); if (fcookie == -1) return EINVAL; Index: src/sys/dev/wscons/wsdisplay_vconsvar.h diff -u src/sys/dev/wscons/wsdisplay_vconsvar.h:1.33 src/sys/dev/wscons/wsdisplay_vconsvar.h:1.34 --- src/sys/dev/wscons/wsdisplay_vconsvar.h:1.33 Sun Jul 17 20:23:17 2022 +++ src/sys/dev/wscons/wsdisplay_vconsvar.h Tue Feb 14 08:22:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.33 2022/07/17 20:23:17 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.34 2023/02/14 08:22:02 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -70,6 +70,11 @@ struct vcons_screen { #define VCONS_LOADFONT 0x40 /* driver can load_font() */ #define VCONS_NO_CURSOR 0x80 /* use putchar() based cursor(), to * avoid fb reads */ +#define VCONS_FONT_BITS_R2L 0x100 /* request right-to-left bitorder in + * wsfont_find() */ +#define VCONS_FONT_BYTES_R2L 0x200 /* request right-to-left byteorder in + * wsfont_find() */ + /* status flags used by vcons */ uint32_t scr_status; #define VCONS_IS_VISIBLE 1 /* this screen is currently visible */