summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2021-06-11 22:01:49 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2024-01-08 14:01:49 +0100
commitce1bfa04eb36f1fd645b9599f3350ca61538a8f0 (patch)
tree473c19f90436b203c98b0bb2efb238d4fabbb0de
parent4ecd7c697206a152f2e9a9f900f299b18cfbc705 (diff)
drm/i915/eb: Drop unmotivated cond_resched
This was added in commit 2889caa9232109afc8881f29a2205abeb5709d0c Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Jun 16 15:05:19 2017 +0100 drm/i915: Eliminate lots of iterations over the execobjects array without any motivation. I suspect it was added to handle EAGAIN errors from userptr, but it's hard to guess with no breadcrumbs anywhere. Before this change there wasn't any dedicated EAGAIN handling, we just bounced completely to userspace. Userptr works differently now and does not just thrash the cpu until another worker has maybe acquired the pages, so we can go back to handling EAGAIN like beforehand. That also allows us to drop another funky repeat loop from a function with already very complicated control flow (which unforunately got more complex due to ww_mutex restarting). Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Jon Bloomfield <jon.bloomfield@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 9f8c32c93d82..dc2daf780ffd 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1795,7 +1795,7 @@ repeat:
i915_gem_ww_ctx_fini(&eb->ww);
/*
- * We take 3 passes through the slowpatch.
+ * We take 2 passes through the slowpatch.
*
* 1 - we try to just prefault all the user relocation entries and
* then attempt to reuse the atomic pagefault disabled fast path again.
@@ -1803,18 +1803,12 @@ repeat:
* 2 - we copy the user entries to a local buffer here outside of the
* local and allow ourselves to wait upon any rendering before
* relocations
- *
- * 3 - we already have a local copy of the relocation entries, but
- * were interrupted (EAGAIN) whilst waiting for the objects, try again.
*/
if (!err) {
err = eb_prefault_relocations(eb);
} else if (!have_copy) {
err = eb_copy_relocations(eb);
have_copy = err == 0;
- } else {
- cond_resched();
- err = 0;
}
if (!err)
@@ -1877,9 +1871,6 @@ err:
goto repeat_validate;
}
- if (err == -EAGAIN)
- goto repeat;
-
out:
if (have_copy) {
const unsigned int count = eb->buffer_count;