From: Mika Kahola <mika.kahola@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 01/11] drm/i915: Store max dotclock
Date: Thu, 30 Jul 2015 13:27:14 +0300 [thread overview]
Message-ID: <1438252034.23191.10.camel@sorvi> (raw)
In-Reply-To: <20150730070003.GF6035@nuc-i3427.alporthouse.com>
On Thu, 2015-07-30 at 08:00 +0100, Chris Wilson wrote:
> On Thu, Jul 30, 2015 at 09:49:28AM +0300, Mika Kahola wrote:
> > Store max dotclock into dev_priv structure so we are able
> > to filter out the modes that are not supported by our
> > platforms.
> >
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++++++
> > 2 files changed, 21 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 04aa34a..1f69211b 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1777,6 +1777,7 @@ struct drm_i915_private {
> > unsigned int fsb_freq, mem_freq, is_ddr3;
> > unsigned int skl_boot_cdclk;
> > unsigned int cdclk_freq, max_cdclk_freq;
> > + unsigned int max_dotclk;
> > unsigned int hpll_freq;
> >
> > /**
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 43b0f17..9031261 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -5259,6 +5259,24 @@ static void modeset_update_crtc_power_domains(struct drm_atomic_state *state)
> > modeset_put_power_domains(dev_priv, put_domains[i]);
> > }
> >
> > +static int intel_update_max_dotclk(struct drm_device *dev)
>
> You don't update max dotclck, you are computing it. The caller is the
> one storing it dev_priv->max_dotclk (and so is the one actually doing
> the update).
>
True. I'll fix the poor naming of that routine.
> > +{
> > + struct drm_i915_private *dev_priv = dev->dev_private;
>
> So why did you pass in dev if we never use it?
>
> > + int max_cdclk_freq = dev_priv->max_cdclk_freq;
> > + int max_dotclk_freq;
> > +
> > + if (IS_BROADWELL(dev) || IS_CHERRYVIEW(dev))
>
> We already have dev_priv, so please stop doing dev->dev_priv over and
> over again.
>
Yeah, that's pretty much unnecessary, so removing this one for the next
series of patches.
> > + max_dotclk_freq = DIV_ROUND_UP(max_cdclk_freq * 100, 95);
> > + else if (IS_VALLEYVIEW(dev))
> > + max_dotclk_freq = DIV_ROUND_UP(max_cdclk_freq * 100, 90);
> > + else if (IS_GEN2(dev) || IS_GEN3(dev))
>
> If you reverse this pair and do
>
> else if (INTEL_INFO(dev)->gen > 3)
> max_dotclk_freq = max_cdclk_freq;
> else
> max_dotclk_freq = DIV_ROUND_UP(2 * max_cdclk_freq * 100, 90);
>
> Then the chain is mostly ordered in most-recent to oldest, always
> helpful for the next person.
>
I'll apply this change as well on the next patch series.
> Is this correct for gen9+?
This is something I need to double check. My current understanding is
that we should be able to support dot clock up to cd clock frequency
from HSW+ onwards. Actually, I did missed the Ville's comment to limit
dot clock to 90% for older platforms so I need to add this to the next
series as well.
Thanks again for valuable comments.
Cheers,
Mika
> -Chris
>
_______________________________________________
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-30 10:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 6:49 [PATCH v2 00/11] Check pixel clock when setting mode Mika Kahola
2015-07-30 6:49 ` [PATCH v2 01/11] drm/i915: Store max dotclock Mika Kahola
2015-07-30 7:00 ` Chris Wilson
2015-07-30 10:27 ` Mika Kahola [this message]
2015-07-30 6:49 ` [PATCH v2 02/11] drm/i915: DisplayPort pixel clock check Mika Kahola
2015-07-30 6:49 ` [PATCH v2 03/11] drm/i915: HDMI " Mika Kahola
2015-07-30 6:54 ` Chris Wilson
2015-07-30 10:28 ` Mika Kahola
2015-07-30 6:49 ` [PATCH v2 04/11] drm/i915: LVDS " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 05/11] drm/i915: SDVO " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 06/11] drm/i915: DSI " Mika Kahola
2015-07-30 6:52 ` Chris Wilson
2015-07-30 10:39 ` Mika Kahola
2015-07-30 6:49 ` [PATCH v2 07/11] drm/i915: CRT " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 08/11] drm/i915: TV " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 09/11] drm/i915: DisplayPort-MST " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 10/11] drm/i915: DVO " Mika Kahola
2015-07-30 6:49 ` [PATCH v2 11/11] drm/i915: Max DOT clock frequency to debugfs Mika Kahola
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=1438252034.23191.10.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