summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_context.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-18 15:23:37 (GMT)
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-18 15:23:37 (GMT)
commit3d7f0f9dcca6b40dd347bbf3508c642002e0a561 (patch)
tree928513cb455ce852c52e1d33688901f87f3267af /drivers/gpu/drm/i915/i915_gem_context.c
parent4fe9adbc36097317864bfec3c32047da7c45a2fa (diff)
parent6c719faca2aceca72f1bf5b1645c1734ed3e9447 (diff)
downloadlinux-3d7f0f9dcca6b40dd347bbf3508c642002e0a561.tar.xz
Merge commit drm-intel-fixes into topic/ppgtt
I need the tricky do_switch fix before I can merge the final piece of the ppgtt enabling puzzle. Otherwise the conflict will be a real pain to resolve since the do_switch hunk from -fixes must be placed at the exact right place within a hunk in the next patch. Conflicts: drivers/gpu/drm/i915/i915_gem_context.c drivers/gpu/drm/i915/i915_gem_execbuffer.c drivers/gpu/drm/i915/intel_display.c Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index d3a17ef..165a5c7 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -520,11 +520,9 @@ void i915_gem_context_close(struct drm_device *dev, struct drm_file *file)
return;
}
- mutex_lock(&dev->struct_mutex);
idr_for_each(&file_priv->context_idr, context_idr_cleanup, NULL);
i915_gem_context_unreference(file_priv->private_default_ctx);
idr_destroy(&file_priv->context_idr);
- mutex_unlock(&dev->struct_mutex);
}
struct i915_hw_context *
@@ -611,11 +609,21 @@ static int do_switch(struct intel_ring_buffer *ring,
if (ret)
return ret;
- /* Clear this page out of any CPU caches for coherent swap-in/out. Note
+ /*
+ * Pin can switch back to the default context if we end up calling into
+ * evict_everything - as a last ditch gtt defrag effort that also
+ * switches to the default context. Hence we need to reload from here.
+ */
+ from = ring->last_context;
+
+ /*
+ * Clear this page out of any CPU caches for coherent swap-in/out. Note
* that thanks to write = false in this call and us not setting any gpu
* write domains when putting a context object onto the active list
* (when switching away from it), this won't block.
- * XXX: We need a real interface to do this instead of trickery. */
+ *
+ * XXX: We need a real interface to do this instead of trickery.
+ */
ret = i915_gem_object_set_to_gtt_domain(to->obj, false);
if (ret) {
i915_gem_object_ggtt_unpin(to->obj);