summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-05-08 16:56:46 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-05-08 16:56:46 +0000
commite5ea2adee1bbaa776b293419490c209de74362c1 (patch)
tree216d58c3506377703865e280d9c09e16eb8908da /sys/dev/pci
parentea4827a4442b75f4140eea87a6dfa524be47c27b (diff)
Set the write combined bit on our newly created pages.
We need a proper MI api for doing this (one which will fall back to mtrrs if PAT is not available would be best), but for now this allows inteldrm to use PAT if available. Big fat XXX mentioning the need for a real api. ok kettenis@, tedu@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/i915_drv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 53f6cce666e..b2469523d1e 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -469,6 +469,13 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux)
/* array of vm pages that physload introduced. */
dev_priv->pgs = PHYS_TO_VM_PAGE(dev->agp->base);
KASSERT(dev_priv->pgs != NULL);
+ /*
+ * XXX mark all pages write combining so user mmaps get the right
+ * bits. We really need a proper MI api for doing this, but for now
+ * this allows us to use PAT where available.
+ */
+ for (i = 0; i < atop(dev->agp->info.ai_aperture_size); i++)
+ atomic_setbits_int(&(dev_priv->pgs[i].pg_flags), PG_PMAP_WC);
if (bus_space_map(dev_priv->bst, dev->agp->base,
dev->agp->info.ai_aperture_size, BUS_SPACE_MAP_LINEAR |
BUS_SPACE_MAP_PREFETCHABLE, &dev_priv->aperture_bsh) != 0)