Module Name:    src
Committed By:   macallan
Date:           Wed Jun  1 05:06:17 UTC 2011

Modified Files:
        src/sys/dev/pci: machfb.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/machfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.66 src/sys/dev/pci/machfb.c:1.67
--- src/sys/dev/pci/machfb.c:1.66	Mon May 16 00:59:37 2011
+++ src/sys/dev/pci/machfb.c	Wed Jun  1 05:06:17 2011
@@ -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);

Reply via email to