diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-23 17:13:36 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-23 17:13:36 +0000 |
commit | d669d153f2100a81a300aacda2a00ebad1c5727a (patch) | |
tree | be898f81e6032e6ede2d4084e669a9f97da31ccf /sys/dev | |
parent | e7e2ada08961f816affda40d5f9c3b24f9997ea2 (diff) |
Add a barrier before we submit the ringbuffer and before we do anything
that kills gtt mappings.
In both of these case we want all writes to hit the bus before we do
whatever we're about to do.
Doesn't solve any problems that I know of but it may help.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index ea650513445..2ef59c22776 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -787,6 +787,7 @@ inteldrm_advance_ring(struct drm_i915_private *dev_priv) { INTELDRM_VPRINTF("%s: %x, %x\n", __func__, dev_priv->ring.wspace, dev_priv->ring.woffset); + DRM_MEMORYBARRIER(); I915_WRITE(PRB0_TAIL, dev_priv->ring.tail); } @@ -1672,6 +1673,7 @@ i915_gem_object_unbind(struct drm_obj *obj, int interruptible) /* if it's purgeable don't bother dirtying the pages */ if (i915_obj_purgeable(obj_priv)) atomic_clearbits_int(&obj_priv->io_flags, I915_DIRTY); + /* * unload the map, then unwire the backing object. */ @@ -2234,6 +2236,10 @@ inteldrm_wipe_mappings(struct drm_obj *obj) struct drm_i915_private *dev_priv = dev->dev_private; struct vm_page *pg; + /* make sure any writes hit the bus before we do whatever change + * that prompted us to kill the mappings. + */ + DRM_MEMORYBARRIER(); /* nuke all our mappings. XXX optimise. */ for (pg = &dev_priv->pgs[atop(obj_priv->gtt_offset)]; pg != &dev_priv->pgs[atop(obj_priv->gtt_offset + obj->size)]; pg++) |