drm/i915: fix FDI_RX_CHICKEN register read masking
Subsystems (2)
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
@@ -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
Quoted 3 lines · Jani Nikula
Mask the value, not the register. Spotted while reading the code.
Signed-off-by Jani Nikula <[email protected]>
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@@ -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
Daniel Vetter
AppliedQuoted 6 lines · Damien
Quoted 3 lines · Jani Nikula
Mask the value, not the register. Spotted while reading the code.
Signed-off-by Jani Nikula <[email protected]>Reviewed-by Damien Lespiau <[email protected]>
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
Quoted 16 lines · Jani Nikula
Mask the value, not the register. Spotted while reading the code.
Signed-off-by Jani Nikula <[email protected]>---
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
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