]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i915: don't map imported dma-bufs for dmar.
authorDave Airlie <airlied@redhat.com>
Tue, 31 Jul 2012 05:58:13 +0000 (15:58 +1000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 5 Aug 2012 20:53:59 +0000 (22:53 +0200)
The exporter should have given us pages in the correct place, avoid
the prepare object mapping phase on dmar systems.

This fixes an oops on a GM45/R600 machine, when running the intel/radeon
tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_gtt.c

index 9fd25a435536121a33651c66ac00f5999c81f6f4..ee9b68f6bc36c938213931065c50bb5d60836b23 100644 (file)
@@ -361,7 +361,8 @@ int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
        struct drm_device *dev = obj->base.dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
 
-       if (dev_priv->mm.gtt->needs_dmar)
+       /* don't map imported dma buf objects */
+       if (dev_priv->mm.gtt->needs_dmar && !obj->sg_table)
                return intel_gtt_map_memory(obj->pages,
                                            obj->base.size >> PAGE_SHIFT,
                                            &obj->sg_list,