All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
	"Kp, Jeeja" <jeeja.kp@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Zanoni, Paulo R" <paulo.r.zanoni@intel.com>,
	"libin.yang@linux.intel.com" <libin.yang@linux.intel.com>
Subject: Re: [PATCH v2 2/2] drm/i915/dp: BDW cdclk fix for DP audio
Date: Tue, 25 Oct 2016 18:24:50 +0000	[thread overview]
Message-ID: <1477420871.19344.15.camel@dk-H97M-D3H> (raw)
In-Reply-To: <20161025084638.GO4617@intel.com>

On Tue, 2016-10-25 at 11:46 +0300, Ville Syrjälä wrote:
> On Mon, Oct 24, 2016 at 09:18:37PM -0700, Dhinakaran Pandiyan wrote:
> > According to BSpec, cdclk has to be not less than 432 MHz with DP audio
> > enabled, port width x4, and link rate HBR2 (5.4 GHz)
> > 
> > Having a lower cdclk triggers pipe underruns, which then lead to displays
> > continuously cycling off and on. This is essential for DP MST audio as the
> > link is trained at HBR2 and 4 lanes by default.
> > 
> > v2: Restrict fix to BDW
> >     Retain the set cdclk across modesets (Ville)
> > 
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 28 +++++++++++++++++++++++++---
> >  1 file changed, 25 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a94f7d1..8c59651 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -10260,6 +10260,18 @@ static void bxt_modeset_commit_cdclk(struct drm_atomic_state *old_state)
> >  	bxt_set_cdclk(to_i915(dev), req_cdclk);
> >  }
> >  
> > +static unsigned int bdw_dp_audio_cdclk(struct intel_crtc_state *crtc_state)
> > +{
> > +
> 
> Useless blank line.
> 
> > +	if (intel_crtc_has_dp_encoder(crtc_state) &&
> > +	    crtc_state->has_audio &&
> > +	    crtc_state->port_clock >= 540000 &&
> > +	    crtc_state->lane_count == 4)
> > +		return 432000;
> > +
> > +	return 0;
> > +}
> > +
> >  /* compute the max rate for new configuration */
> >  static int ilk_max_pixel_rate(struct drm_atomic_state *state)
> >  {
> > @@ -10275,7 +10287,7 @@ static int ilk_max_pixel_rate(struct drm_atomic_state *state)
> >  	       sizeof(intel_state->min_pixclk));
> >  
> >  	for_each_crtc_in_state(state, crtc, cstate, i) {
> > -		int pixel_rate;
> > +		unsigned int pixel_rate;
> >  
> >  		crtc_state = to_intel_crtc_state(cstate);
> >  		if (!crtc_state->base.enable) {
> > @@ -10285,9 +10297,19 @@ static int ilk_max_pixel_rate(struct drm_atomic_state *state)
> >  
> >  		pixel_rate = ilk_pipe_pixel_rate(crtc_state);
> >  
> > +		if (IS_BROADWELL(dev_priv)) {
> >  		/* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */
> > -		if (IS_BROADWELL(dev_priv) && crtc_state->ips_enabled)
> > -			pixel_rate = DIV_ROUND_UP(pixel_rate * 100, 95);
> > +			if (crtc_state->ips_enabled)
> > +				pixel_rate = DIV_ROUND_UP(pixel_rate * 100, 95);
> > +
> > +		/* BSpec says "Do not use DisplayPort with CDCLK less than
> > +		 * 432 MHz, audio enabled, port width x4, and link rate
> > +		 * HBR2 (5.4 GHz), or else there may be audio corruption or
> > +		 * screen corruption."
> > +		 */
> 
> Indentation of the comments is wrong.
> 
> > +			pixel_rate = max(pixel_rate,
> > +					 bdw_dp_audio_cdclk(crtc_state));
> > +		}
> >  
> >  		intel_state->min_pixclk[i] = pixel_rate;
> 
> Otherwise I suppose this ought to work.
> 
> So with the formatting stuff fixed this is
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The whole min_pixclk vs. pixel_rate vs. cdclk thing is a bit of a mess
> though. So it could use a thorough cleaning to make it less confusing.
> I'm tinking we might just want to start tracking a minimum acceptable
> cdclk per pipe. Probably the main thing would be to pull in the
> 5%/10% guardband handling here for all platforms.
> 

Yeah, definitely needs some work. As you wrote in the previous review,
we can get rid of tracking min_pixclk and track min_cdclk instead. I
could not find any other use for min_pixclk other than computing cdclk.
 
Thanks for the review.

-DK

> >  	}
> > -- 
> > 2.7.4
> 

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

  reply	other threads:[~2016-10-25 18:24 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25  4:18 [PATCH v2 0/2] DP audio fixes Dhinakaran Pandiyan
2016-10-25  4:18 ` [PATCH v2 1/2] drm/i915/dp: Enable DP audio stall fix for gen9 platforms Dhinakaran Pandiyan
2016-10-25  8:47   ` Jani Nikula
2016-10-25 18:28     ` Pandiyan, Dhinakaran
2016-10-25 23:42     ` [PATCH v3 " Dhinakaran Pandiyan
2016-10-26  0:21       ` Pandiyan, Dhinakaran
2016-10-26  2:37         ` [PATCH v4 " Dhinakaran Pandiyan
2016-10-26  8:57           ` Jani Nikula
2016-10-26 18:12             ` Pandiyan, Dhinakaran
2016-10-26 19:06               ` Jani Nikula
2016-10-26 20:40                 ` Pandiyan, Dhinakaran
2016-10-26  9:11           ` Ville Syrjälä
2016-10-26 18:14             ` Pandiyan, Dhinakaran
2016-10-28  3:13               ` Pandiyan, Dhinakaran
2016-10-28  6:43               ` Yang, Libin
2016-11-04 15:48           ` Jani Nikula
2016-11-04 18:38             ` Pandiyan, Dhinakaran
2016-11-05 19:40               ` Jani Nikula
2016-11-06  0:23                 ` Pandiyan, Dhinakaran
2017-01-04  9:11                   ` Peter Frühberger
2017-01-04  9:34                     ` Jani Nikula
     [not found]                       ` <CAFu8+fnphbvw_6kBtbE5F0u3LOPPutyG6GPCtSiXARgOmL8JEA@mail.gmail.com>
2017-01-04 10:42                         ` Peter Frühberger
2017-01-05 23:23                           ` Pandiyan, Dhinakaran
2016-10-26  6:37   ` [PATCH v2 " Daniel Vetter
2016-10-26 18:32     ` Pandiyan, Dhinakaran
2016-10-25  4:18 ` [PATCH v2 2/2] drm/i915/dp: BDW cdclk fix for DP audio Dhinakaran Pandiyan
2016-10-25  8:46   ` Ville Syrjälä
2016-10-25 18:24     ` Pandiyan, Dhinakaran [this message]
2016-10-25  9:10   ` Jani Nikula
2016-10-25  9:14     ` Jani Nikula
2016-10-25 18:19       ` Pandiyan, Dhinakaran
2016-10-25 23:36         ` Pandiyan, Dhinakaran
2016-10-26  6:36         ` Daniel Vetter
2016-10-25 23:41       ` [PATCH v3 " Dhinakaran Pandiyan
2016-10-26  8:54         ` Jani Nikula
2016-10-26  8:54           ` Jani Nikula
2016-10-26 18:21           ` Pandiyan, Dhinakaran
2016-10-26 18:21             ` Pandiyan, Dhinakaran
2016-10-26 19:08             ` Jani Nikula
2016-10-26 19:08               ` Jani Nikula
2016-10-26 20:29               ` [Intel-gfx] " Pandiyan, Dhinakaran
2016-10-26 20:29                 ` Pandiyan, Dhinakaran
2016-10-25  4:47 ` ✗ Fi.CI.BAT: warning for DP audio fixes Patchwork
2016-10-26  0:16 ` ✓ Fi.CI.BAT: success for DP audio fixes (rev4) Patchwork
2016-10-27  9:46 ` ✗ Fi.CI.BAT: warning for DP audio fixes (rev5) Patchwork

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=1477420871.19344.15.camel@dk-H97M-D3H \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jeeja.kp@intel.com \
    --cc=libin.yang@linux.intel.com \
    --cc=paulo.r.zanoni@intel.com \
    --cc=ville.syrjala@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 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.