From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
intel-gfx@lists.freedesktop.org,
Thomas Richter <richter@rus.uni-stuttgart.de>
Subject: Re: [PATCH 3/5] drm/i915: i830M has watermarks like i855
Date: Fri, 10 Jan 2014 13:09:38 +0200 [thread overview]
Message-ID: <20140110110938.GS4800@intel.com> (raw)
In-Reply-To: <1387060712-5081-4-git-send-email-rodrigo.vivi@gmail.com>
On Sat, Dec 14, 2013 at 08:38:30PM -0200, Rodrigo Vivi wrote:
> From: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> So shuffle the checks around a bit. Also give all the structs and
> functions proper prefixes: i830_ for the dual-pipe mobile platforms
> and i845_ for the two single-pipe desktop platforms.
>
> Note that the max fifo value isn't actually correct for the i830M, but
> since we don't frob the fifo split we don't actually need it. This is
> different for some gen3 devices where we need the full fifo for self
> refresh mode.
>
> Cc: Thomas Richter <richter@rus.uni-stuttgart.de>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_pm.c | 53 +++++++++++++++--------------------------
> 1 file changed, 19 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index bcb8470..465304a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -824,7 +824,7 @@ static int i9xx_get_fifo_size(struct drm_device *dev, int plane)
> return size;
> }
>
> -static int i85x_get_fifo_size(struct drm_device *dev, int plane)
> +static int i830_get_fifo_size(struct drm_device *dev, int plane)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> uint32_t dsparb = I915_READ(DSPARB);
> @@ -857,21 +857,6 @@ static int i845_get_fifo_size(struct drm_device *dev, int plane)
> return size;
> }
>
> -static int i830_get_fifo_size(struct drm_device *dev, int plane)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - uint32_t dsparb = I915_READ(DSPARB);
> - int size;
> -
> - size = dsparb & 0x7f;
> - size >>= 1; /* Convert to cachelines */
> -
> - DRM_DEBUG_KMS("FIFO size - (0x%08x) %s: %d\n", dsparb,
> - plane ? "B" : "A", size);
> -
> - return size;
> -}
> -
> /* Pineview has different values for various configs */
> static const struct intel_watermark_params pineview_display_wm = {
> PINEVIEW_DISPLAY_FIFO,
> @@ -950,14 +935,14 @@ static const struct intel_watermark_params i915_wm_info = {
> 2,
> I915_FIFO_LINE_SIZE
> };
> -static const struct intel_watermark_params i855_wm_info = {
> +static const struct intel_watermark_params i830_wm_info = {
> I855GM_FIFO_SIZE,
> I915_MAX_WM,
> 1,
> 2,
> I830_FIFO_LINE_SIZE
> };
> -static const struct intel_watermark_params i830_wm_info = {
> +static const struct intel_watermark_params i845_wm_info = {
> I830_FIFO_SIZE,
> I915_MAX_WM,
> 1,
> @@ -1574,7 +1559,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
> else if (!IS_GEN2(dev))
> wm_info = &i915_wm_info;
> else
> - wm_info = &i855_wm_info;
> + wm_info = &i830_wm_info;
>
> fifo_size = dev_priv->display.get_fifo_size(dev, 0);
> crtc = intel_get_crtc_for_plane(dev, 0);
> @@ -1681,7 +1666,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
> }
> }
>
> -static void i830_update_wm(struct drm_crtc *unused_crtc)
> +static void i845_update_wm(struct drm_crtc *unused_crtc)
> {
> struct drm_device *dev = unused_crtc->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1696,7 +1681,7 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)
>
> adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
> planea_wm = intel_calculate_wm(adjusted_mode->crtc_clock,
> - &i830_wm_info,
> + &i845_wm_info,
> dev_priv->display.get_fifo_size(dev, 0),
> 4, latency_ns);
> fwater_lo = I915_READ(FW_BLC) & ~0xfff;
> @@ -6180,21 +6165,21 @@ void intel_init_pm(struct drm_device *dev)
> dev_priv->display.update_wm = i9xx_update_wm;
> dev_priv->display.get_fifo_size = i9xx_get_fifo_size;
> dev_priv->display.init_clock_gating = gen3_init_clock_gating;
> - } else if (IS_I865G(dev)) {
> - dev_priv->display.update_wm = i830_update_wm;
> - dev_priv->display.init_clock_gating = i85x_init_clock_gating;
> - dev_priv->display.get_fifo_size = i830_get_fifo_size;
> - } else if (IS_I85X(dev)) {
> - dev_priv->display.update_wm = i9xx_update_wm;
> - dev_priv->display.get_fifo_size = i85x_get_fifo_size;
> - dev_priv->display.init_clock_gating = i85x_init_clock_gating;
> - } else {
> - dev_priv->display.update_wm = i830_update_wm;
> - dev_priv->display.init_clock_gating = i830_init_clock_gating;
> - if (IS_845G(dev))
> + } else if (IS_GEN2(dev)) {
> + if (INTEL_INFO(dev)->num_pipes == 1) {
> + dev_priv->display.update_wm = i845_update_wm;
> dev_priv->display.get_fifo_size = i845_get_fifo_size;
> - else
> + } else {
> + dev_priv->display.update_wm = i9xx_update_wm;
> dev_priv->display.get_fifo_size = i830_get_fifo_size;
> + }
> +
> + if (IS_I85X(dev) || IS_I865G(dev))
> + dev_priv->display.init_clock_gating = i85x_init_clock_gating;
> + else
> + dev_priv->display.init_clock_gating = i830_init_clock_gating;
> + } else {
> + DRM_ERROR("unexpected fall-through in intel_init_pm\n");
> }
> }
>
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2014-01-10 11:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-14 22:38 [PATCH 0/5] drm-intel-collector - update Rodrigo Vivi
2013-12-14 22:38 ` [PATCH 1/5] drm/i915: Asynchronously perform the set-base for a simple modeset Rodrigo Vivi
2013-12-14 22:38 ` [PATCH 2/5] drm/i915: parse backlight modulation frequency from the BIOS VBT Rodrigo Vivi
2013-12-16 9:04 ` Daniel Vetter
2013-12-14 22:38 ` [PATCH 3/5] drm/i915: i830M has watermarks like i855 Rodrigo Vivi
2014-01-10 11:09 ` Ville Syrjälä [this message]
2013-12-14 22:38 ` [PATCH 4/5] drm/i915: vlv: W/a for hotplug/manual VGA detection Rodrigo Vivi
2013-12-17 20:32 ` Imre Deak
2013-12-14 22:38 ` [PATCH 5/5] drm/i915: Only use read-back pipe config Rodrigo Vivi
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=20140110110938.GS4800@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=richter@rus.uni-stuttgart.de \
--cc=rodrigo.vivi@gmail.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