Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/i915drm Fix i915_genfb_mmap b...
details: https://anonhg.NetBSD.org/src/rev/a67648b3bedc
branches: riastradh-drm2
changeset: 788606:a67648b3bedc
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Jan 21 20:48:52 2014 +0000
description:
Fix i915_genfb_mmap base addresses and offsets.
diffstat:
sys/external/bsd/drm2/i915drm/i915_pci.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diffs (51 lines):
diff -r e154b477ed29 -r a67648b3bedc sys/external/bsd/drm2/i915drm/i915_pci.c
--- a/sys/external/bsd/drm2/i915drm/i915_pci.c Wed Jan 15 21:25:49 2014 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci.c Tue Jan 21 20:48:52 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_pci.c,v 1.1.2.7 2014/01/15 17:42:28 riastradh Exp $ */
+/* $NetBSD: i915_pci.c,v 1.1.2.8 2014/01/21 20:48:52 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.1.2.7 2014/01/15 17:42:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.1.2.8 2014/01/21 20:48:52 riastradh Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -455,7 +455,9 @@
struct genfb_softc *const genfb = v;
struct i915drm_softc *const sc = container_of(genfb,
struct i915drm_softc, sc_genfb);
- const struct pci_attach_args *const pa = &sc->sc_drm_dev.pdev->pd_pa;
+ struct drm_device *const dev = &sc->sc_drm_dev;
+ struct drm_i915_private *const dev_priv = dev->dev_private;
+ const struct pci_attach_args *const pa = &dev->pdev->pd_pa;
unsigned int i;
if (offset < 0)
@@ -463,7 +465,9 @@
/* Treat low memory as the framebuffer itself. */
if (offset < genfb->sc_fbsize)
- return bus_space_mmap(pa->pa_memt, genfb->sc_fboffset, offset,
+ return bus_space_mmap(dev->bst,
+ (dev_priv->mm.gtt_base_addr + sc->sc_fb_obj->gtt_offset),
+ offset,
prot, (BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE));
/* XXX Cargo-culted from genfb_pci. */
@@ -492,8 +496,8 @@
/* Try to map it if it's in range. */
if ((addr <= offset) && (offset < (addr + size)))
- return bus_space_mmap(pa->pa_memt, offset, 0, prot,
- flags);
+ return bus_space_mmap(pa->pa_memt, addr,
+ (offset - addr), prot, flags);
/* Skip a slot if this was a 64-bit BAR. */
if ((PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_MEM) &&
Home |
Main Index |
Thread Index |
Old Index