Change hf_baseaddr usage. Now it potins frame buffer start address instead

of hf_baseadd + hf_offset. You should use hf_baseaddr only in kernel and
you should use hf_offset only with mmap system call from userland.
This commit is contained in:
takemura 2000-12-03 13:43:40 +00:00
parent 3bcc9b9f3a
commit 1021bf4bf1
7 changed files with 29 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bivideo.c,v 1.12 2000/10/01 03:45:33 takemura Exp $ */
/* $NetBSD: bivideo.c,v 1.13 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 1999
@ -37,7 +37,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$Id: bivideo.c,v 1.12 2000/10/01 03:45:33 takemura Exp $";
"$Id: bivideo.c,v 1.13 2000/12/03 13:43:40 takemura Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@ -204,8 +204,9 @@ bivideo_init(fb)
/* configuration name */
fb->hf_height = bootinfo->fb_height;
fb->hf_width = bootinfo->fb_width;
fb->hf_baseaddr = mips_ptob(mips_btop(bootinfo->fb_addr));
fb->hf_offset = (u_long)bootinfo->fb_addr - fb->hf_baseaddr;
fb->hf_baseaddr = (u_long)bootinfo->fb_addr;
fb->hf_offset = (u_long)bootinfo->fb_addr -
mips_ptob(mips_btop(bootinfo->fb_addr));
/* frame buffer start offset */
fb->hf_bytes_per_line = bootinfo->fb_line_bytes;
fb->hf_nplanes = 1;
@ -468,5 +469,5 @@ bivideo_mmap(ctx, offset, prot)
sc->sc_fbconf.hf_offset) < offset)
return -1;
return mips_btop(sc->sc_fbconf.hf_baseaddr + offset);
return mips_btop((u_long)bootinfo->fb_addr + offset);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcfb.c,v 1.18 2000/11/26 06:21:16 sato Exp $ */
/* $NetBSD: hpcfb.c,v 1.19 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 1999
@ -46,7 +46,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$Id: hpcfb.c,v 1.18 2000/11/26 06:21:16 sato Exp $";
"$Id: hpcfb.c,v 1.19 2000/12/03 13:43:40 takemura Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@ -478,7 +478,7 @@ hpcfb_init(fbconf, dc)
struct rasops_info *ri;
vaddr_t fbaddr;
fbaddr = (vaddr_t)fbconf->hf_baseaddr + fbconf->hf_offset;
fbaddr = (vaddr_t)fbconf->hf_baseaddr;
/* init rasops */
ri = &dc->dc_rinfo;
@ -540,7 +540,7 @@ hpcfb_cmap_reorder(fbconf, dc)
struct rasops_info *ri = &dc->dc_rinfo;
int reverse = fbconf->hf_access_flags & HPCFB_ACCESS_REVERSE;
int *cmap = ri->ri_devcmap;
vaddr_t fbaddr = (vaddr_t)fbconf->hf_baseaddr + fbconf->hf_offset;
vaddr_t fbaddr = (vaddr_t)fbconf->hf_baseaddr;
int i, j, bg, fg, tmp;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcfbio.h,v 1.1 2000/03/12 05:04:46 takemura Exp $ */
/* $NetBSD: hpcfbio.h,v 1.2 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 1999
@ -99,7 +99,7 @@ struct hpcfb_fbconf {
short hf_width; /* how many pixels in a line */
u_long hf_baseaddr; /* frame buffer start address */
u_long hf_offset; /* frame buffer start offset */
u_long hf_offset; /* frame buffer start offset for mmap*/
short hf_bytes_per_line; /**/
short hf_nplanes; /**/
long hf_bytes_per_plane; /**/
@ -110,7 +110,7 @@ struct hpcfb_fbconf {
u_long hf_access_flags; /* HPCFB_ACCESS_* */
u_long hf_swap_flags; /* HPCFB_SWAP_* */
u_long hf_accel_flags; /* this value is 0 */
u_long hf_reg_offset; /* hardware register offset for mmap */
u_long hf_reserved[3];
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite8181.c,v 1.3 2000/10/27 08:09:15 sato Exp $ */
/* $NetBSD: ite8181.c,v 1.4 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 2000 SATO Kazumi
@ -479,8 +479,9 @@ ite8181_fbinit(fb)
/* configuration name */
fb->hf_height = bootinfo->fb_height;
fb->hf_width = bootinfo->fb_width;
fb->hf_baseaddr = mips_ptob(mips_btop(bootinfo->fb_addr));
fb->hf_offset = (u_long)bootinfo->fb_addr - fb->hf_baseaddr;
fb->hf_baseaddr = (u_long)bootinfo->fb_addr;
fb->hf_offset = (u_long)bootinfo->fb_addr -
mips_ptob(mips_btop(bootinfo->fb_addr));
/* frame buffer start offset */
fb->hf_bytes_per_line = bootinfo->fb_line_bytes;
fb->hf_nplanes = 1;
@ -672,5 +673,5 @@ ite8181_mmap(ctx, offset, prot)
sc->sc_fbconf.hf_offset) < offset)
return -1;
return mips_btop(sc->sc_fbconf.hf_baseaddr + offset);
return mips_btop((u_long)bootinfo->fb_addr + offset);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mq200.c,v 1.3 2000/11/26 08:33:43 takemura Exp $ */
/* $NetBSD: mq200.c,v 1.4 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 2000 Takemura Shin
@ -135,9 +135,9 @@ mq200_attach(sc)
sc->sc_dev.dv_xname);
mq200_fbinit(&sc->sc_fbconf);
sc->sc_fbconf.hf_baseaddr = MIPS_PHYS_TO_KSEG1(mips_ptob(mips_btop(sc->sc_baseaddr)));
sc->sc_fbconf.hf_offset = (u_long)bootinfo->fb_addr -
sc->sc_fbconf.hf_baseaddr;
sc->sc_fbconf.hf_baseaddr = (u_long)bootinfo->fb_addr;
sc->sc_fbconf.hf_offset = (u_long)sc->sc_baseaddr -
MIPS_PHYS_TO_KSEG1(mips_ptob(mips_btop(sc->sc_baseaddr)));
DPRINTF(("hf_baseaddr=%lx\n", sc->sc_fbconf.hf_baseaddr));
DPRINTF(("hf_offset=%lx\n", sc->sc_fbconf.hf_offset));

View File

@ -1,4 +1,4 @@
/* $NetBSD: plumvideo.c,v 1.15 2000/10/22 10:33:01 uch Exp $ */
/* $NetBSD: plumvideo.c,v 1.16 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -239,8 +239,8 @@ plumvideo_hpcfbinit(struct plumvideo_softc *sc, int reverse_flag)
/* configuration name */
fb->hf_height = height;
fb->hf_width = width;
fb->hf_baseaddr = mips_ptob(mips_btop(fbvaddr));
fb->hf_offset = (u_long)fbvaddr - fb->hf_baseaddr;
fb->hf_baseaddr = (u_long)fbvaddr;
fb->hf_offset = (u_long)fbvaddr - mips_ptob(mips_btop(fbvaddr));
/* frame buffer start offset */
fb->hf_bytes_per_line = (width * depth) / NBBY;
fb->hf_nplanes = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tx3912video.c,v 1.20 2000/10/22 12:49:27 uch Exp $ */
/* $NetBSD: tx3912video.c,v 1.21 2000/12/03 13:43:40 takemura Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -249,8 +249,9 @@ tx3912video_hpcfbinit(sc)
/* configuration name */
fb->hf_height = chip->vc_fbheight;
fb->hf_width = chip->vc_fbwidth;
fb->hf_baseaddr = mips_ptob(mips_btop(fbvaddr));
fb->hf_offset = (u_long)fbvaddr - fb->hf_baseaddr;
fb->hf_baseaddr = (u_long)fbvaddr;
fb->hf_offset = (u_long)fbvaddr -
mips_ptob(mips_btop(fbvaddr));
/* frame buffer start offset */
fb->hf_bytes_per_line = (chip->vc_fbwidth * chip->vc_fbdepth)
/ NBBY;