Skip to contentSkip to conversation

drm/i915: Mask out hardware status bits from VLV DPLL register

PATCH Applied [email protected] 3 participants 3 messages Jun 26, 2013

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

PATCH 1/1 drm/i915: Mask out hardware status bits from VLV DPLL register

From: Ville Syrjälä <[email protected]>

The DPLL lock bit, and the DPIO phy status bits are read-only and controlled by the hardware, so they will never be set by the driver. Mask them out when reading the hw state, so that the state comparison won't fail.

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
index 259ea4b..d67a9f5 100644
@@ -4958,6 +4958,10 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
 	if (!IS_VALLEYVIEW(dev)) {
 		pipe_config->dpll_hw_state.fp0 = I915_READ(FP0(crtc->pipe));
 		pipe_config->dpll_hw_state.fp1 = I915_READ(FP1(crtc->pipe));
+	} else {
+		pipe_config->dpll_hw_state.dpll &= ~(DPLL_LOCK_VLV |
+						     DPLL_PORTC_READY_MASK |
+						     DPLL_PORTB_READY_MASK);
 	}
 
 	return true;
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · On Wed, 26 Jun 2013 17:44:15 +0300 [email protected] wrote:

From: Ville Syrjälä <[email protected]>

The DPLL lock bit, and the DPIO phy status bits are read-only and controlled by the hardware, so they will never be set by the driver. Mask them out when reading the hw state, so that the state comparison won't fail.

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 259ea4b..d67a9f5 100644

drivers/gpu/drm/i915/intel_display.c static bool i9xx_get_pipe_config(struct intel_crtc *crtc, · line 4967

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -4958,6 +4958,10 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
 	if (!IS_VALLEYVIEW(dev)) {
 		pipe_config->dpll_hw_state.fp0 = I915_READ(FP0(crtc->pipe));
 		pipe_config->dpll_hw_state.fp1 = I915_READ(FP1(crtc->pipe));
+	} else {
+		pipe_config->dpll_hw_state.dpll &= ~(DPLL_LOCK_VLV |
+						     DPLL_PORTC_READY_MASK |
+						     DPLL_PORTB_READY_MASK);
 	}
 
 	return true;

As a rule I'd like to see comments explaining this too, so we don't have to dig through the changelog to figure it out. But that's no biggie here, so:

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
Quoted 29 lines · Jesse Barnes
Quoted 26 lines · On Wed, 26 Jun 2013 17:44:15 +0300 [email protected] wrote:

From: Ville Syrjälä <[email protected]>

The DPLL lock bit, and the DPIO phy status bits are read-only and controlled by the hardware, so they will never be set by the driver. Mask them out when reading the hw state, so that the state comparison won't fail.

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
index 259ea4b..d67a9f5 100644
@@ -4958,6 +4958,10 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
 	if (!IS_VALLEYVIEW(dev)) {
 		pipe_config->dpll_hw_state.fp0 = I915_READ(FP0(crtc->pipe));
 		pipe_config->dpll_hw_state.fp1 = I915_READ(FP1(crtc->pipe));
+	} else {
+		pipe_config->dpll_hw_state.dpll &= ~(DPLL_LOCK_VLV |
+						     DPLL_PORTC_READY_MASK |
+						     DPLL_PORTB_READY_MASK);
 	}
 
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static bool i9xx_get_pipe_config(struct intel_crtc *crtc, · line 4967

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
 	return true;

As a rule I'd like to see comments explaining this too, so we don't have to dig through the changelog to figure it out. But that's no biggie here, so:

Very much agreed on the need for a comment here, so I've added a one-liner.

Quoted 1 line

Queued for -next, thanks for the patch.
-Daniel

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