From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [RFC 3/3] drm/i915: Waitboost external waits
Date: Thu, 9 Feb 2023 15:43:15 +0000 [thread overview]
Message-ID: <20230209154315.468682-4-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20230209154315.468682-1-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Userspace waits coming via the drm_syncobj route have so far been
bypassing the waitboost mechanism.
Use the previously added dma-fence wait tracking API and apply the
same waitboosting logic which applies to other entry points.
This should fix the perfomance regressions experience by clvk and
similar userspace which relies on drm_syncobj.
At the same time, but for documentation purposes only, use the new
dma-fence API from i915_request_wait too.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/i915_request.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 7503dcb9043b..e24fac5c1567 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -94,7 +94,12 @@ static bool i915_fence_signaled(struct dma_fence *fence)
static bool i915_fence_enable_signaling(struct dma_fence *fence)
{
- return i915_request_enable_breadcrumb(to_request(fence));
+ struct i915_request *rq = to_request(fence);
+
+ if (dma_fence_wait_count(&rq->fence) && !i915_request_started(rq))
+ intel_rps_boost(rq);
+
+ return i915_request_enable_breadcrumb(rq);
}
static signed long i915_fence_wait(struct dma_fence *fence,
@@ -2037,11 +2042,13 @@ long i915_request_wait_timeout(struct i915_request *rq,
* but at a cost of spending more power processing the workload
* (bad for battery).
*/
- if (flags & I915_WAIT_PRIORITY && !i915_request_started(rq))
+ if (((flags & I915_WAIT_PRIORITY) || dma_fence_wait_count(&rq->fence))
+ && !i915_request_started(rq))
intel_rps_boost(rq);
wait.tsk = current;
- if (dma_fence_add_callback(&rq->fence, &wait.cb, request_wait_wake))
+ if (dma_fence_add_wait_callback(&rq->fence, &wait.cb,
+ request_wait_wake))
goto out;
/*
--
2.34.1
next prev parent reply other threads:[~2023-02-09 15:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 15:43 [Intel-gfx] [RFC 0/3] Waitboost drm syncobj waits Tvrtko Ursulin
2023-02-09 15:43 ` [Intel-gfx] [RFC 1/3] dma-fence: Track explicit waiters Tvrtko Ursulin
2023-02-09 15:43 ` [Intel-gfx] [RFC 2/3] drm/syncobj: Mark syncobj waits as external waiters Tvrtko Ursulin
2023-02-09 15:43 ` Tvrtko Ursulin [this message]
2023-02-09 16:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Waitboost drm syncobj waits Patchwork
2023-02-09 16:39 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230209154315.468682-4-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox