Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci move wsdisplay_accessops into the softc so multi...



details:   https://anonhg.NetBSD.org/src/rev/e53a11dc267e
branches:  trunk
changeset: 765601:e53a11dc267e
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Jun 01 05:06:17 2011 +0000

description:
move wsdisplay_accessops into the softc so multiple instances have a chance
to work without stepping on each other's toes

diffstat:

 sys/dev/pci/machfb.c |  21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diffs (70 lines):

diff -r 054a6bb97555 -r e53a11dc267e sys/dev/pci/machfb.c
--- a/sys/dev/pci/machfb.c      Wed Jun 01 03:39:45 2011 +0000
+++ b/sys/dev/pci/machfb.c      Wed Jun 01 05:06:17 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machfb.c,v 1.66 2011/05/16 00:59:37 macallan Exp $     */
+/*     $NetBSD: machfb.c,v 1.67 2011/06/01 05:06:17 macallan Exp $     */
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, 
-       "$NetBSD: machfb.c,v 1.66 2011/05/16 00:59:37 macallan Exp $");
+       "$NetBSD: machfb.c,v 1.67 2011/06/01 05:06:17 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -152,6 +152,7 @@
        u_char sc_cmap_blue[256];
        int sc_dacw, sc_blanked, sc_console;
        struct vcons_data vd;
+       struct wsdisplay_accessops sc_accessops;
 };
 
 struct mach64_crtcregs {
@@ -378,16 +379,6 @@
 static int     mach64_load_font(void *, void *, struct wsdisplay_font *);
 #endif
 
-static struct wsdisplay_accessops mach64_accessops = {
-       mach64_ioctl,
-       mach64_mmap,
-       NULL,                   /* vcons_alloc_screen */
-       NULL,                   /* vcons_free_screen */
-       NULL,                   /* vcons_show_screen */
-       NULL,                   /* load_font */
-       NULL,                   /* polls */
-       NULL,                   /* scroll */
-};
 
 static struct vcons_screen mach64_console_screen;
 
@@ -533,6 +524,8 @@
        sc->sc_nfunc = pa->pa_function;
        sc->sc_locked = 0;
        sc->sc_iot = pa->pa_iot;
+       sc->sc_accessops.ioctl = mach64_ioctl;
+       sc->sc_accessops.mmap = mach64_mmap;
 
        pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
        aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
@@ -763,7 +756,7 @@
        wsfont_init();
        
        sc->sc_bg = WS_DEFAULT_BG;
-       vcons_init(&sc->vd, sc, &mach64_defaultscreen, &mach64_accessops);
+       vcons_init(&sc->vd, sc, &mach64_defaultscreen, &sc->sc_accessops);
        sc->vd.init_screen = mach64_init_screen;
 
        mach64_init_lut(sc);
@@ -794,7 +787,7 @@
                
        aa.console = sc->sc_console;
        aa.scrdata = &mach64_screenlist;
-       aa.accessops = &mach64_accessops;
+       aa.accessops = &sc->sc_accessops;
        aa.accesscookie = &sc->vd;
 
        config_found(self, &aa, wsemuldisplaydevprint);



Home | Main Index | Thread Index | Old Index