Add a way to tell grf_establish() that internal video doesn't actually

occupy a slot.  This is necessary so that GRFIOCMAP can find the correct
physical address of the framebuffer.  Fixes P550, some LC models, and
perhaps the PB520.
This commit is contained in:
scottr 1996-08-04 06:03:47 +00:00
parent 9931b6b324
commit 89f4fddbfe
7 changed files with 21 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf.c,v 1.33 1996/05/19 22:27:04 scottr Exp $ */
/* $NetBSD: grf.c,v 1.34 1996/08/04 06:03:47 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -344,6 +344,7 @@ grfmap(dev, addrp, p)
caddr_t *addrp;
struct proc *p;
{
extern u_int32_t mac68k_vidphys;
struct grf_softc *gp;
struct specinfo si;
struct vnode vn;
@ -358,8 +359,11 @@ grfmap(dev, addrp, p)
len = mac68k_round_page(gp->sc_grfmode->fbsize + gp->sc_grfmode->fboff);
flags = MAP_SHARED | MAP_FIXED;
*addrp = (caddr_t) mac68k_trunc_page(
NUBUS_SLOT_TO_PADDR(gp->sc_slot->slot));
if (gp->sc_slot == NULL)
*addrp = (caddr_t) mac68k_trunc_page(mac68k_vidphys);
else
*addrp = (caddr_t) mac68k_trunc_page(
NUBUS_SLOT_TO_PADDR(gp->sc_slot->slot));
vn.v_type = VCHR; /* XXX */
vn.v_specinfo = &si; /* XXX */

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_iv.c,v 1.12 1996/05/19 22:27:06 scottr Exp $ */
/* $NetBSD: grf_iv.c,v 1.13 1996/08/04 06:03:52 scottr Exp $ */
/*
* Copyright (c) 1995 Allen Briggs. All rights reserved.
@ -110,7 +110,7 @@ grfiv_attach(parent, self, aux)
gm->fboff = 0;
/* Perform common video attachment. */
grf_establish(sc, grfiv_mode, grfiv_phys);
grf_establish(sc, NULL, grfiv_mode, grfiv_phys);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_mv.c,v 1.11 1996/05/19 22:27:07 scottr Exp $ */
/* $NetBSD: grf_mv.c,v 1.12 1996/08/04 06:03:54 scottr Exp $ */
/*
* Copyright (c) 1995 Allen Briggs. All rights reserved.
@ -242,7 +242,7 @@ grfmv_attach(parent, self, aux)
add_nubus_intr(sc->sc_slot.slot, grfmv_intr, sc);
/* Perform common video attachment. */
grf_establish(sc, grfmv_mode, grfmv_phys);
grf_establish(sc, &sc->sc_slot, grfmv_mode, grfmv_phys);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_subr.c,v 1.1 1996/05/19 22:27:08 scottr Exp $ */
/* $NetBSD: grf_subr.c,v 1.2 1996/08/04 06:03:56 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,8 +46,9 @@
#include <mac68k/dev/grfvar.h>
void
grf_establish(sc, g_mode, g_phys)
grf_establish(sc, sp, g_mode, g_phys)
struct grfbus_softc *sc;
nubus_slot *sp;
int (*g_mode) __P((struct grf_softc *, int, void *));
caddr_t (*g_phys) __P((struct grf_softc *, vm_offset_t));
{
@ -64,7 +65,7 @@ grf_establish(sc, g_mode, g_phys)
/* Attach grf semantics to the hardware. */
ga.ga_name = "grf";
ga.ga_grfmode = gm;
ga.ga_slot = &sc->sc_slot; /* XXX */
ga.ga_slot = sp;
ga.ga_mode = g_mode;
ga.ga_phys = g_phys;
(void)config_found(&sc->sc_dev, &ga, grfbusprint);

View File

@ -1,4 +1,4 @@
/* $NetBSD: grfvar.h,v 1.10 1996/05/19 22:27:10 scottr Exp $ */
/* $NetBSD: grfvar.h,v 1.11 1996/08/04 06:03:58 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -143,7 +143,7 @@ int grfaddr __P((struct grf_softc *gp, register int off));
int grfmap __P((dev_t dev, caddr_t *addrp, struct proc *p));
int grfunmap __P((dev_t dev, caddr_t addr, struct proc *p));
void grf_establish __P((struct grfbus_softc *,
void grf_establish __P((struct grfbus_softc *, nubus_slot *,
int (*)(struct grf_softc *, int, void *),
caddr_t (*)(struct grf_softc *, vm_offset_t)));
int grfbusprint __P((void *, char *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_nubus.c,v 1.11 1996/05/19 22:27:07 scottr Exp $ */
/* $NetBSD: grf_nubus.c,v 1.12 1996/08/04 06:03:54 scottr Exp $ */
/*
* Copyright (c) 1995 Allen Briggs. All rights reserved.
@ -242,7 +242,7 @@ grfmv_attach(parent, self, aux)
add_nubus_intr(sc->sc_slot.slot, grfmv_intr, sc);
/* Perform common video attachment. */
grf_establish(sc, grfmv_mode, grfmv_phys);
grf_establish(sc, &sc->sc_slot, grfmv_mode, grfmv_phys);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_obio.c,v 1.12 1996/05/19 22:27:06 scottr Exp $ */
/* $NetBSD: grf_obio.c,v 1.13 1996/08/04 06:03:52 scottr Exp $ */
/*
* Copyright (c) 1995 Allen Briggs. All rights reserved.
@ -110,7 +110,7 @@ grfiv_attach(parent, self, aux)
gm->fboff = 0;
/* Perform common video attachment. */
grf_establish(sc, grfiv_mode, grfiv_phys);
grf_establish(sc, NULL, grfiv_mode, grfiv_phys);
}
static int