aboutsummaryrefslogtreecommitdiffstats
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-23 15:08:33 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-12-23 17:33:42 +0000
commit44963bf9d4c28815b6bcfb03061e37831ab1ce42 (patch)
tree820b28a6427a68c20a237be2fa015b37f8b3a974 /drivers/gpu/drm/i915/gt/intel_gt_requests.c
parentdrm/i915/display: Add comment to a function that probably can be removed (diff)
downloadlinux-dev-44963bf9d4c28815b6bcfb03061e37831ab1ce42.tar.xz
linux-dev-44963bf9d4c28815b6bcfb03061e37831ab1ce42.zip
drm/i915/gt: Tidy up checking active timelines during retirement
Use the status of the timeline request list as we retire it to determine if the timeline is still active. 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/20191223150833.2329366-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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_requests.c b/drivers/gpu/drm/i915/gt/intel_gt_requests.c
index b4f04614230e..9e75fa1b6bc1 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_requests.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_requests.c
@@ -14,13 +14,16 @@
#include "intel_gt_requests.h"
#include "intel_timeline.h"
-static void retire_requests(struct intel_timeline *tl)
+static bool retire_requests(struct intel_timeline *tl)
{
struct i915_request *rq, *rn;
list_for_each_entry_safe(rq, rn, &tl->requests, link)
if (!i915_request_retire(rq))
- break;
+ return false;
+
+ /* And check nothing new was submitted */
+ return !i915_active_fence_isset(&tl->last_request);
}
static bool flush_submission(struct intel_gt *gt)
@@ -29,6 +32,9 @@ static bool flush_submission(struct intel_gt *gt)
enum intel_engine_id id;
bool active = false;
+ if (!intel_gt_pm_is_awake(gt))
+ return false;
+
for_each_engine(engine, gt, id) {
active |= intel_engine_flush_submission(engine);
active |= flush_work(&engine->retire_work);
@@ -145,7 +151,7 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
}
}
- retire_requests(tl);
+ active_count += !retire_requests(tl);
spin_lock(&timelines->lock);
@@ -153,8 +159,6 @@ long intel_gt_retire_requests_timeout(struct intel_gt *gt, long timeout)
list_safe_reset_next(tl, tn, link);
if (atomic_dec_and_test(&tl->active_count))
list_del(&tl->link);
- else
- active_count += i915_active_fence_isset(&tl->last_request);
mutex_unlock(&tl->mutex);