diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 4a05956162c1..b0f42b9ca037 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c | |||
@@ -421,11 +421,21 @@ static int do_switch(struct i915_hw_context *to) | |||
421 | if (ret) | 421 | if (ret) |
422 | return ret; | 422 | return ret; |
423 | 423 | ||
424 | /* Clear this page out of any CPU caches for coherent swap-in/out. Note | 424 | /* |
425 | * Pin can switch back to the default context if we end up calling into | ||
426 | * evict_everything - as a last ditch gtt defrag effort that also | ||
427 | * switches to the default context. Hence we need to reload from here. | ||
428 | */ | ||
429 | from = ring->last_context; | ||
430 | |||
431 | /* | ||
432 | * Clear this page out of any CPU caches for coherent swap-in/out. Note | ||
425 | * that thanks to write = false in this call and us not setting any gpu | 433 | * that thanks to write = false in this call and us not setting any gpu |
426 | * write domains when putting a context object onto the active list | 434 | * write domains when putting a context object onto the active list |
427 | * (when switching away from it), this won't block. | 435 | * (when switching away from it), this won't block. |
428 | * XXX: We need a real interface to do this instead of trickery. */ | 436 | * |
437 | * XXX: We need a real interface to do this instead of trickery. | ||
438 | */ | ||
429 | ret = i915_gem_object_set_to_gtt_domain(to->obj, false); | 439 | ret = i915_gem_object_set_to_gtt_domain(to->obj, false); |
430 | if (ret) { | 440 | if (ret) { |
431 | i915_gem_object_unpin(to->obj); | 441 | i915_gem_object_unpin(to->obj); |