From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 5/5] drm/i915/vlv: support save/restore of display state around power well toggle
Date: Tue, 15 Oct 2013 13:42:53 -0700 [thread overview]
Message-ID: <20131015134253.0dea6d77@jbarnes-desktop> (raw)
In-Reply-To: <CA+gsUGQ3Jae78ux7PHdPCod_dgb7=iNZgSaNLc0jPe0r73M7iA@mail.gmail.com>
On Tue, 15 Oct 2013 17:09:19 -0300
Paulo Zanoni <przanoni@gmail.com> wrote:
> 2013/10/14 Jesse Barnes <jbarnes@virtuousgeek.org>:
> > If we disable the power well at runtime, we need to save enough display
> > state so we can restore it when the power well comes back again. Add
> > support for that on VLV by reusing some of the _freeze and _thaw code.
> >
> > Note we need to drop the power well lock in this path around the restore,
> > since we'll end up in mode set functions that take more refs on the
> > power well.
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> > drivers/gpu/drm/i915/intel_uncore.c | 21 ++++++++++++++++++++-
> > 1 file changed, 20 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index b126f5a..070ff00 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -406,7 +406,26 @@ static void __vlv_set_power_well(struct drm_i915_private *dev_priv,
> > static void vlv_set_display_power(struct drm_i915_private *dev_priv,
> > bool enable)
> > {
> > - __vlv_set_power_well(dev_priv, DISP2D_PWRGT, enable);
> > + struct drm_device *dev = dev_priv->dev;
> > + struct i915_power_well *power_well = &dev_priv->power_well;
> > +
> > + if (enable) {
> > + /* Lost all the display state, restore it */
> > + if (vlv_display_power_enabled(dev_priv))
> > + return; /* already on, skip the fireworks */
> > + __vlv_set_power_well(dev_priv, DISP2D_PWRGT, true);
> > + spin_unlock_irq(&power_well->lock);
> > + i915_restore_state(dev);
>
> At least on Haswell, i915_restore_state restores a lot more than just
> what was lost on the power well. Do you really need all this? Besides,
> I kinda fear you can break things by restoring stuff that is already
> running. While we're doing this restoring, interrputs are happening,
> everything is running, yet we call stuff like intel_i2c_reset,
> i915_gem_restore_fences and others. Another example: we have code to
> restore the backlight registers, but backlight is usually on the
> output that works even with the power well disabled. So if we disable
> the power well, then change backlight on the only output that is
> working, then reenable the power well we'll "restore" a bogus
> backlight state on a case where we shouldn't be touching backlight at
> all.
Yeah this is definitely a WIP. We'll probably need power well specific
save/restore functions. Depending on which well was toggled, the state
that needs to be saved & restored will be different. It may be best to
try to push all this into modeset_setup_hw_state, since it should know
which power wells are needed for different ops and thus restore the
right state. But that means ripping apart save/restore_state and
putting bits in the right places, potentially with specific hooks like
the uncore save/restore I added for other stuff.
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2013-10-15 20:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 23:07 [RFC] Runtime display PM for VLV/BYT Jesse Barnes
2013-10-14 23:07 ` [PATCH 1/5] drm/i915/vlv: power well support " Jesse Barnes
2013-10-14 23:07 ` [PATCH 2/5] drm/i915: add display power well report out to debugfs Jesse Barnes
2013-10-14 23:07 ` [PATCH 3/5] drm/i915/vlv: suspend/resume fixes for VLV/BYT Jesse Barnes
2013-10-14 23:07 ` [PATCH 4/5] drm/i915: take power well refs when needed Jesse Barnes
2013-10-15 19:54 ` Paulo Zanoni
2013-10-15 20:40 ` Jesse Barnes
2013-10-15 20:47 ` Paulo Zanoni
2013-10-15 20:57 ` Jesse Barnes
2013-10-15 21:03 ` Paulo Zanoni
2013-10-16 11:10 ` Imre Deak
2013-10-16 15:08 ` Jesse Barnes
2013-10-17 13:01 ` Imre Deak
2013-10-14 23:07 ` [PATCH 5/5] drm/i915/vlv: support save/restore of display state around power well toggle Jesse Barnes
2013-10-15 20:09 ` Paulo Zanoni
2013-10-15 20:42 ` Jesse Barnes [this message]
2013-10-16 8:54 ` Daniel Vetter
2013-10-15 8:06 ` [RFC] Runtime display PM for VLV/BYT Ville Syrjälä
2013-10-15 12:16 ` Imre Deak
2013-10-15 16:23 ` Jesse Barnes
2013-10-15 18:15 ` Imre Deak
2013-10-15 22:09 ` Daniel Vetter
2013-10-16 14:45 ` Imre Deak
2013-10-15 9:59 ` Daniel Vetter
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=20131015134253.0dea6d77@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=przanoni@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.