aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 18eee8d2522d..65639ad72808 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -374,6 +374,17 @@ static int do_switch(struct drm_i915_gem_object *from_obj,
374 if (ret) 374 if (ret)
375 return ret; 375 return ret;
376 376
377 /* Clear this page out of any CPU caches for coherent swap-in/out. Note
378 * that thanks to write = false in this call and us not setting any gpu
379 * write domains when putting a context object onto the active list
380 * (when switching away from it), this won't block.
381 * XXX: We need a real interface to do this instead of trickery. */
382 ret = i915_gem_object_set_to_gtt_domain(to->obj, false);
383 if (ret) {
384 i915_gem_object_unpin(to->obj);
385 return ret;
386 }
387
377 if (!to->obj->has_global_gtt_mapping) 388 if (!to->obj->has_global_gtt_mapping)
378 i915_gem_gtt_bind_object(to->obj, to->obj->cache_level); 389 i915_gem_gtt_bind_object(to->obj, to->obj->cache_level);
379 390