public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: Ander Conselvan de Oliveira
	<ander.conselvan.de.oliveira@intel.com>,
	intel-gfx@lists.freedesktop.org, shuang.he@linux.intel.com
Subject: Re: [PATCH 5/8] drm/i915: Don't access to crtc->new_config from intel_mode_max_pixclk()
Date: Mon, 15 Dec 2014 21:30:44 +0200	[thread overview]
Message-ID: <20141215193044.GI10649@intel.com> (raw)
In-Reply-To: <20141215191745.GE31948@intel.com>

On Mon, Dec 15, 2014 at 11:17:45AM -0800, Matt Roper wrote:
> On Thu, Dec 11, 2014 at 02:38:08PM +0200, Ander Conselvan de Oliveira wrote:
> > So that we can get rid of the new_config pointer later.
> > 
> > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 30 ++++++++++++++++++++++--------
> >  1 file changed, 22 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index da5af23..a9f3034 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -4897,27 +4897,39 @@ static int valleyview_calc_cdclk(struct drm_i915_private *dev_priv,
> >  }
> >  
> >  /* compute the max pixel clock for new configuration */
> > -static int intel_mode_max_pixclk(struct drm_i915_private *dev_priv)
> > +static int intel_mode_max_pixclk(struct drm_i915_private *dev_priv,
> > +				 struct intel_crtc *mode_set_crtc,
> 
> I'm not sure if you need to pass this.  drm_crtc_state has a backpointer
> to the corresponding drm_crtc now, so if we ensure that's set by our
> driver when creating a new pipe_config, we could probably get away with
> just passing the state here.
> 
> > +				 struct intel_crtc_state *crtc_new_state)
> >  {
> >  	struct drm_device *dev = dev_priv->dev;
> >  	struct intel_crtc *intel_crtc;
> >  	int max_pixclk = 0;
> > +	int pixclk;
> >  
> >  	for_each_intel_crtc(dev, intel_crtc) {
> > -		if (intel_crtc->new_enabled)
> > -			max_pixclk = max(max_pixclk,
> > -					 intel_crtc->new_config->base.adjusted_mode.crtc_clock);
> > +		if (!intel_crtc->new_enabled)
> > +			continue;
> 
> Not really related to this patch specifically, but I'm a little fuzzy on
> the distinction between drm_crtc->enabled and drm_crtc_state->enable
> (and then by extension intel_crtc->new_enabled).  It's not immediately
> clear to me why we can't just have a single 'enabled' in the base state
> structure and then when we have a new config that we're passing around,
> the enabled flag in that structure would serve the purpose that
> intel_crtc->new_enabled does for i915 today.  I'm probably
> misunderstanding something.

Yeah that sounds like where we want to go. No more random bits of
state sprinkled all over the place, and instead have it all neatly
collected in the state struct.

> 
> 
> Matt
> 
> > +
> > +		if (intel_crtc == mode_set_crtc)
> > +			pixclk = crtc_new_state->base.adjusted_mode.crtc_clock;
> > +		else
> > +			pixclk = intel_crtc->config->base.adjusted_mode.crtc_clock;
> > +
> > +		max_pixclk = max(max_pixclk, pixclk);
> >  	}
> >  
> >  	return max_pixclk;
> >  }
> >  
> >  static void valleyview_modeset_global_pipes(struct drm_device *dev,
> > -					    unsigned *prepare_pipes)
> > +					    unsigned *prepare_pipes,
> > +					    struct intel_crtc *mode_set_crtc,
> > +					    struct intel_crtc_state *crtc_new_state)
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  	struct intel_crtc *intel_crtc;
> > -	int max_pixclk = intel_mode_max_pixclk(dev_priv);
> > +	int max_pixclk =
> > +		intel_mode_max_pixclk(dev_priv, mode_set_crtc, crtc_new_state);
> >  
> >  	if (valleyview_calc_cdclk(dev_priv, max_pixclk) ==
> >  	    dev_priv->vlv_cdclk_freq)
> > @@ -4932,7 +4944,7 @@ static void valleyview_modeset_global_pipes(struct drm_device *dev,
> >  static void valleyview_modeset_global_resources(struct drm_device *dev)
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > -	int max_pixclk = intel_mode_max_pixclk(dev_priv);
> > +	int max_pixclk = intel_mode_max_pixclk(dev_priv, NULL, NULL);
> >  	int req_cdclk = valleyview_calc_cdclk(dev_priv, max_pixclk);
> >  
> >  	if (req_cdclk != dev_priv->vlv_cdclk_freq) {
> > @@ -10956,7 +10968,9 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> >  	 * adjusted_mode bits in the crtc directly.
> >  	 */
> >  	if (IS_VALLEYVIEW(dev)) {
> > -		valleyview_modeset_global_pipes(dev, &prepare_pipes);
> > +		valleyview_modeset_global_pipes(dev, &prepare_pipes,
> > +						to_intel_crtc(crtc),
> > +						pipe_config);
> >  
> >  		/* may have added more to prepare_pipes than we should */
> >  		prepare_pipes &= ~disable_pipes;
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> IoTG Platform Enabling & Development
> Intel Corporation
> (916) 356-2795
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
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-12-15 19:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 12:38 [PATCH 0/8] Resend of drm/i915: Keep drm_crtc->state in sync Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 1/8] drm/i915: Rename struct intel_crtc_config to intel_crtc_state Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 2/8] drm/i915: Embedded struct drm_crtc_state in intel_crtc_state Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 3/8] drm/i915: Pass new_config down do crtc_compute_clock Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 4/8] drm/i915: Use local pipe_config varariable when available Ander Conselvan de Oliveira
2014-12-15 18:37   ` Matt Roper
2014-12-15 19:21     ` Ville Syrjälä
2014-12-16  9:25       ` Daniel Vetter
2014-12-11 12:38 ` [PATCH 5/8] drm/i915: Don't access to crtc->new_config from intel_mode_max_pixclk() Ander Conselvan de Oliveira
2014-12-15 19:17   ` Matt Roper
2014-12-15 19:30     ` Ville Syrjälä [this message]
2014-12-16  9:29       ` Daniel Vetter
2014-12-15 19:24   ` Ville Syrjälä
2014-12-16  9:34     ` Daniel Vetter
2014-12-18 15:06       ` Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 6/8] drm/i915: Remove intel_crtc->new_config pointer Ander Conselvan de Oliveira
2014-12-11 12:38 ` [PATCH 7/8] drm/i915: Make intel_crtc->config a pointer Ander Conselvan de Oliveira
2014-12-15 19:30   ` Matt Roper
2014-12-11 12:38 ` [PATCH 8/8] drm/i915: Keep drm_crtc->state in sync with intel_crtc->config Ander Conselvan de Oliveira
2014-12-11 12:49   ` shuang.he

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=20141215193044.GI10649@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ander.conselvan.de.oliveira@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=shuang.he@linux.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