Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/atari Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/49c25aef9cd9
branches:  netbsd-9
changeset: 369990:49c25aef9cd9
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 11 18:23:30 2022 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1521):

        sys/arch/atari/pci/pci_vga.c: revision 1.19
        sys/arch/atari/conf/MILAN.in: revision 1.30

Improve VGA console settings for Milan, especially for sysinst.
- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
  (so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
  (copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64.  (XXX: needs working HADES with ET4000)

Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.

diffstat:

 sys/arch/atari/conf/MILAN.in |   4 +-
 sys/arch/atari/pci/pci_vga.c |  77 +++++++++++++++++++++++++++++++++++--------
 2 files changed, 65 insertions(+), 16 deletions(-)

diffs (134 lines):

diff -r 16650472c9b9 -r 49c25aef9cd9 sys/arch/atari/conf/MILAN.in
--- a/sys/arch/atari/conf/MILAN.in      Sun Sep 11 18:21:56 2022 +0000
+++ b/sys/arch/atari/conf/MILAN.in      Sun Sep 11 18:23:30 2022 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: MILAN.in,v 1.29 2019/05/04 13:12:03 tsutsui Exp $
+#      $NetBSD: MILAN.in,v 1.29.2.1 2022/09/11 18:23:30 martin Exp $
 #
 # Milan
 #
@@ -34,6 +34,8 @@
 options        PCDISPLAY_SOFTCURSOR
 # modify the screen type of the console; defaults to "80x25"
 #options       VGA_CONSOLE_SCREENTYPE="\"80x25\""
+# use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
+options        FONT_VT220L8x16
 
 #
 # The following sections describe various hardware options.
diff -r 16650472c9b9 -r 49c25aef9cd9 sys/arch/atari/pci/pci_vga.c
--- a/sys/arch/atari/pci/pci_vga.c      Sun Sep 11 18:21:56 2022 +0000
+++ b/sys/arch/atari/pci/pci_vga.c      Sun Sep 11 18:23:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_vga.c,v 1.17 2019/05/04 09:03:08 tsutsui Exp $     */
+/*     $NetBSD: pci_vga.c,v 1.17.2.1 2022/09/11 18:23:30 martin Exp $  */
 
 /*
  * Copyright (c) 1999 Leo Weppelman.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.17 2019/05/04 09:03:08 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.17.2.1 2022/09/11 18:23:30 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -55,11 +55,51 @@
 extern font_info       font_info_8x16;
 
 /* Console colors */
-static const uint8_t conscolors[3][3] = {
-       /* background, foreground, hilite */
-       { 0x00, 0x00, 0x00 },
-       { 0x30, 0x30, 0x30 },
-       { 0x3f, 0x3f, 0x3f }
+/* attribute controller registers */
+static const uint8_t vga_atc[] = {
+       0x00,   /* 00: internal palette  0 */
+       0x01,   /* 01: internal palette  1 */
+       0x02,   /* 02: internal palette  2 */
+       0x03,   /* 03: internal palette  3 */
+       0x04,   /* 04: internal palette  4 */
+       0x05,   /* 05: internal palette  5 */
+       0x14,   /* 06: internal palette  6 */
+       0x07,   /* 07: internal palette  7 */
+       0x38,   /* 08: internal palette  8 */
+       0x39,   /* 09: internal palette  9 */
+       0x3a,   /* 0A: internal palette 10 */
+       0x3b,   /* 0B: internal palette 11 */
+       0x3c,   /* 0C: internal palette 12 */
+       0x3d,   /* 0D: internal palette 13 */
+       0x3e,   /* 0E: internal palette 14 */
+       0x3f,   /* 0F: internal palette 15 */
+       0x0c,   /* 10: attribute mode control */
+       0x00,   /* 11: overscan color */
+       0x0f,   /* 12: color plane enable */
+       0x08,   /* 13: horizontal PEL panning */
+       0x00    /* 14: color select */
+};
+
+/* video DAC palette registers */
+/* XXX only set up 16 colors used by internal palette in ATC regsters */
+static const uint8_t vga_dacpal[] = {
+       /* R     G     B */
+       0x00, 0x00, 0x00,       /* BLACK        */
+       0x00, 0x00, 0x2a,       /* BLUE         */
+       0x00, 0x2a, 0x00,       /* GREEN        */
+       0x00, 0x2a, 0x2a,       /* CYAN         */
+       0x2a, 0x00, 0x00,       /* RED          */
+       0x2a, 0x00, 0x2a,       /* MAGENTA      */
+       0x2a, 0x15, 0x00,       /* BROWN        */
+       0x2a, 0x2a, 0x2a,       /* LIGHTGREY    */
+       0x15, 0x15, 0x15,       /* DARKGREY     */
+       0x15, 0x15, 0x3f,       /* LIGHTBLUE    */
+       0x15, 0x3f, 0x15,       /* LIGHTGREEN   */
+       0x15, 0x3f, 0x3f,       /* LIGHTCYAN    */
+       0x3f, 0x15, 0x15,       /* LIGHTRED     */
+       0x3f, 0x15, 0x3f,       /* LIGHTMAGENTA */
+       0x3f, 0x3f, 0x15,       /* YELLOW       */
+       0x3f, 0x3f, 0x3f        /* WHITE        */
 };
 
 static bus_space_tag_t vga_iot, vga_memt;
@@ -79,7 +119,7 @@
        pci_chipset_tag_t       pc = NULL; /* XXX */
        bus_space_handle_t      ioh_regs, memh_fb;
        pcitag_t                tag;
-       int                     device, found, maxndevs, i, j;
+       int                     device, found, maxndevs, i;
        int                     got_ioh, got_memh, rv;
        uint32_t                id, class;
        volatile uint8_t        *regs;
@@ -176,16 +216,23 @@
         * Generic parts of the initialization...
         */
        
-       /* B&W colors */
-       vgaw(regs, VDAC_ADDRESS_W, 0);
-       for (i = 0; i < 256; i++) {
-               j = (i & 1) ? ((i > 7) ? 2 : 1) : 0;
-               vgaw(regs, VDAC_DATA, conscolors[j][0]);
-               vgaw(regs, VDAC_DATA, conscolors[j][1]);
-               vgaw(regs, VDAC_DATA, conscolors[j][2]);
+       /* set ATC registers */
+       for (i = 0; i < 21; i++)
+               WAttr(regs, i, vga_atc[i]);
+
+       /* set DAC palette */
+       for (i = 0; i < 16; i++) {
+               vgaw(regs, VDAC_ADDRESS_W, vga_atc[i]);
+               vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 0]);
+               vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 1]);
+               vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 2]);
        }
 
        loadfont(regs, fb);
+#if NVGA_PCI > 0
+       /* use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes */
+       vga_no_builtinfont = 1;
+#endif
 
        /*
         * Clear the screen and print a message. The latter



Home | Main Index | Thread Index | Old Index