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

Commit e5cdb22b authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Move assertion for iomap access to i915_vma_pin_iomap



Access through the GTT requires the device to be awake. Ideally
i915_vma_pin_iomap() is short-lived and the pinning demarcates the
access through the iomap. This is not entirely true, we have a mixture
of long lived pins that exceed the wakelock (such as legacy ringbuffers)
and short lived pin that do live within the wakelock (such as execlist
ringbuffers).

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471254551-25805-17-git-send-email-chris@chris-wilson.co.uk
parent 7abc98fa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3650,6 +3650,9 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
{
	void __iomem *ptr;

	/* Access through the GTT requires the device to be awake. */
	assert_rpm_wakelock_held(to_i915(vma->vm->dev));

	lockdep_assert_held(&vma->vm->dev->struct_mutex);
	if (WARN_ON(!vma->obj->map_and_fenceable))
		return IO_ERR_PTR(-ENODEV);
+0 −3
Original line number Diff line number Diff line
@@ -1966,9 +1966,6 @@ int intel_ring_pin(struct intel_ring *ring)
		if (ret)
			goto err_unpin;

		/* Access through the GTT requires the device to be awake. */
		assert_rpm_wakelock_held(dev_priv);

		addr = (void __force *)
			i915_vma_pin_iomap(i915_gem_obj_to_ggtt(obj));
		if (IS_ERR(addr)) {