All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: Grab rpm ref when changing cdclk on VLV/CHV
Date: Mon, 27 Oct 2014 11:28:48 +0200	[thread overview]
Message-ID: <20141027092848.GJ4284@intel.com> (raw)
In-Reply-To: <20141027084827.GG26941@phenom.ffwll.local>

On Mon, Oct 27, 2014 at 09:48:27AM +0100, Daniel Vetter wrote:
> On Tue, Oct 07, 2014 at 05:41:21PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We need to access the gunit mailbox when changing the cdclk frequency.
> > Currently we update the power wells only after chancing cdclk, so the
> > device might be suspended when we have to frob it. Grab a runtime PM
> > reference to make sure it's awake.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Late response because mailman.
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index d83a7f1..149310b 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -4812,10 +4812,12 @@ static void valleyview_modeset_global_resources(struct drm_device *dev)
> >  	int req_cdclk = valleyview_calc_cdclk(dev_priv, max_pixclk);
> >  
> >  	if (req_cdclk != dev_priv->vlv_cdclk_freq) {
> > +		intel_runtime_pm_get(dev_priv);
> >  		if (IS_CHERRYVIEW(dev))
> >  			cherryview_set_cdclk(dev, req_cdclk);
> >  		else
> >  			valleyview_set_cdclk(dev, req_cdclk);
> > +		intel_runtime_pm_put(dev_priv);
> 
> So shouldn't we move the cdclock within modeset_update_crtc_power_domains?
> That one first grabs new domains then drops old ones to make sure we don't
> ever touch the hw in the off state.

Yeah that would be a nicer solution, or maybe split 
modeset_update_crtc_power_domains() into pre and post funcs?

There was also a patch somewhere in the list that frobbed with some
PFI credits or somesuch depending on the cdclk frequency, and I believe
that may require the disp2d power well since the register could live
there. So this rpm ref solution might not be enough in the end.

> 
> Also vlv noob question: Does the cdclock setting survive a runtime suspend
> transition, i.e. when we'd routine suspend right here between the cdclock
> change and grabbing power wells (e.g. when turning everything on).

I would expect it does survive since it's just a register value we write
into punit/cck. But I'm not entirely sure what would happen on VLV if
we choose 400MHz cdclk and then the entire soc enters s0ix. In that case
I could imagine that Punit would reissue the cdclk request to cck on
resume, which would then cause cdclk to come back as 320/333 MHz instead
of the 400MHz we were expecting. That too is just a theory at this
point.

> -Daniel
> 
> >  	}
> >  
> >  	modeset_update_crtc_power_domains(dev);
> > -- 
> > 2.0.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-10-27  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 14:41 [PATCH 1/3] drm/i915: Add missing '\n' to cdclk debug message ville.syrjala
2014-10-07 14:41 ` [PATCH 2/3] drm/i915: Grab rpm ref when changing cdclk on VLV/CHV ville.syrjala
2014-10-27  8:48   ` Daniel Vetter
2014-10-27  9:28     ` Ville Syrjälä [this message]
2014-11-06 12:49   ` [PATCH v2 2/3] drm/i915: Move the .global_resources() hook call into modeset_update_crtc_power_domains() ville.syrjala
2014-11-06 13:10     ` Daniel Vetter
2014-11-10 17:14       ` Jesse Barnes
2014-11-10 17:24         ` Ville Syrjälä
2014-11-10 18:08           ` Jesse Barnes
2014-10-07 14:41 ` [PATCH 3/3] drm/i915: Cache HPLL frequency on VLV/CHV ville.syrjala
2014-11-06 14:02   ` Imre Deak
2014-11-06 14:46     ` 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=20141027092848.GJ4284@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --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 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.