All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH 1/5] drm/i915/vlv: Move czclk to intel_pm
Date: Mon, 4 Mar 2019 19:02:29 +0200	[thread overview]
Message-ID: <20190304170229.GC20097@intel.com> (raw)
In-Reply-To: <20190304165715.GB20097@intel.com>

On Mon, Mar 04, 2019 at 06:57:15PM +0200, Ville Syrjälä wrote:
> On Fri, Mar 01, 2019 at 04:49:31PM -0800, José Roberto de Souza wrote:
> > Moving VLV/CHV/BYT czclk to intel_pm as it is a core clock used as
> > base by several other GPU blocks including GT.
> > 
> > BSpec: 14370
> > 
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 12 ------------
> >  drivers/gpu/drm/i915/intel_pm.c      | 10 ++++++++++
> >  2 files changed, 10 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 7c5e84ef5171..91a8ee611b12 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -180,17 +180,6 @@ int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
> >  				 dev_priv->hpll_freq);
> >  }
> >  
> > -static void intel_update_czclk(struct drm_i915_private *dev_priv)
> > -{
> > -	if (!(IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)))
> > -		return;
> > -
> > -	dev_priv->czclk_freq = vlv_get_cck_clock_hpll(dev_priv, "czclk",
> > -						      CCK_CZ_CLOCK_CONTROL);
> > -
> > -	DRM_DEBUG_DRIVER("CZ clock rate: %d kHz\n", dev_priv->czclk_freq);
> > -}
> > -
> >  static inline u32 /* units of 100MHz */
> >  intel_fdi_link_freq(struct drm_i915_private *dev_priv,
> >  		    const struct intel_crtc_state *pipe_config)
> > @@ -15533,7 +15522,6 @@ int intel_modeset_init(struct drm_device *dev)
> >  	intel_shared_dpll_init(dev);
> >  	intel_update_fdi_pll_freq(dev_priv);
> >  
> > -	intel_update_czclk(dev_priv);
> >  	intel_modeset_init_hw(dev);
> 
> Is is here because intel_modeset_init_hw() needs it.

No, actually it doesn't. Dang, I'm starting to forget the details. It
is needed by modeset code when it comes time to actually reprogam
cdclk.

> 
> >  
> >  	intel_hdcp_component_init(dev_priv);
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 9c97a95c1816..cd363fa47cbc 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -7622,6 +7622,14 @@ static void vlv_init_gpll_ref_freq(struct drm_i915_private *dev_priv)
> >  			 dev_priv->gt_pm.rps.gpll_ref_freq);
> >  }
> >  
> > +static void vlv_update_czclk(struct drm_i915_private *dev_priv)
> > +{
> > +	dev_priv->czclk_freq = vlv_get_cck_clock_hpll(dev_priv, "czclk",
> > +						      CCK_CZ_CLOCK_CONTROL);
> > +
> > +	DRM_DEBUG_DRIVER("CZ clock rate: %d kHz\n", dev_priv->czclk_freq);
> > +}
> > +
> >  static void valleyview_init_gt_powersave(struct drm_i915_private *dev_priv)
> >  {
> >  	struct intel_rps *rps = &dev_priv->gt_pm.rps;
> > @@ -7629,6 +7637,7 @@ static void valleyview_init_gt_powersave(struct drm_i915_private *dev_priv)
> >  
> >  	valleyview_setup_pctx(dev_priv);
> >  
> > +	vlv_update_czclk(dev_priv);
> 
> This is far too late AFAICS. Also putting it into gt/gem specific code
> is equally wrong as having it in the modeset code.

So this last argument still holds. We should put it into some common
code. Maybe we need some kind of clock_init() thing.

> 
> >  	vlv_init_gpll_ref_freq(dev_priv);
> >  
> >  	val = vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS);
> > @@ -7675,6 +7684,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
> >  
> >  	cherryview_setup_pctx(dev_priv);
> >  
> > +	vlv_update_czclk(dev_priv);
> >  	vlv_init_gpll_ref_freq(dev_priv);
> >  
> >  	mutex_lock(&dev_priv->sb_lock);
> > -- 
> > 2.21.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel

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

      reply	other threads:[~2019-03-04 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  0:49 [PATCH 1/5] drm/i915/vlv: Move czclk to intel_pm José Roberto de Souza
2019-03-02  0:49 ` [PATCH 2/5] drm/i915: Rename i915_load_modeset_init() to i915_modeset_load() José Roberto de Souza
2019-03-04 11:00   ` Jani Nikula
2019-03-04 16:06     ` Lucas De Marchi
2019-03-02  0:49 ` [PATCH 3/5] drm/i915: Add a cleanup function for i915_modeset_load() José Roberto de Souza
2019-03-02  0:49 ` [PATCH 4/5] drm/i915: Move rawclck, power_domain and irq un/initialization from modeset functions José Roberto de Souza
2019-03-04 17:34   ` Ville Syrjälä
2019-03-05 11:42     ` Jani Nikula
2019-03-02  0:49 ` [PATCH 5/5] drm/i915: Extract gem_init() from modeset_load() José Roberto de Souza
2019-03-02  2:37 ` ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915/vlv: Move czclk to intel_pm Patchwork
2019-03-02 11:28 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-03-04 16:57 ` [PATCH 1/5] " Ville Syrjälä
2019-03-04 17:02   ` Ville Syrjälä [this message]

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=20190304170229.GC20097@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jose.souza@intel.com \
    --cc=lucas.demarchi@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 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.