From: Mika Kahola <mika.kahola@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915: Check pixel clock when setting mode for DSI
Date: Mon, 27 Jul 2015 14:47:20 +0300 [thread overview]
Message-ID: <1437997640.11408.1.camel@sorvi> (raw)
In-Reply-To: <20150703123837.GK14231@nuc-i3427.alporthouse.com>
On Fri, 2015-07-03 at 13:38 +0100, Chris Wilson wrote:
> On Fri, Jul 03, 2015 at 02:35:54PM +0300, Mika Kahola wrote:
> > It is possible the we request to have a mode that has
> > higher pixel clock than our HW can support. This patch
> > checks if requested pixel clock is lower than the one
> > supported by the HW. The requested mode is discarded
> > if we cannot support the requested pixel clock.
> >
> > This patch applies to DSI.
> >
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_dsi.c | 24 ++++++++++++++++++++++++
> > 1 file changed, 24 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> > index 98998e9..1cf35b8 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -635,15 +635,39 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,
> > pipe_config->port_clock = pclk;
> > }
> >
> > +static int
> > +intel_dsi_max_pixclk(struct intel_dsi *intel_dsi)
> > +{
> > + struct drm_device *dev = intel_dsi->base.base.dev;
> > + struct drm_i915_private *dev_priv = to_i915(dev);
> > + struct intel_crtc *intel_crtc = to_intel_crtc(intel_dsi->base.base.crtc);
> > +
> > + if (IS_CHERRYVIEW(dev))
> > + return DIV_ROUND_UP(dev_priv->max_cdclk_freq * 100, 95);
> > + else if (IS_VALLEYVIEW(dev))
> > + return DIV_ROUND_UP(dev_priv->max_cdclk_freq * 100, 90);
> > + else if (IS_BROADWELL(dev) && intel_crtc->config->ips_enabled)
> > + return DIV_ROUND_UP(dev_priv->max_cdclk_freq * 100, 95);
> > + else
> > + return dev_priv->max_cdclk_freq;
> > +}
> > +
> > static enum drm_mode_status
> > intel_dsi_mode_valid(struct drm_connector *connector,
> > struct drm_display_mode *mode)
> > {
> > struct intel_connector *intel_connector = to_intel_connector(connector);
> > struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
> > + struct intel_encoder *intel_encoder = intel_connector->encoder;
> > + struct drm_encoder *encoder = &intel_encoder->base;
> > + struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
> > + int max_pixclk = intel_dsi_max_pixclk(intel_dsi);
> >
> > DRM_DEBUG_KMS("\n");
> >
> > + if (mode->clock > max_pixclk)
> > + return MODE_PANEL;
>
> return MODE_CLOCK_HIGH;
> -Chris
>
Thanks Chris! I'll change this one.
Cheers,
Mika
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-07-27 11:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 11:35 [PATCH 0/9] drm/i915: Check pixel clock when setting mode Mika Kahola
2015-07-03 11:35 ` [PATCH 1/9] drm/i915: Check pixel clock when setting mode for DP Mika Kahola
2015-07-03 12:57 ` Ville Syrjälä
2015-07-06 6:45 ` Sivakumar Thulasimani
2015-07-06 9:23 ` Ville Syrjälä
2015-07-28 7:36 ` Mika Kahola
2015-07-03 11:35 ` [PATCH 2/9] drm/i915: Check pixel clock when setting mode for HDMI Mika Kahola
2015-07-03 11:35 ` [PATCH 3/9] drm/i915: Check pixel clock when setting mode for LVDS Mika Kahola
2015-07-03 12:35 ` Chris Wilson
2015-07-03 11:35 ` [PATCH 4/9] drm/i915: Check pixel clock when setting mode for DVO Mika Kahola
2015-07-03 11:35 ` [PATCH 5/9] drm/i915: Check pixel clock when setting mode for SDVO Mika Kahola
2015-07-03 11:35 ` [PATCH 6/9] drm/i915: Check pixel clock when setting mode for DSI Mika Kahola
2015-07-03 12:38 ` Chris Wilson
2015-07-27 11:47 ` Mika Kahola [this message]
2015-07-03 11:35 ` [PATCH 7/9] drm/i915: Check pixel clock when setting mode for CRT Mika Kahola
2015-07-03 11:35 ` [PATCH 8/9] drm/i915: Check pixel clock when setting mode for TV Mika Kahola
2015-07-03 11:35 ` [PATCH 9/9] drm/i915: Check pixel clock when setting mode for DP-MST Mika Kahola
2015-07-04 23:24 ` shuang.he
2015-07-03 12:49 ` [PATCH 0/9] drm/i915: Check pixel clock when setting mode Chris Wilson
2015-07-06 15:21 ` Daniel Vetter
2015-07-06 15:28 ` Ville Syrjälä
2015-07-06 18:00 ` Daniel Vetter
2015-07-06 15:35 ` Chris Wilson
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=1437997640.11408.1.camel@sorvi \
--to=mika.kahola@intel.com \
--cc=chris@chris-wilson.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox