]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Use locked access to ctx->engines in set_priority
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 10 Aug 2021 13:05:23 +0000 (15:05 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Aug 2021 15:29:12 +0000 (17:29 +0200)
commit1e5f3e468b194244eaa6a74004ce0ab51ee13f7e
treeea79b1ec693547e0e9fc4fe352c68b117621662a
parent153ecf623bca2dc3da4c33065fe944431fc03f58
drm/i915: Use locked access to ctx->engines in set_priority

This essentially reverts

commit 8df8d4c9b931f54dcd25ee3ede3fa3c8e86b5f6c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Apr 2 13:42:18 2020 +0100

    drm/i915/gem: Utilize rcu iteration of context engines

Note that the other use of __context_engines_await have disappeard in
the following commits:

51c998b7960b ("drm/i915/gem: Don't allow changing the VM on running contexts (v4)")
022e404d5a40 ("drm/i915: Drop getparam support for I915_CONTEXT_PARAM_ENGINES")
de411643c8a1 ("drm/i915: Drop the CONTEXT_CLONE API (v2)")

None of these have any business to optimize their engine lookup with
rcu, unless extremely convincing benchmark data and a solid analysis
why we can't make that workload (whatever it is that does) faster with
a proper design fix.

Also since there's only one caller of context_apply_all left and it's
really just a loop, inline it and then inline the lopp body too. This
is how all other callers that take the engine lock loop over engines,
it's much simpler.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210810130523.1972031-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/gem/i915_gem_context.c