Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3af7b857 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

drm/i915: ensure context objects are bound to the global gtt



This way round we don't introduce and ugly layering violations and use
the interface as I planned to use it.

Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent e0556841
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -358,6 +358,9 @@ static int do_switch(struct drm_i915_gem_object *from_obj,
	if (ret)
	if (ret)
		return 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))
	if (!to->is_initialized || is_default_context(to))
		hw_flags |= MI_RESTORE_INHIBIT;
		hw_flags |= MI_RESTORE_INHIBIT;
	else if (WARN_ON_ONCE(from_obj == to->obj)) /* not yet expected */
	else if (WARN_ON_ONCE(from_obj == to->obj)) /* not yet expected */