All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gaurav K Singh <gaurav.k.singh@intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: jani.nikula@intel.com, Shobhit Kumar <shobhit.kumar@intel.com>
Subject: [PATCH] drm/i915: Changes for calculating dsi clk for CHT
Date: Tue,  3 Mar 2015 18:27:33 +0530	[thread overview]
Message-ID: <1425387453-24986-1-git-send-email-gaurav.k.singh@intel.com> (raw)

Depending on the correct refclk, n ,p for CHT, calculate
the dsi clk during readout DSI HW state.

Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi_pll.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi_pll.c b/drivers/gpu/drm/i915/intel_dsi_pll.c
index 5e44c9b..c7d55e8 100644
--- a/drivers/gpu/drm/i915/intel_dsi_pll.c
+++ b/drivers/gpu/drm/i915/intel_dsi_pll.c
@@ -357,9 +357,17 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
 	u32 m = 0, p = 0;
 	int refclk = 25000;
 	int i;
+	u32 n = 1;
+	u32 m_start = 62;
 
 	DRM_DEBUG_KMS("\n");
 
+	if (IS_CHERRYVIEW(dev_priv->dev)) {
+		refclk = 100000;
+		n = 4;
+		m_start = 70;
+	}
+
 	mutex_lock(&dev_priv->dpio_lock);
 	pll_ctl = vlv_cck_read(dev_priv, CCK_REG_DSI_PLL_CONTROL);
 	pll_div = vlv_cck_read(dev_priv, CCK_REG_DSI_PLL_DIVIDER);
@@ -394,9 +402,9 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
 		return 0;
 	}
 
-	m = i + 62;
+	m = i + m_start;
 
-	dsi_clock = (m * refclk) / p;
+	dsi_clock = (m * refclk) / (p * n);
 
 	/* pixel_format and pipe_bpp should agree */
 	assert_bpp_mismatch(intel_dsi->pixel_format, pipe_bpp);
-- 
1.7.9.5

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

             reply	other threads:[~2015-03-03 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 12:57 Gaurav K Singh [this message]
2015-03-04  2:17 ` [PATCH] drm/i915: Changes for calculating dsi clk for CHT shuang.he

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=1425387453-24986-1-git-send-email-gaurav.k.singh@intel.com \
    --to=gaurav.k.singh@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=shobhit.kumar@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.