All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, yogesh.mohan.marimuthu@intel.com
Subject: [PATCH 10/14] drm/i915: don't enable DPLL for DSI
Date: Tue, 13 Aug 2013 16:29:49 +0300	[thread overview]
Message-ID: <192857d42f2543aa7505210d10a38f8d2be7353d.1376397804.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1376397804.git.jani.nikula@intel.com>
In-Reply-To: <cover.1376397804.git.jani.nikula@intel.com>

DPLL is not needed for DSI

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   48 ++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 78c42a1..e3ca335 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3660,7 +3660,8 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
 		if (encoder->pre_pll_enable)
 			encoder->pre_pll_enable(encoder);
 
-	vlv_enable_pll(intel_crtc);
+	if (!intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI))
+		vlv_enable_pll(intel_crtc);
 
 	for_each_encoder_on_crtc(dev, crtc, encoder)
 		if (encoder->pre_enable)
@@ -3775,7 +3776,8 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 		if (encoder->post_disable)
 			encoder->post_disable(encoder);
 
-	i9xx_disable_pll(dev_priv, pipe);
+	if (!intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI))
+		i9xx_disable_pll(dev_priv, pipe);
 
 	intel_crtc->active = false;
 	intel_update_fbc(dev);
@@ -4843,7 +4845,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 	intel_clock_t clock, reduced_clock;
 	u32 dspcntr;
 	bool ok, has_reduced_clock = false;
-	bool is_lvds = false;
+	bool is_lvds = false, is_dsi = false;
 	struct intel_encoder *encoder;
 	const intel_limit_t *limit;
 	int ret;
@@ -4853,6 +4855,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 		case INTEL_OUTPUT_LVDS:
 			is_lvds = true;
 			break;
+		case INTEL_OUTPUT_DSI:
+			is_dsi = true;
+			break;
 		}
 
 		num_connectors++;
@@ -4860,18 +4865,21 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 
 	refclk = i9xx_get_refclk(crtc, num_connectors);
 
-	/*
-	 * Returns a set of divisors for the desired target clock with the given
-	 * refclk, or FALSE.  The returned values represent the clock equation:
-	 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2.
-	 */
-	limit = intel_limit(crtc, refclk);
-	ok = dev_priv->display.find_dpll(limit, crtc,
-					 intel_crtc->config.port_clock,
-					 refclk, NULL, &clock);
-	if (!ok && !intel_crtc->config.clock_set) {
-		DRM_ERROR("Couldn't find PLL settings for mode!\n");
-		return -EINVAL;
+	if (!is_dsi) {
+		/*
+		 * Returns a set of divisors for the desired target clock with
+		 * the given refclk, or FALSE.  The returned values represent
+		 * the clock equation: reflck * (5 * (m1 + 2) + (m2 + 2)) / (n +
+		 * 2) / p1 / p2.
+		 */
+		limit = intel_limit(crtc, refclk);
+		ok = dev_priv->display.find_dpll(limit, crtc,
+						 intel_crtc->config.port_clock,
+						 refclk, NULL, &clock);
+		if (!ok && !intel_crtc->config.clock_set) {
+			DRM_ERROR("Couldn't find PLL settings for mode!\n");
+			return -EINVAL;
+		}
 	}
 
 	/* Ensure that the cursor is valid for the new mode before changing... */
@@ -4899,16 +4907,18 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 		intel_crtc->config.dpll.p2 = clock.p2;
 	}
 
-	if (IS_GEN2(dev))
+	if (IS_GEN2(dev)) {
 		i8xx_update_pll(intel_crtc,
 				has_reduced_clock ? &reduced_clock : NULL,
 				num_connectors);
-	else if (IS_VALLEYVIEW(dev))
-		vlv_update_pll(intel_crtc);
-	else
+	} else if (IS_VALLEYVIEW(dev)) {
+		if (!is_dsi)
+			vlv_update_pll(intel_crtc);
+	} else {
 		i9xx_update_pll(intel_crtc,
 				has_reduced_clock ? &reduced_clock : NULL,
                                 num_connectors);
+	}
 
 	/* Set up the display plane register */
 	dspcntr = DISPPLANE_GAMMA_ENABLE;
-- 
1.7.9.5

  parent reply	other threads:[~2013-08-13 13:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 13:29 [PATCH 00/14] drm/i915: Baytrail MIPI DSI support Jani Nikula
2013-08-13 13:29 ` [PATCH 01/14] drm: add MIPI DSI encoder and connector types Jani Nikula
2013-08-13 13:29 ` [PATCH 02/14] drm/i915: add more VLV IOSF sideband ports accessors Jani Nikula
2013-08-13 13:29 ` [PATCH 03/14] drm/i915: add VLV pipeconf bit definition for DSI PLL lock Jani Nikula
2013-08-13 13:29 ` [PATCH 04/14] drm/i915: add MIPI DSI register definitions Jani Nikula
2013-08-14 13:59   ` Ville Syrjälä
2013-08-15  8:02     ` Jani Nikula
2013-08-15 13:38   ` Damien Lespiau
2013-08-15 14:08     ` Daniel Vetter
2013-08-13 13:29 ` [PATCH 05/14] drm/i915: add MIPI DSI output type and subtypes Jani Nikula
2013-08-13 13:29 ` [PATCH 06/14] drm/i915: add structs for MIPI DSI output Jani Nikula
2013-08-13 13:29 ` [PATCH 07/14] drm/i915: add MIPI DSI command sending routines Jani Nikula
2013-08-13 13:29 ` [PATCH 08/14] drm/i915: add basic MIPI DSI output support Jani Nikula
2013-08-13 22:17   ` Daniel Vetter
2013-08-13 13:29 ` [PATCH 09/14] drm/i915: add VLV DSI PLL Calculations Jani Nikula
2013-08-13 13:29 ` Jani Nikula [this message]
2013-08-13 13:29 ` [PATCH 11/14] drm/i915: Band Gap WA Jani Nikula
2013-08-13 13:29 ` [PATCH 12/14] drm/i915: Parse the MIPI related VBT Block and store relevant info Jani Nikula
2013-08-13 13:29 ` [PATCH 13/14] drm/i915: initialize DSI output on VLV Jani Nikula
2013-08-13 13:29 ` [PATCH 14/14] drm/i915: add AUO MIPI DSI display sub-encoder Jani Nikula

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=192857d42f2543aa7505210d10a38f8d2be7353d.1376397804.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=yogesh.mohan.marimuthu@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.