Skip to contentSkip to conversation

drm/i915: Preserve the DDI_A_4_LANES bit from the bios

PATCH In review Stéphane Marchesin 3 participants 3 messages Jul 12, 2013

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

PATCH 1/1 drm/i915: Preserve the DDI_A_4_LANES bit from the bios

Otherwise the DDI_A_4_LANES bit gets lost and we can't use > 2 lanes on eDP. This fixes eDP on hsw with > 2 lanes.

---
 drivers/gpu/drm/i915/intel_ddi.c | 2 +-
 drivers/gpu/drm/i915/intel_dp.c  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 324211a..5e3f97b 100644
@@ -1348,7 +1348,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 
 	intel_dig_port->port = port;
 	intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
-					DDI_BUF_PORT_REVERSAL;
+					(DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);
 	intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
 
 	intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
drivers/gpu/drm/i915/intel_dp.c +3 -2
index b739712..a1d838c 100644
@@ -834,10 +834,11 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	 * configuration happens (oddly) in ironlake_pch_enable
 	 */
 
-	/* Preserve the BIOS-computed detected bit. This is
+	/* Preserve the BIOS-computed detected and 4 lanes bits. This is
 	 * supposed to be read-only.
 	 */
-	intel_dp->DP = I915_READ(intel_dp->output_reg) & DP_DETECTED;
+	intel_dp->DP = I915_READ(intel_dp->output_reg) &
+		       (DP_DETECTED | DDI_A_4_LANES);
 
 	/* Handle DP bits in common between all three register formats */
 	intel_dp->DP |= DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0;
Signature · 6 lines
1.8.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · On Fri, 12 Jul 2013 13:03:46 -0700 Stéphane Marchesin <[email protected]>…

Otherwise the DDI_A_4_LANES bit gets lost and we can't use > 2 lanes on eDP. This fixes eDP on hsw with > 2 lanes.

---
 drivers/gpu/drm/i915/intel_ddi.c | 2 +-
 drivers/gpu/drm/i915/intel_dp.c  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 324211a..5e3f97b 100644
@@ -1348,7 +1348,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 
 	intel_dig_port->port = port;
 	intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
-					DDI_BUF_PORT_REVERSAL;
+					(DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);
 	intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
 
 	intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
drivers/gpu/drm/i915/intel_dp.c +0 -0
index b739712..a1d838c 100644
@@ -834,10 +834,11 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	 * configuration happens (oddly) in ironlake_pch_enable
 	 */
 

drivers/gpu/drm/i915/intel_dp.c intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, · line 844

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +3 -2
-	/* Preserve the BIOS-computed detected bit. This is
+	/* Preserve the BIOS-computed detected and 4 lanes bits. This is
 	 * supposed to be read-only.
 	 */
-	intel_dp->DP = I915_READ(intel_dp->output_reg) & DP_DETECTED;
+	intel_dp->DP = I915_READ(intel_dp->output_reg) &
+		       (DP_DETECTED | DDI_A_4_LANES);
 
 	/* Handle DP bits in common between all three register formats */
 	intel_dp->DP |= DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0;

Thanks. Wonder if we're clobbering any other "BIOS must set this bit and no one should touch it again" bits elsewhere...

Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
In reply to Stéphane Marchesin
Quoted 14 lines · Stéphane Marchesin

Otherwise the DDI_A_4_LANES bit gets lost and we can't use > 2 lanes on eDP. This fixes eDP on hsw with > 2 lanes.

---
 drivers/gpu/drm/i915/intel_ddi.c | 2 +-
 drivers/gpu/drm/i915/intel_dp.c  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +0 -0
index 324211a..5e3f97b 100644

drivers/gpu/drm/i915/intel_ddi.c void intel_ddi_init(struct drm_device *dev, enum port port) · line 1351

Quoted 5 lines
drivers/gpu/drm/i915/intel_ddi.c +1 -1
@@ -1348,7 +1348,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 
        intel_dig_port->port = port;
        intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
-                                       DDI_BUF_PORT_REVERSAL;
+                                       (DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);

I think we should do a s/port_reversal/saved_port_bits/ since the current name is confusing.

Quoted 8 lines
drivers/gpu/drm/i915/intel_ddi.c +0 -0
        intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
 
        intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
drivers/gpu/drm/i915/intel_dp.c +0 -0
index b739712..a1d838c 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, · line 841

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +3 -2
@@ -834,10 +834,11 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
         * configuration happens (oddly) in ironlake_pch_enable
         */
 
-       /* Preserve the BIOS-computed detected bit. This is
+       /* Preserve the BIOS-computed detected and 4 lanes bits. This is
         * supposed to be read-only.
         */
-       intel_dp->DP = I915_READ(intel_dp->output_reg) & DP_DETECTED;
+       intel_dp->DP = I915_READ(intel_dp->output_reg) &
+                      (DP_DETECTED | DDI_A_4_LANES);

Why is this hunk here required? It seems to not be needed for the port reversal stuff, and this code here is run on all platforms ... If possible I'd like to just ditch it.
-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +0 -1
        /* Handle DP bits in common between all three register formats */
        intel_dp->DP |= DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0;
--

1.8.3

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

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch