All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/tgl: Do not read the transcoder register for mipi dsi
@ 2019-11-11 10:52 ` Vandita Kulkarni
  0 siblings, 0 replies; 10+ messages in thread
From: Vandita Kulkarni @ 2019-11-11 10:52 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

As per the Bspec the port mapping is fixed for mipi dsi

Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 27 ++++++++++++++++----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f1328c08f4ad..d4a8617d6185 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10397,21 +10397,38 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc,
 	return transcoder_is_dsi(pipe_config->cpu_transcoder);
 }
 
-static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
-				       struct intel_crtc_state *pipe_config)
+static enum port
+intel_transcoder_to_port(struct drm_i915_private *dev_priv,
+			  enum transcoder cpu_transcoder)
 {
-	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-	struct intel_shared_dpll *pll;
 	enum port port;
 	u32 tmp;
 
-	tmp = I915_READ(TRANS_DDI_FUNC_CTL(pipe_config->cpu_transcoder));
+	/* DSI transcoders have fixed ddi mapping*/
+	if (transcoder_is_dsi(cpu_transcoder)) {
+		port = (cpu_transcoder == TRANSCODER_DSI_A) ? PORT_A : PORT_B;
+		return port;
+	}
 
+	tmp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
 	if (INTEL_GEN(dev_priv) >= 12)
 		port = TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
 	else
 		port = TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
 
+	return port;
+}
+
+static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
+				       struct intel_crtc_state *pipe_config)
+{
+	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+	struct intel_shared_dpll *pll;
+	enum port port;
+	u32 tmp;
+
+	port = intel_transcoder_to_port(dev_priv, pipe_config->cpu_transcoder);
+
 	if (INTEL_GEN(dev_priv) >= 11)
 		icelake_get_ddi_pll(dev_priv, port, pipe_config);
 	else if (IS_CANNONLAKE(dev_priv))
-- 
2.21.0.5.gaeb582a

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

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

end of thread, other threads:[~2019-11-12  4:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-11 10:52 [PATCH] drm/i915/tgl: Do not read the transcoder register for mipi dsi Vandita Kulkarni
2019-11-11 10:52 ` [Intel-gfx] " Vandita Kulkarni
2019-11-11 11:48 ` Jani Nikula
2019-11-11 11:48   ` [Intel-gfx] " Jani Nikula
2019-11-11 16:28 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-11-11 16:28   ` [Intel-gfx] " Patchwork
2019-11-11 16:52 ` ✓ Fi.CI.BAT: success " Patchwork
2019-11-11 16:52   ` [Intel-gfx] " Patchwork
2019-11-12  4:35 ` ✓ Fi.CI.IGT: " Patchwork
2019-11-12  4:35   ` [Intel-gfx] " Patchwork

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.