Skip to contentSkip to conversation

drm/i915: fix FDI_RX_CHICKEN register read masking

PATCH Applied Jani Nikula 3 participants 4 messages Oct 29, 2012

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

PATCH 1/1 drm/i915: fix FDI_RX_CHICKEN register read masking

Mask the value, not the register. Spotted while reading the code.

---

Only compile tested. Is there a bug that might match this?

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
index a5be346..6f8cf2a 100644
@@ -2804,8 +2804,8 @@ static void ironlake_fdi_disable(struct drm_crtc *crtc)
 	if (HAS_PCH_IBX(dev)) {
 		I915_WRITE(FDI_RX_CHICKEN(pipe), FDI_RX_PHASE_SYNC_POINTER_OVR);
 		I915_WRITE(FDI_RX_CHICKEN(pipe),
-			   I915_READ(FDI_RX_CHICKEN(pipe) &
-				     ~FDI_RX_PHASE_SYNC_POINTER_EN));
+			   I915_READ(FDI_RX_CHICKEN(pipe)) &
+			   ~FDI_RX_PHASE_SYNC_POINTER_EN);
 	} else if (HAS_PCH_CPT(dev)) {
 		cpt_phase_pointer_disable(dev, pipe);
 	}
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Jani Nikula

Mask the value, not the register. Spotted while reading the code.

Good catch! FWIW, I ran:

git grep -e "READ.*\(pipe\|plane\|cpu_transcoder\))[^)]*[|&]" drivers/gpu/drm/i915/

and this was the only catch.

Signature · 1 line
Damien
Quoted 29 lines

---

Only compile tested. Is there a bug that might match this?

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -3
index a5be346..6f8cf2a 100644
@@ -2804,8 +2804,8 @@ static void ironlake_fdi_disable(struct drm_crtc *crtc)
        if (HAS_PCH_IBX(dev)) {
                I915_WRITE(FDI_RX_CHICKEN(pipe), FDI_RX_PHASE_SYNC_POINTER_OVR);
                I915_WRITE(FDI_RX_CHICKEN(pipe),
-                          I915_READ(FDI_RX_CHICKEN(pipe) &
-                                    ~FDI_RX_PHASE_SYNC_POINTER_EN));
+                          I915_READ(FDI_RX_CHICKEN(pipe)) &
+                          ~FDI_RX_PHASE_SYNC_POINTER_EN);
        } else if (HAS_PCH_CPT(dev)) {
                cpt_phase_pointer_disable(dev, pipe);
        }
--

1.7.9.5

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

#3 lore raw
In reply to Jani Nikula
Quoted 16 lines · Jani Nikula

Mask the value, not the register. Spotted while reading the code.

---

Only compile tested. Is there a bug that might match this?

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index a5be346..6f8cf2a 100644

drivers/gpu/drm/i915/intel_display.c static void ironlake_fdi_disable(struct drm_crtc *crtc) · line 2808

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -2804,8 +2804,8 @@ static void ironlake_fdi_disable(struct drm_crtc *crtc)
 	if (HAS_PCH_IBX(dev)) {
 		I915_WRITE(FDI_RX_CHICKEN(pipe), FDI_RX_PHASE_SYNC_POINTER_OVR);
 		I915_WRITE(FDI_RX_CHICKEN(pipe),
-			   I915_READ(FDI_RX_CHICKEN(pipe) &
-				     ~FDI_RX_PHASE_SYNC_POINTER_EN));
+			   I915_READ(FDI_RX_CHICKEN(pipe)) &
+			   ~FDI_RX_PHASE_SYNC_POINTER_EN);

On second look, we write the same register in the previous line, and the w/a seems to be to set FDI_RX_PHASE_SYNC_POINTER_OVR to enable the logic, then keep always set FDI_RX_PHASE_SYNC_POINTER_OVR and toggle ~FDI_RX_PHASE_SYNC_POINTER_EN before/after enabling the pc transcoder. So the right things seems to be to simply kill the 2nd write. -Daniel

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	} else if (HAS_PCH_CPT(dev)) {
 		cpt_phase_pointer_disable(dev, pipe);
 	}
Signature · 1 line
1.7.9.5
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch