Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci only try to map the framebuffer if we don't alre...
details: https://anonhg.NetBSD.org/src/rev/3aad201d8dae
branches: trunk
changeset: 763006:3aad201d8dae
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Mar 08 03:22:29 2011 +0000
description:
only try to map the framebuffer if we don't already have an address
With this radeondrm works with genfb and r6xx.
diffstat:
sys/dev/pci/genfb_pci.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diffs (49 lines):
diff -r b8917e91d14a -r 3aad201d8dae sys/dev/pci/genfb_pci.c
--- a/sys/dev/pci/genfb_pci.c Tue Mar 08 03:16:30 2011 +0000
+++ b/sys/dev/pci/genfb_pci.c Tue Mar 08 03:22:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_pci.c,v 1.31 2011/02/13 11:00:58 phx Exp $ */
+/* $NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.31 2011/02/13 11:00:58 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -131,14 +131,22 @@
return;
}
- if (bus_space_map(sc->sc_memt, sc->sc_gen.sc_fboffset,
- sc->sc_gen.sc_fbsize,
- BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE,
- &sc->sc_memh) != 0) {
- aprint_error_dev(self, "unable to map the framebuffer\n");
- return;
- }
- sc->sc_gen.sc_fbaddr = bus_space_vaddr(sc->sc_memt, sc->sc_memh);
+ /*
+ * if some MD code handed us a framebuffer VA we use that instead of
+ * mapping our own
+ */
+ if (sc->sc_gen.sc_fbaddr == NULL) {
+ if (bus_space_map(sc->sc_memt, sc->sc_gen.sc_fboffset,
+ sc->sc_gen.sc_fbsize,
+ BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE,
+ &sc->sc_memh) != 0) {
+ aprint_error_dev(self, "unable to map the framebuffer\n");
+ return;
+ }
+ sc->sc_gen.sc_fbaddr = bus_space_vaddr(sc->sc_memt, sc->sc_memh);
+ } else
+ aprint_debug("%s: recycling existing fb mapping at %lx\n",
+ device_xname(sc->sc_gen.sc_dev), (unsigned long)sc->sc_gen.sc_fbaddr);
/* mmap()able bus ranges */
idx = 0;
Home |
Main Index |
Thread Index |
Old Index