Untested patches for misc DP issues.
Subsystems (2)
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.
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
@@ -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
@@ -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
PATCH 3/6 drm/i915: Always set the DP transcoder config to 8BPC.
In reply to Eric AnholtThe 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
@@ -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
@@ -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
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
PATCH 4/6 drm/i915: Apply a workaround for transitioning from DP on pipe B to HDMI.
In reply to Eric AnholtThis 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
@@ -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