All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Reject modeset if the dotclock is too	high
Date: Fri, 27 May 2016 14:54:29 +0300	[thread overview]
Message-ID: <20160527115429.GB4329@intel.com> (raw)
In-Reply-To: <878tyyd048.fsf@intel.com>

On Wed, May 25, 2016 at 11:15:35AM +0300, Jani Nikula wrote:
> On Tue, 24 May 2016, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Reject the modeset if the requested dotclock exceeds the maximum allowed
> > by the hardware. So far we've only checked this on gen2/3 while also
> > handling the double wide vs. single wide pipe selection. Extend the
> > check to all platforms since we have the max dotclock correctly
> > populated now across the board.
> >
> > Testcase: igt/kms_invalid_dotclock
> > Cc: Mika Kahola <mika.kahola@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Seems good. Maybe we have bugs open about this?

I hope all of those got sorted by the SKL cdclk programming patches. But
I should go through the list anyways...

> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 1e5138497e6a..adb489508f25 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -6510,10 +6510,10 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
> >  	struct drm_device *dev = crtc->base.dev;
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  	const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
> > +	int clock_limit = dev_priv->max_dotclk_freq;
> >  
> > -	/* FIXME should check pixel clock limits on all platforms */
> >  	if (INTEL_INFO(dev)->gen < 4) {
> > -		int clock_limit = dev_priv->max_cdclk_freq * 9 / 10;
> > +		clock_limit = dev_priv->max_cdclk_freq * 9 / 10;
> >  
> >  		/*
> >  		 * Enable double wide mode when the dot clock
> > @@ -6521,16 +6521,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
> >  		 */
> >  		if (intel_crtc_supports_double_wide(crtc) &&
> >  		    adjusted_mode->crtc_clock > clock_limit) {
> > -			clock_limit *= 2;
> > +			clock_limit = dev_priv->max_dotclk_freq;
> >  			pipe_config->double_wide = true;
> >  		}
> > +	}
> >  
> > -		if (adjusted_mode->crtc_clock > clock_limit) {
> > -			DRM_DEBUG_KMS("requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n",
> > -				      adjusted_mode->crtc_clock, clock_limit,
> > -				      yesno(pipe_config->double_wide));
> > -			return -EINVAL;
> > -		}
> > +	if (adjusted_mode->crtc_clock > clock_limit) {
> > +		DRM_DEBUG_KMS("requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n",
> > +			      adjusted_mode->crtc_clock, clock_limit,
> > +			      yesno(pipe_config->double_wide));
> > +		return -EINVAL;
> >  	}
> >  
> >  	/*
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

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

  reply	other threads:[~2016-05-27 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 18:34 [PATCH] drm/i915: Reject modeset if the dotclock is too high ville.syrjala
2016-05-24 18:34 ` [PATCH i-g-t] tests: Add kms_invalid_dotclock ville.syrjala
2016-05-25  5:22 ` ✗ Ro.CI.BAT: warning for drm/i915: Reject modeset if the dotclock is too high Patchwork
2016-05-27 11:53   ` Ville Syrjälä
2016-05-25  8:15 ` [PATCH] " Jani Nikula
2016-05-27 11:54   ` Ville Syrjälä [this message]
2016-05-27 12:35   ` Ville Syrjälä

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=20160527115429.GB4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.