Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons add flags for drivers to requesr R2L bit/byte...



details:   https://anonhg.NetBSD.org/src/rev/cc161e9194d8
branches:  trunk
changeset: 373507:cc161e9194d8
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Feb 14 08:22:02 2023 +0000

description:
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

diffstat:

 sys/dev/wscons/wsdisplay_vcons.c    |  13 ++++++++++---
 sys/dev/wscons/wsdisplay_vconsvar.h |   7 ++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 7ceb6cb271fd -r cc161e9194d8 sys/dev/wscons/wsdisplay_vcons.c
--- a/sys/dev/wscons/wsdisplay_vcons.c  Tue Feb 14 08:14:02 2023 +0000
+++ b/sys/dev/wscons/wsdisplay_vcons.c  Tue Feb 14 08:22:02 2023 +0000
@@ -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 @@
                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;
 
diff -r 7ceb6cb271fd -r cc161e9194d8 sys/dev/wscons/wsdisplay_vconsvar.h
--- a/sys/dev/wscons/wsdisplay_vconsvar.h       Tue Feb 14 08:14:02 2023 +0000
+++ b/sys/dev/wscons/wsdisplay_vconsvar.h       Tue Feb 14 08:22:02 2023 +0000
@@ -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 @@
 #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 */



Home | Main Index | Thread Index | Old Index