From 7c2c0c846c9fc19b09f06c0e541259179b96156b Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 25 Apr 1997 19:25:38 +0000 Subject: [PATCH] - Provide the reasonable size that can/may be mmap-ed. This might differ from the current frame buffer size. - The et-driver now allows for a 16Kb io-region (was 8Kb) that can be mapped. The XFree server uses this. --- sys/arch/atari/dev/grf.c | 4 ++-- sys/arch/atari/dev/grfabs_et.c | 16 ++++++++++++---- sys/arch/atari/dev/grfabs_fal.c | 3 ++- sys/arch/atari/dev/grfabs_tt.c | 3 ++- sys/arch/atari/dev/view.c | 4 ++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/sys/arch/atari/dev/grf.c b/sys/arch/atari/dev/grf.c index 3657b3a0c877..ffb3078809c6 100644 --- a/sys/arch/atari/dev/grf.c +++ b/sys/arch/atari/dev/grf.c @@ -1,4 +1,4 @@ -/* $NetBSD: grf.c,v 1.19 1997/02/26 12:28:40 leo Exp $ */ +/* $NetBSD: grf.c,v 1.20 1997/04/25 19:25:38 leo Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -390,7 +390,7 @@ struct grf_softc *gp; gp->g_data = (caddr_t) 0xDeadBeaf; /* not particularly clean.. */ gi->gd_fbaddr = bm.hw_address; - gi->gd_fbsize = bm.depth*bm.bytes_per_row*bm.rows; + gi->gd_fbsize = bm.phys_mappable; gi->gd_regaddr = bm.hw_regs; gi->gd_regsize = bm.reg_size; diff --git a/sys/arch/atari/dev/grfabs_et.c b/sys/arch/atari/dev/grfabs_et.c index 16b2006f26ea..5a1998c3c2a1 100644 --- a/sys/arch/atari/dev/grfabs_et.c +++ b/sys/arch/atari/dev/grfabs_et.c @@ -1,4 +1,4 @@ -/* $NetBSD: grfabs_et.c,v 1.6 1997/01/10 20:59:27 leo Exp $ */ +/* $NetBSD: grfabs_et.c,v 1.7 1997/04/25 19:25:39 leo Exp $ */ /* * Copyright (c) 1996 Leo Weppelman. @@ -68,6 +68,13 @@ #define SAVEBUF_SIZE (32*1024 + sizeof(save_area_t)) +/* + * Allow a 16Kb io-region and a 4MB frame buffer to be mapped. This + * is more or less required by the XFree server. + */ +#define REG_MAPPABLE (16 * 1024) +#define FRAME_MAPPABLE (4 * 1024 * 1024) + /* * Function decls */ @@ -309,7 +316,8 @@ u_char depth; bm->hw_address = (caddr_t)kvtop(et_priv.memkva); bm->regs = et_priv.regkva; bm->hw_regs = (caddr_t)kvtop(et_priv.regkva); - bm->reg_size = et_priv.regsz; + bm->reg_size = REG_MAPPABLE; + bm->phys_mappable = FRAME_MAPPABLE; bm->bytes_per_row = (mode->size.width * depth) / NBBY; bm->rows = mode->size.height; @@ -419,8 +427,8 @@ et_probe_card() */ et_priv.regkva = (volatile caddr_t)pci_io_addr; et_priv.memkva = (volatile caddr_t)pci_mem_addr; - et_priv.memsz = 4 * NBPG; - et_priv.regsz = NBPG; + et_priv.memsz = PCI_MEM_SIZE; + et_priv.regsz = PCI_IO_SIZE; if (found && !atari_realconfig) { et_boardinit(); diff --git a/sys/arch/atari/dev/grfabs_fal.c b/sys/arch/atari/dev/grfabs_fal.c index 61deee508354..fe22305a39f6 100644 --- a/sys/arch/atari/dev/grfabs_fal.c +++ b/sys/arch/atari/dev/grfabs_fal.c @@ -1,4 +1,4 @@ -/* $NetBSD: grfabs_fal.c,v 1.7 1996/10/04 07:27:55 leo Exp $ */ +/* $NetBSD: grfabs_fal.c,v 1.8 1997/04/25 19:25:39 leo Exp $ */ /* * Copyright (c) 1995 Thomas Gerner. @@ -547,6 +547,7 @@ u_char depth; bm->bytes_per_row = (width * depth) / NBBY; bm->rows = height; bm->depth = depth; + bm->phys_mappable = (depth * width * height) / NBBY; bm->regs = bm->hw_regs = NULL; bm->reg_size = 0; diff --git a/sys/arch/atari/dev/grfabs_tt.c b/sys/arch/atari/dev/grfabs_tt.c index 33e7c7a9f22f..83eebacad439 100644 --- a/sys/arch/atari/dev/grfabs_tt.c +++ b/sys/arch/atari/dev/grfabs_tt.c @@ -1,4 +1,4 @@ -/* $NetBSD: grfabs_tt.c,v 1.6 1996/10/04 07:27:56 leo Exp $ */ +/* $NetBSD: grfabs_tt.c,v 1.7 1997/04/25 19:25:40 leo Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -365,6 +365,7 @@ u_char depth; bm->regs = NULL; bm->hw_regs = NULL; bm->reg_size = 0; + bm->phys_mappable = (depth * width * height) / NBBY; bzero(bm->plane, bm_size); return (bm); diff --git a/sys/arch/atari/dev/view.c b/sys/arch/atari/dev/view.c index aa7cdb5cbafc..f6b8a33d51db 100644 --- a/sys/arch/atari/dev/view.c +++ b/sys/arch/atari/dev/view.c @@ -1,4 +1,4 @@ -/* $NetBSD: view.c,v 1.14 1997/01/10 21:00:37 leo Exp $ */ +/* $NetBSD: view.c,v 1.15 1997/04/25 19:25:41 leo Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -411,7 +411,7 @@ int off, prot; vu = &views[minor(dev)]; bm = vu->view->bitmap; bmd_start = bm->hw_address; - bmd_size = bm->bytes_per_row*bm->rows*bm->depth; + bmd_size = bm->phys_mappable; /* * control registers