From cefdf5e62eae54a4c575c27947ca681a438ade33 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 29 Nov 2004 22:07:42 +0000 Subject: Move the struct wsscreen_descr from a per-driver global to a per-instance field of the sunfb structure. This allows multiple instances of the same driver, but with different resolutions (such as a couple of vigra or a TGX cgsix and a TGX+ cgsix) to use distinct wsscreen_descr structures featuring different resolution information. Doing this allows more wsscreen_descr fiddling inside the sparc* fb api, and results in some code shrinkage (about 4KB on sparc GENERIC). --- sys/arch/sparc/dev/agten.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'sys/arch/sparc/dev/agten.c') diff --git a/sys/arch/sparc/dev/agten.c b/sys/arch/sparc/dev/agten.c index ac7afb65780..675a3578da3 100644 --- a/sys/arch/sparc/dev/agten.c +++ b/sys/arch/sparc/dev/agten.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agten.c,v 1.5 2003/06/28 17:05:33 miod Exp $ */ +/* $OpenBSD: agten.c,v 1.6 2004/11/29 22:07:36 miod Exp $ */ /* * Copyright (c) 2002, 2003, Miodrag Vallat. * All rights reserved. @@ -105,18 +105,6 @@ struct agten_softc { int sc_nscreens; }; -struct wsscreen_descr agten_stdscreen = { - "std", -}; - -const struct wsscreen_descr *agten_scrlist[] = { - &agten_stdscreen, -}; - -struct wsscreen_list agten_screenlist = { - sizeof(agten_scrlist) / sizeof(struct wsscreen_descr *), agten_scrlist -}; - int agten_ioctl(void *, u_long, caddr_t, int, struct proc *); int agten_alloc_screen(void *, const struct wsscreen_descr *, void **, int *, int *, long *); @@ -172,7 +160,6 @@ agtenattach(struct device *parent, struct device *self, void *args) { struct agten_softc *sc = (struct agten_softc *)self; struct confargs *ca = args; - struct wsemuldisplaydev_attach_args waa; int node, isconsole; char *nam; @@ -227,23 +214,13 @@ agtenattach(struct device *parent, struct device *self, void *args) fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR); fbwscons_setcolormap(&sc->sc_sunfb, agten_setcolor); - agten_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps; - agten_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows; - agten_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols; - agten_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops; - if (isconsole) { - fbwscons_console_init(&sc->sc_sunfb, &agten_stdscreen, -1, - NULL); + fbwscons_console_init(&sc->sc_sunfb, -1, NULL); } sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev); - waa.console = isconsole; - waa.scrdata = &agten_screenlist; - waa.accessops = &agten_accessops; - waa.accesscookie = sc; - config_found(self, &waa, wsemuldisplaydevprint); + fbwscons_attach(&sc->sc_sunfb, &agten_accessops, isconsole); } int -- cgit v1.2.3