Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/i915: Warn if a pipe is enabled with a bogus port
@ 2013-03-07 15:30 Damien Lespiau
  2013-03-07 15:30 ` [PATCH 2/6] drm/i915: Initialize wait in intel_ddi_prepare_link_retrain() Damien Lespiau
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Damien Lespiau @ 2013-03-07 15:30 UTC (permalink / raw)
  To: intel-gfx

If TRANS_DDI_FUNC_CTL has been wrongly programmed with an incorrect
port, we are currently trying to read PORT_CLK_SEL(port) with an
initialized value.

Handle that case by returning PORT_CLK_SEL_NONE and warning about it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

to add to first
---
 drivers/gpu/drm/i915/intel_ddi.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 56bb7cb..3b5838d 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1157,7 +1157,7 @@ static uint32_t intel_ddi_get_crtc_pll(struct drm_i915_private *dev_priv,
 				       enum pipe pipe)
 {
 	uint32_t temp, ret;
-	enum port port;
+	enum port port = I915_MAX_PORTS;
 	enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
 								      pipe);
 	int i;
@@ -1173,7 +1173,10 @@ static uint32_t intel_ddi_get_crtc_pll(struct drm_i915_private *dev_priv,
 				port = i;
 	}
 
-	ret = I915_READ(PORT_CLK_SEL(port));
+	if (port == I915_MAX_PORTS)
+		ret = PORT_CLK_SEL_NONE;
+	else
+		ret = I915_READ(PORT_CLK_SEL(port));
 
 	DRM_DEBUG_KMS("Pipe %c connected to port %c using clock 0x%08x\n",
 		      pipe_name(pipe), port_name(port), ret);
@@ -1207,6 +1210,10 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
 		case PORT_CLK_SEL_WRPLL2:
 			dev_priv->ddi_plls.wrpll2_refcount++;
 			break;
+		case PORT_CLK_SEL_NONE:
+			WARN(1, "Pipe %c enabled but no clock selected\n",
+			     pipe_name(pipe));
+			break;
 		}
 	}
 }
-- 
1.7.7.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-03-25 18:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 15:30 [PATCH 1/6] drm/i915: Warn if a pipe is enabled with a bogus port Damien Lespiau
2013-03-07 15:30 ` [PATCH 2/6] drm/i915: Initialize wait in intel_ddi_prepare_link_retrain() Damien Lespiau
2013-03-08 21:03   ` Ben Widawsky
2013-03-07 15:30 ` [PATCH 3/6] drm/i915: Error out if we are trying to use VGA with SPLL already in use Damien Lespiau
2013-03-08 21:06   ` Ben Widawsky
2013-03-22 21:14     ` Paulo Zanoni
2013-03-23 12:27       ` Daniel Vetter
2013-03-07 15:30 ` [PATCH 4/6] drm/i915: Cleanup if the EDP transcoder has a bobug input value Damien Lespiau
2013-03-22 21:34   ` Paulo Zanoni
2013-03-23 12:30     ` Daniel Vetter
2013-03-07 15:30 ` [PATCH 5/6] drm/i915: Rename intel_ddi_enable_pipe_func() to transcoder_func() Damien Lespiau
2013-03-22 21:37   ` Paulo Zanoni
2013-03-07 15:30 ` [PATCH 6/6] drm/i915: Use BUG() in a case of a programming error Damien Lespiau
2013-03-22 21:43   ` Paulo Zanoni
2013-03-23 12:31     ` Daniel Vetter
2013-03-22 21:04 ` [PATCH 1/6] drm/i915: Warn if a pipe is enabled with a bogus port Paulo Zanoni
2013-03-25 15:16   ` [PATCH v2] " Damien Lespiau
2013-03-25 17:00     ` Paulo Zanoni
2013-03-25 18:21       ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox