Skip to contentSkip to conversation

Untested patches for misc DP issues.

RFC In review Eric Anholt 1 participant 5 messages Nov 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Here are some things I came up with while reviewing the code compared to the specs. They are completely untested, so don't push them.

#1 lore raw

PATCH 2/6 drm/i915: Set the transcoder port to none when disabling DP.

The specs say to do so.

---
 drivers/gpu/drm/i915/i915_reg.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 886c0e0..952a686 100644
@@ -3053,6 +3053,7 @@
 #define  TRANS_DP_PORT_SEL_B	(0<<29)
 #define  TRANS_DP_PORT_SEL_C	(1<<29)
 #define  TRANS_DP_PORT_SEL_D	(2<<29)
+#define  TRANS_DP_PORT_SEL_NONE	(2<<29)
 #define  TRANS_DP_PORT_SEL_MASK	(3<<29)
 #define  TRANS_DP_AUDIO_ONLY	(1<<26)
 #define  TRANS_DP_ENH_FRAMING	(1<<18)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 3fa5aaa..8b6472d 100644
@@ -2276,6 +2276,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 		reg = TRANS_DP_CTL(pipe);
 		temp = I915_READ(reg);
 		temp &= ~(TRANS_DP_OUTPUT_ENABLE | TRANS_DP_PORT_SEL_MASK);
+		temp |= TRANS_DP_PORT_SEL_NONE;
 		I915_WRITE(reg, temp);
 
 		/* disable DPLL_SEL */
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 3/6 drm/i915: Always set the DP transcoder config to 8BPC.

In reply to Eric Anholt

The pipe is always set to 8BPC, but here we were leaving whatever previous bits were set by the BIOS in place.

---
 drivers/gpu/drm/i915/i915_reg.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 952a686..00351a6 100644
@@ -3061,6 +3061,7 @@
 #define  TRANS_DP_10BPC		(1<<9)
 #define  TRANS_DP_6BPC		(2<<9)
 #define  TRANS_DP_12BPC		(3<<9)
+#define  TRANS_DP_BPC_MASK	(3<<9)
 #define  TRANS_DP_VSYNC_ACTIVE_HIGH	(1<<4)
 #define  TRANS_DP_VSYNC_ACTIVE_LOW	0
 #define  TRANS_DP_HSYNC_ACTIVE_HIGH	(1<<3)
drivers/gpu/drm/i915/intel_display.c +3 -1
index 8b6472d..841d7fe 100644
@@ -2119,9 +2119,11 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 		reg = TRANS_DP_CTL(pipe);
 		temp = I915_READ(reg);
 		temp &= ~(TRANS_DP_PORT_SEL_MASK |
-			  TRANS_DP_SYNC_MASK);
+			  TRANS_DP_SYNC_MASK |
+			  TRANS_DP_BPC_MASK);
 		temp |= (TRANS_DP_OUTPUT_ENABLE |
 			 TRANS_DP_ENH_FRAMING);
+		temp |= TRANS_DP_8BPC;
 
 		if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC)
 			temp |= TRANS_DP_HSYNC_ACTIVE_HIGH;
Signature · 1 line
1.7.2.3
author Tested-by Keith Packard on v1 3/6
#3 lore raw

Re: [PATCH 3/6] drm/i915: Always set the DP transcoder config to 8BPC.

Quoted 2 lines · Eric Anholt

The pipe is always set to 8BPC, but here we were leaving whatever previous bits were set by the BIOS in place.

This series has now been tested on a DP system. We got flashing garbage due to the BIOS having configured 6BPC, until this patch was applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH 4/6 drm/i915: Apply a workaround for transitioning from DP on pipe B to HDMI.

In reply to Eric Anholt

This only applies to Ironlake.

---
 drivers/gpu/drm/i915/intel_dp.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +21 -0
index c8e0055..252bf7c 100644
@@ -1406,6 +1406,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc);
 	uint32_t DP = intel_dp->DP;
 
 	DRM_DEBUG_KMS("\n");
@@ -1430,6 +1431,26 @@ intel_dp_link_down(struct intel_dp *intel_dp)
 
 	if (is_edp(intel_dp))
 		DP |= DP_LINK_TRAIN_OFF;
+
+	if (!HAS_PCH_CPT(dev) && (DP & DP_PIPEB_SELECT)) {
+		/* Hardware workaround: leaving our transcoder select
+		 * set to transcoder B while it's off will prevent the
+		 * corresponding HDMI output on transcoder A.
+		 *
+		 * Combine this with another hardware workaround:
+		 * transcoder select bit can only be cleared while the
+		 * port is enabled.
+		 */
+		DP &= ~DP_PIPEB_SELECT;
+		I915_WRITE(intel_dp->output_reg, DP);
+
+		/* Changes to enable or select take place the vblank
+		 * after being written.
+		 */
+		intel_wait_for_vblank(intel_dp->base.base.dev,
+				      intel_crtc->pipe);
+	}
+
 	I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
 	POSTING_READ(intel_dp->output_reg);
 }
Signature · 1 line
1.7.2.3