Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips Change hf_baseaddr usage. Now it potins fra...
details: https://anonhg.NetBSD.org/src/rev/90780ab95081
branches: trunk
changeset: 500011:90780ab95081
user: takemura <takemura%NetBSD.org@localhost>
date: Sun Dec 03 13:43:40 2000 +0000
description:
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.
diffstat:
sys/arch/hpcmips/dev/bivideo.c | 11 ++++++-----
sys/arch/hpcmips/dev/hpcfb.c | 8 ++++----
sys/arch/hpcmips/dev/hpcfbio.h | 6 +++---
sys/arch/hpcmips/dev/ite8181.c | 9 +++++----
sys/arch/hpcmips/dev/mq200.c | 8 ++++----
sys/arch/hpcmips/dev/plumvideo.c | 6 +++---
sys/arch/hpcmips/tx/tx3912video.c | 7 ++++---
7 files changed, 29 insertions(+), 26 deletions(-)
diffs (191 lines):
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/bivideo.c
--- a/sys/arch/hpcmips/dev/bivideo.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/bivideo.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
/* 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 @@
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);
}
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/hpcfb.c
--- a/sys/arch/hpcmips/dev/hpcfb.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/hpcfb.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
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 @@
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;
/*
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/hpcfbio.h
--- a/sys/arch/hpcmips/dev/hpcfbio.h Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/hpcfbio.h Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
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 @@
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];
/*
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/ite8181.c
--- a/sys/arch/hpcmips/dev/ite8181.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/ite8181.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
/* 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 @@
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);
}
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/mq200.c
--- a/sys/arch/hpcmips/dev/mq200.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/mq200.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
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));
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/dev/plumvideo.c
--- a/sys/arch/hpcmips/dev/plumvideo.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/dev/plumvideo.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
/* 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;
diff -r 9a8107e60617 -r 90780ab95081 sys/arch/hpcmips/tx/tx3912video.c
--- a/sys/arch/hpcmips/tx/tx3912video.c Sun Dec 03 13:34:37 2000 +0000
+++ b/sys/arch/hpcmips/tx/tx3912video.c Sun Dec 03 13:43:40 2000 +0000
@@ -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 @@
/* 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;
Home |
Main Index |
Thread Index |
Old Index