Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Map coprocessor registers before igsfb_hw_setup()...



details:   https://anonhg.NetBSD.org/src/rev/c3f2359f1d28
branches:  trunk
changeset: 821137:c3f2359f1d28
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Jan 25 16:11:54 2017 +0000

description:
Map coprocessor registers before igsfb_hw_setup(), they are needed for
setting up the video mode.

diffstat:

 sys/dev/ic/igsfb.c |  35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diffs (79 lines):

diff -r 6a156184e582 -r c3f2359f1d28 sys/dev/ic/igsfb.c
--- a/sys/dev/ic/igsfb.c        Wed Jan 25 15:51:07 2017 +0000
+++ b/sys/dev/ic/igsfb.c        Wed Jan 25 16:11:54 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: igsfb.c,v 1.54 2017/01/25 15:51:07 jakllsch Exp $ */
+/*     $NetBSD: igsfb.c,v 1.55 2017/01/25 16:11:54 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
  * Integraphics Systems IGA 168x and CyberPro series.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.54 2017/01/25 15:51:07 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.55 2017/01/25 16:11:54 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -279,6 +279,20 @@
                }
        }
 
+       /*
+        * Map graphic coprocessor for mode setting and accelerated rasops.
+        */
+       if (dc->dc_id >= 0x2000) { /* XXX */
+               if (bus_space_map(dc->dc_iot,
+                                 dc->dc_iobase + IGS_COP_BASE_B, IGS_COP_SIZE,
+                                 dc->dc_ioflags,
+                                 &dc->dc_coph) != 0)
+               {
+                       printf("unable to map COP registers\n");
+                       return 1;
+               }
+       }
+
        igsfb_hw_setup(dc);
 
        /*
@@ -289,6 +303,9 @@
                          dc->dc_memflags | BUS_SPACE_MAP_LINEAR,
                          &dc->dc_fbh) != 0)
        {
+               if (dc->dc_id >= 0x2000) { /* XXX */
+                       bus_space_unmap(dc->dc_iot, dc->dc_coph, IGS_COP_SIZE);
+               }
                bus_space_unmap(dc->dc_iot, dc->dc_ioh, IGS_REG_SIZE);
                printf("unable to map framebuffer\n");
                return 1;
@@ -305,6 +322,9 @@
                          dc->dc_memflags | BUS_SPACE_MAP_LINEAR,
                          &dc->dc_crh) != 0)
        {
+               if (dc->dc_id >= 0x2000) { /* XXX */
+                       bus_space_unmap(dc->dc_iot, dc->dc_coph, IGS_COP_SIZE);
+               }
                bus_space_unmap(dc->dc_iot, dc->dc_ioh, IGS_REG_SIZE);
                bus_space_unmap(dc->dc_memt, dc->dc_fbh, dc->dc_fbsz);
                printf("unable to map cursor sprite region\n");
@@ -336,18 +356,9 @@
        dc->dc_curenb = 0;
 
        /*
-        * Map and init graphic coprocessor for accelerated rasops.
+        * Init graphic coprocessor for accelerated rasops.
         */
        if (dc->dc_id >= 0x2000) { /* XXX */
-               if (bus_space_map(dc->dc_iot,
-                                 dc->dc_iobase + IGS_COP_BASE_B, IGS_COP_SIZE,
-                                 dc->dc_ioflags,
-                                 &dc->dc_coph) != 0)
-               {
-                       printf("unable to map COP registers\n");
-                       return 1;
-               }
-
                /* XXX: hardcoded 8bpp */
                bus_space_write_2(dc->dc_iot, dc->dc_coph,
                                  IGS_COP_SRC_MAP_WIDTH_REG,



Home | Main Index | Thread Index | Old Index