]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Mark up i915_vma_unbind() as a potential sleeper
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 9 Nov 2017 21:34:50 +0000 (21:34 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 9 Nov 2017 22:06:09 +0000 (22:06 +0000)
Whenever we want to unbind a vma, we must wait on all GPU activity to
complete first. (This is what gives us the ability to do fine grained
eviction and purging by only having to wait on the VMA that we need to
unbind to proceed; though if pushed we can make it a rule that we are
only allowed to unbind already idle VMA and move the burden of the work
and organising the sleep onto the caller.) Currently, we might only
sleep if the vma is still active on the GPU, but in principle
i915_vma_unbind() always implies a sleep, so mark it up with a
might_sleep().

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103638
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171109213450.13875-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_vma.c

index b7ac84db1d2e6e3a1bc034dec4cd16f0ab18b8c0..bf6d8d1eaabeb97467218436e71905db8a7e0d0d 100644 (file)
@@ -743,6 +743,7 @@ int i915_vma_unbind(struct i915_vma *vma)
        /* First wait upon any activity as retiring the request may
         * have side-effects such as unpinning or even unbinding this vma.
         */
+       might_sleep();
        active = i915_vma_get_active(vma);
        if (active) {
                int idx;