From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: "Race-to-idle" on switching to the kernel context
Date: Mon, 21 Aug 2017 12:48:03 +0300 [thread overview]
Message-ID: <87efs5qmjw.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <150330791938.7354.1959604230609522623@mail.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Chris Wilson (2017-08-21 10:28:16)
>> Quoting Mika Kuoppala (2017-08-21 10:17:52)
>> > Chris Wilson <chris@chris-wilson.co.uk> writes:
>> >
>> > > During suspend we want to flush out all active contexts and their
>> > > rendering. To do so we queue a request from the kernel's context, once
>> > > we know that request is done, we know the GPU is completely idle. To
>> > > speed up that switch bump the GPU clocks.
>> > >
>> > > Switching to the kernel context prior to idling is also used to enforce
>> > > a barrier before changing OA properties, and when evicting active
>> > > rendering from the global GTT. All cases where we do want to
>> > > race-to-idle.
>> > >
>> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > > Cc: David Weinehall <david.weinehall@linux.intel.com>
>> > > ---
>> > > drivers/gpu/drm/i915/i915_gem_context.c | 11 ++++++++---
>> > > 1 file changed, 8 insertions(+), 3 deletions(-)
>> > >
>> > > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
>> > > index 58a2a44f88bd..ca1423ad2708 100644
>> > > --- a/drivers/gpu/drm/i915/i915_gem_context.c
>> > > +++ b/drivers/gpu/drm/i915/i915_gem_context.c
>> > > @@ -895,6 +895,7 @@ int i915_gem_switch_to_kernel_context(struct drm_i915_private *dev_priv)
>> > >
>> > > for_each_engine(engine, dev_priv, id) {
>> > > struct drm_i915_gem_request *req;
>> > > + bool active = false;
>> > > int ret;
>> > >
>> > > if (engine_has_kernel_context(engine))
>> > > @@ -913,13 +914,17 @@ int i915_gem_switch_to_kernel_context(struct drm_i915_private *dev_priv)
>> > > prev = i915_gem_active_raw(&tl->last_request,
>> > > &dev_priv->drm.struct_mutex);
>> > > if (prev)
>> > > - i915_sw_fence_await_sw_fence_gfp(&req->submit,
>> > > - &prev->submit,
>> > > - GFP_KERNEL);
>> > > + active |= i915_sw_fence_await_sw_fence_gfp(&req->submit,
>> > > + &prev->submit,
>> > > + GFP_KERNEL) > 0;
>> >
>> > There is no point of kicking the clocks if we are the only request left?
>> >
>> > Well logical as the request is empty, just pondering if the actual ctx
>> > save/restore would finish quicker.
>>
>> I was thinking if it was just the context save itself, it not would be
>> enough of a difference to justify itself. Just gut feeling and not
>> measured, I worry about the irony of boosting from idle just to idle.
>
> Hmm, or we could be more precise and just set the clocks high rather
> than queue a task. The complication isn't worth it for just a single
> callsite, but I am contemplating supplying boost/clocks information
> along with the request.
For the purposes of suspend, I think the approach is simple and
good enough.
Can David give a Tested-by?
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-21 9:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 14:08 [PATCH] drm/i915: "Race-to-idle" on switching to the kernel context Chris Wilson
2017-08-18 14:32 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-21 9:17 ` [PATCH] " Mika Kuoppala
2017-08-21 9:28 ` Chris Wilson
2017-08-21 9:31 ` Chris Wilson
2017-08-21 9:48 ` Mika Kuoppala [this message]
2017-08-23 14:26 ` David Weinehall
2017-08-23 14:54 ` David Weinehall
2017-08-23 15:03 ` Chris Wilson
2017-08-25 10:46 ` David Weinehall
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=87efs5qmjw.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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