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

Commit d0e30adc authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter
Browse files

drm/i915: Mark PIN_USER binding as GLOBAL_BIND without the aliasing ppgtt



If the device does not support the aliasing ppgtt, we must translate
user bind requests (PIN_USER) from LOCAL_BIND to a GLOBAL_BIND. However,
since this is device specific we cannot do this conveniently in the
upper layers and so must manage the vma->bound flags in the backend.

Partial revert of commit 75d04a37 [4.2-rc1]
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Tue Apr 28 17:56:17 2015 +0300

    drm/i915/gtt: Allocate va range only if vma is not bound

Note this was spotted by Daniel originally, but we dropped the ball in
getting the fix in before the bug going wild. Sorry all.

Reported-by: default avatarVincent Legoll <vincent.legoll@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91133
References: https://bugs.freedesktop.org/show_bug.cgi?id=90224


Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ee0a227b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1923,6 +1923,17 @@ static int ggtt_bind_vma(struct i915_vma *vma,
		vma->vm->insert_entries(vma->vm, pages,
					vma->node.start,
					cache_level, pte_flags);

		/* Note the inconsistency here is due to absence of the
		 * aliasing ppgtt on gen4 and earlier. Though we always
		 * request PIN_USER for execbuffer (translated to LOCAL_BIND),
		 * without the appgtt, we cannot honour that request and so
		 * must substitute it with a global binding. Since we do this
		 * behind the upper layers back, we need to explicitly set
		 * the bound flag ourselves.
		 */
		vma->bound |= GLOBAL_BIND;

	}

	if (dev_priv->mm.aliasing_ppgtt && flags & LOCAL_BIND) {