From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"luto@kernel.org" <luto@kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Improve PSR activation timing
Date: Fri, 9 Feb 2018 00:39:33 +0000 [thread overview]
Message-ID: <1518138158.2572.17.camel@dk-H97M-D3H> (raw)
In-Reply-To: <20180208224822.evqmbd3rsxdok432@intel.com>
On Thu, 2018-02-08 at 14:48 -0800, Rodrigo Vivi wrote:
> Hi Andy,
>
> thanks for getting involved with PSR and sorry for not replying sooner.
>
> I first saw this patch on that bugzilla entry but only now I stop to
> really think why I have written the code that way.
>
> So some clarity below.
>
> On Mon, Feb 05, 2018 at 10:07:09PM +0000, Andy Lutomirski wrote:
> > The current PSR code has a two call sites that each schedule delayed
> > work to activate PSR. As far as I can tell, each call site intends
> > to keep PSR inactive for the given amount of time and then allow it
> > to be activated.
> >
> > The call sites are:
> >
> > - intel_psr_enable(), which explicitly states in a comment that
> > it's trying to keep PSR off a short time after the dispay is
> > initialized as a workaround.
>
> First of all I really want to kill this call here and remove the
> FIXME. It was an ugly hack that I added to solve a corner case
> that was leaving me with blank screens when activating so sooner.
>
> >
> > - intel_psr_flush(). There isn't an explcit explanation, but the
> > intent is presumably to keep PSR off until the display has been
> > idle for 100ms.
>
> The reason for 100 is kind of ugly-nonsense-empirical value
> I concluded from VLV/CHV experience.
> On platforms with HW tracking HW waits few identical frames
> until really activating PSR. VLV/CHV activation is immediate.
> But HW is also different and there it seemed that hw needed a
> few more time before starting the transitions.
> Furthermore I didn't want to add that so quickly because I didn't
> want to take the risk of killing battery with software tracking
> when doing transitions so quickly using software tracking.
>
> >
> > The current code doesn't actually accomplish either of these goals.
> > Rather than keeping PSR inactive for the given amount of time, it
> > will schedule PSR for activation after the given time, with the
> > earliest target time in such a request winning.
>
> Putting that way I was asking myself how that hack had ever fixed
> my issue. Because the way you explained here seems obvious that it
> wouldn't ever fix my bug or any other.
>
> So I applied your patch and it made even more sense (without considering
> the fact I want to kill the first call anyways).
>
> So I came back, removed your patch and tried to understand how did
> it ever worked.
>
> So, the thing is that intel_psr_flush will never be really executed
> if intel_psr_enable wasn't executed. That is guaranteed by:
>
> mutex_lock(&dev_priv->psr.lock);
> if (!dev_priv->psr.enabled) {
>
> So, intel_psr_enable will be for sure the first one to schedule the
> work delayed to the ugly higher delay.
>
> >
> > In other words, if intel_psr_enable() is immediately followed by
> > intel_psr_flush(), then PSR will be activated after 100ms even if
> > intel_psr_enable() wanted a longer delay. And, if the screen is
> > being constantly updated so that intel_psr_flush() is called once
> > per frame at 60Hz, PSR will still be activated once every 100ms.
>
> During this time you are right, many calls of intel_psr_exit
> coming from flush functions can be called... But none of
> them will schedule the work with 100 delay.
>
> they will skip on
> if (!work_busy(&dev_priv->psr.work.work))
Wouldn't work_busy() return false until the work is actually queued
which is 100ms after calling schedule_delayed_work()?
For e.g, flushes at 0, 16, 32...96 will have work_busy() returning false
until 100ms.
The first psr_work will end up getting scheduled at 100ms, which I
believe is not what we want.
However, I think
if (dev_priv->psr.busy_frontbuffer_bits)
goto unlock;
intel_psr_activate(intel_dp);
in psr_work might prevent activate being called at 100ms if an
invalidate happened to be called before that.
>
> So, the higher delayed *hack* will be respected and PSR won't get
> activated before that.
>
> On the other hand you might ask what if,
> for some strange reason,
> (intel_dp->panel_power_cycle_delay * 5) is lesser than 100.
> Well, on this case this would be ok, because it happens only
> once and only on gen > 9 where hw tracking will wait the minimal
> number of frames before the actual transition to PSR.
>
> In either cases I believe we are safe.
>
> Thanks,
> Rodrigo.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-02-09 0:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 22:07 [PATCH] drm/i915: Improve PSR activation timing Andy Lutomirski
2018-02-08 22:48 ` Rodrigo Vivi
2018-02-09 0:39 ` Pandiyan, Dhinakaran [this message]
2018-02-09 1:01 ` Andy Lutomirski
2018-02-09 1:21 ` Pandiyan, Dhinakaran
2018-02-09 2:07 ` Rodrigo Vivi
[not found] <draft-87r2pu530q.fsf@rdvivi-vienna.i-did-not-set--mail-host-address--so-tickle-me>
2018-02-09 7:39 ` Rodrigo Vivi
2018-02-09 17:55 ` Andy Lutomirski
2018-02-10 9:43 ` Chris Wilson
2018-02-12 17:30 ` [Intel-gfx] " Rodrigo Vivi
2018-02-13 23:15 ` Rodrigo Vivi
2018-02-09 23:29 ` Pandiyan, Dhinakaran
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=1518138158.2572.17.camel@dk-H97M-D3H \
--to=dhinakaran.pandiyan@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luto@kernel.org \
--cc=rodrigo.vivi@intel.com \
/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