Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun apply patches from PR 49639



details:   https://anonhg.NetBSD.org/src/rev/45782c96e85e
branches:  trunk
changeset: 448086:45782c96e85e
user:      macallan <macallan%NetBSD.org@localhost>
date:      Mon Jan 21 06:23:17 2019 +0000

description:
apply patches from PR 49639
compile tested only for lack of hardware

diffstat:

 sys/dev/sun/bwtwo.c |  23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r 43f376d5d882 -r 45782c96e85e sys/dev/sun/bwtwo.c
--- a/sys/dev/sun/bwtwo.c       Mon Jan 21 04:15:50 2019 +0000
+++ b/sys/dev/sun/bwtwo.c       Mon Jan 21 06:23:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $ */
+/*     $NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -434,6 +434,13 @@
                                        }
                                }
                        }
+                       return 0;
+               case WSDISPLAYIO_GET_FBINFO:
+                       {
+                               struct wsdisplayio_fbinfo *fbi = data;
+
+                               return wsdisplayio_get_fbinfo(&ms->scr_ri, fbi);
+                       }
        }
        return EPASSTHROUGH;
 }
@@ -441,8 +448,16 @@
 paddr_t
 bwtwo_mmap(void *v, void *vs, off_t offset, int prot)
 {
-       /* I'm not at all sure this is the right thing to do */
-       return bwtwommap(0, offset, prot); /* assume minor dev 0 for now */
+       struct vcons_data *vd = v;
+       struct bwtwo_softc *sc = vd->cookie;
+
+       if (offset < 0) return -1;
+       if (offset >= sc->sc_fb.fb_type.fb_size)
+               return -1;
+
+       return bus_space_mmap(sc->sc_bustag,
+               sc->sc_paddr, sc->sc_pixeloffset + offset,
+               prot, BUS_SPACE_MAP_LINEAR);
 }
 
 void



Home | Main Index | Thread Index | Old Index