Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci we don't access video memory directly, no need t...
details: https://anonhg.NetBSD.org/src/rev/f8be9c79a1ac
branches: trunk
changeset: 772843:f8be9c79a1ac
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Jan 17 21:31:46 2012 +0000
description:
we don't access video memory directly, no need to map it
diffstat:
sys/dev/pci/voodoofb.c | 34 +++++++---------------------------
1 files changed, 7 insertions(+), 27 deletions(-)
diffs (99 lines):
diff -r d77a3df41484 -r f8be9c79a1ac sys/dev/pci/voodoofb.c
--- a/sys/dev/pci/voodoofb.c Tue Jan 17 20:50:38 2012 +0000
+++ b/sys/dev/pci/voodoofb.c Tue Jan 17 21:31:46 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: voodoofb.c,v 1.31 2012/01/17 19:13:22 macallan Exp $ */
+/* $NetBSD: voodoofb.c,v 1.32 2012/01/17 21:31:46 macallan Exp $ */
/*
* Copyright (c) 2005, 2006 Michael Lorenz
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.31 2012/01/17 19:13:22 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.32 2012/01/17 21:31:46 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -75,10 +75,8 @@
bus_space_handle_t sc_memh;
bus_space_tag_t sc_regt;
- bus_space_tag_t sc_fbt;
bus_space_tag_t sc_ioregt;
bus_space_handle_t sc_regh;
- bus_space_handle_t sc_fbh;
bus_space_handle_t sc_ioregh;
bus_addr_t sc_regs, sc_fb, sc_ioreg;
bus_size_t sc_regsize, sc_fbsize, sc_ioregsize;
@@ -342,7 +340,7 @@
ulong defattr;
int console, width, height, i, j;
prop_dictionary_t dict;
- int linebytes, depth;
+ int linebytes, depth, flags;
uint32_t bg, fg, ul;
sc->sc_dev = self;
@@ -359,10 +357,8 @@
sc->sc_pa = *pa;
/* the framebuffer */
- if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM,
- BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_PREFETCHABLE |
- BUS_SPACE_MAP_LINEAR,
- &sc->sc_fbt, &sc->sc_fbh, &sc->sc_fb, &sc->sc_fbsize)) {
+ if (pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, 0x14, PCI_MAPREG_TYPE_MEM,
+ &sc->sc_fb, &sc->sc_fbsize, &flags)) {
aprint_error_dev(self, "failed to map the frame buffer.\n");
}
@@ -508,7 +504,6 @@
bus_space_unmap(sc->sc_ioregt, sc->sc_ioregh, sc->sc_ioregsize);
bus_space_unmap(sc->sc_regt, sc->sc_regh, sc->sc_regsize);
- bus_space_unmap(sc->sc_fbt, sc->sc_fbh, sc->sc_fbsize);
return 0;
}
@@ -516,12 +511,6 @@
static int
voodoofb_drm_map(struct voodoofb_softc *sc)
{
- if (pci_mapreg_map(&sc->sc_pa, 0x14, PCI_MAPREG_TYPE_MEM,
- BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_PREFETCHABLE |
- BUS_SPACE_MAP_LINEAR,
- &sc->sc_fbt, &sc->sc_fbh, &sc->sc_fb, &sc->sc_fbsize)) {
- aprint_error_dev(sc->sc_dev, "failed to map the frame buffer.\n");
- }
/* memory-mapped registers */
if (pci_mapreg_map(&sc->sc_pa, 0x10, PCI_MAPREG_TYPE_MEM, 0,
@@ -1005,7 +994,7 @@
/* 'regular' framebuffer mmap()ing */
if (offset < sc->sc_fbsize) {
- pa = bus_space_mmap(sc->sc_fbt, offset, 0, prot,
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
BUS_SPACE_MAP_LINEAR);
return pa;
}
@@ -1064,16 +1053,7 @@
ri->ri_width = sc->width;
ri->ri_height = sc->height;
ri->ri_stride = sc->width;
- ri->ri_flg = RI_CENTER | RI_FULLCLEAR;
-
- ri->ri_bits = bus_space_vaddr(sc->sc_fbt, sc->sc_fbh);
-
-#ifdef VOODOOFB_DEBUG
- printf("addr: %08lx\n", (ulong)ri->ri_bits);
-#endif
- if (existing) {
- ri->ri_flg |= RI_CLEAR;
- }
+ ri->ri_flg = RI_CENTER;
rasops_init(ri, 0, 0);
ri->ri_caps = WSSCREEN_WSCOLORS;
Home |
Main Index |
Thread Index |
Old Index