diff --git a/sys/arch/hpcmips/dev/bivideo.c b/sys/arch/hpcmips/dev/bivideo.c index 9c7256e6a33f..f28c7f99726e 100644 --- a/sys/arch/hpcmips/dev/bivideo.c +++ b/sys/arch/hpcmips/dev/bivideo.c @@ -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 #include @@ -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); } diff --git a/sys/arch/hpcmips/dev/hpcfb.c b/sys/arch/hpcmips/dev/hpcfb.c index 6dd6cbdd2ce1..d579ac91d660 100644 --- a/sys/arch/hpcmips/dev/hpcfb.c +++ b/sys/arch/hpcmips/dev/hpcfb.c @@ -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 #include @@ -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; /* diff --git a/sys/arch/hpcmips/dev/hpcfbio.h b/sys/arch/hpcmips/dev/hpcfbio.h index e681a4750040..0f8c722b02fc 100644 --- a/sys/arch/hpcmips/dev/hpcfbio.h +++ b/sys/arch/hpcmips/dev/hpcfbio.h @@ -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]; /* diff --git a/sys/arch/hpcmips/dev/ite8181.c b/sys/arch/hpcmips/dev/ite8181.c index e89d8965e9d0..a664190deda8 100644 --- a/sys/arch/hpcmips/dev/ite8181.c +++ b/sys/arch/hpcmips/dev/ite8181.c @@ -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); } diff --git a/sys/arch/hpcmips/dev/mq200.c b/sys/arch/hpcmips/dev/mq200.c index 9ee2904e9022..bdcfce1db8e6 100644 --- a/sys/arch/hpcmips/dev/mq200.c +++ b/sys/arch/hpcmips/dev/mq200.c @@ -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)); diff --git a/sys/arch/hpcmips/dev/plumvideo.c b/sys/arch/hpcmips/dev/plumvideo.c index 7783b4e24da3..249845e48511 100644 --- a/sys/arch/hpcmips/dev/plumvideo.c +++ b/sys/arch/hpcmips/dev/plumvideo.c @@ -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; diff --git a/sys/arch/hpcmips/tx/tx3912video.c b/sys/arch/hpcmips/tx/tx3912video.c index 32f3373e5bda..8bee51e8148d 100644 --- a/sys/arch/hpcmips/tx/tx3912video.c +++ b/sys/arch/hpcmips/tx/tx3912video.c @@ -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;