drm/i915: ensure context objects are bound to the global gtt
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 13 Jun 2012 22:08:32 +0000 (00:08 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 14 Jun 2012 15:36:17 +0000 (17:36 +0200)
This way round we don't introduce and ugly layering violations and use
the interface as I planned to use it.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_context.c

index 5248c00707f664d0d8f4bdf2a86d399eafa33d4e..fb6aa5e10991d5e1d78d3dc891751622081c0554 100644 (file)
@@ -358,6 +358,9 @@ static int do_switch(struct drm_i915_gem_object *from_obj,
        if (ret)
                return ret;
 
+       if (!to->obj->has_global_gtt_mapping)
+               i915_gem_gtt_bind_object(to->obj, to->obj->cache_level);
+
        if (!to->is_initialized || is_default_context(to))
                hw_flags |= MI_RESTORE_INHIBIT;
        else if (WARN_ON_ONCE(from_obj == to->obj)) /* not yet expected */