aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/i915/gt/intel_gt_requests.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-12-21 16:03:24 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-12-21 16:37:10 +0000
commite6ba76480299a0d77c51d846f7467b1673aad25b (patch)
tree24bad1dcbefe236853b13988bf63341ddd5e12e3 /drivers/gpu/drm/i915/gt/intel_gt_requests.c
parentdrm/i915/selftests: Setup engine->retire for mock_engine (diff)
downloadwireguard-linux-e6ba76480299a0d77c51d846f7467b1673aad25b.tar.xz
wireguard-linux-e6ba76480299a0d77c51d846f7467b1673aad25b.zip
drm/i915: Remove i915->kernel_context
Allocate only an internal intel_context for the kernel_context, forgoing a global GEM context for internal use as we only require a separate address space (for our own protection). Now having weaned GT from requiring ce->gem_context, we can stop referencing it entirely. This also means we no longer have to create random and unnecessary GEM contexts for internal use. GEM contexts are now entirely for tracking GEM clients, and intel_context the execution environment on the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Andi Shyti <andi.shyti@intel.com> Acked-by: Andi Shyti <andi.shyti@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191221160324.1073045-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_gt_requests.c')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_gt_requests.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_requests.c b/drivers/gpu/drm/i915/gt/intel_gt_requests.c
index 0d1bca787288..063f863ee21c 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_requests.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_requests.c
@@ -8,6 +8,7 @@
#include "i915_drv.h" /* for_each_engine() */
#include "i915_request.h"
+#include "intel_engine_heartbeat.h"
#include "intel_gt.h"
#include "intel_gt_pm.h"
#include "intel_gt_requests.h"
@@ -27,8 +28,10 @@ static void flush_submission(struct intel_gt *gt)
struct intel_engine_cs *engine;
enum intel_engine_id id;
- for_each_engine(engine, gt, id)
+ for_each_engine(engine, gt, id) {
intel_engine_flush_submission(engine);
+ flush_work(&engine->retire_work);
+ }
}
static void engine_retire(struct work_struct *work)
@@ -117,10 +120,9 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
spin_lock(&timelines->lock);
list_for_each_entry_safe(tl, tn, &timelines->active_list, link) {
- if (!mutex_trylock(&tl->mutex)) {
- active_count++; /* report busy to caller, try again? */
+ active_count++; /* report busy to caller, try again? */
+ if (!mutex_trylock(&tl->mutex))
continue;
- }
intel_timeline_get(tl);
GEM_BUG_ON(!atomic_read(&tl->active_count));
@@ -145,10 +147,10 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
/* Resume iteration after dropping lock */
list_safe_reset_next(tl, tn, link);
- if (atomic_dec_and_test(&tl->active_count))
+ if (atomic_dec_and_test(&tl->active_count)) {
list_del(&tl->link);
- else
- active_count += !!rcu_access_pointer(tl->last_request.fence);
+ active_count--;
+ }
mutex_unlock(&tl->mutex);
@@ -163,6 +165,8 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
list_for_each_entry_safe(tl, tn, &free, link)
__intel_timeline_free(&tl->kref);
+ flush_submission(gt);
+
return active_count ? timeout : 0;
}