aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-05 07:34:09 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-10 13:48:56 -0400
commit1188739757d0e78810de5fe83dbe0128f624b9e8 (patch)
tree5058d0c6a7b5b3c8461bb74f62b7858d3e0c7ecb /drivers/gpu/drm/i915/intel_display.c
parenta43f6e0fd6219e806268d5fef67db722875393a0 (diff)
drm/i915: refactor PCH_DPLL_SEL #defines
The bits are evenly space, so we can cut down on two big switch blocks. This also greatly simplifies the hw state readout which follows in the next patch. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a5ccce07386b..d5932ef76cde 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2986,21 +2986,8 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)
2986 u32 sel; 2986 u32 sel;
2987 2987
2988 temp = I915_READ(PCH_DPLL_SEL); 2988 temp = I915_READ(PCH_DPLL_SEL);
2989 switch (pipe) { 2989 temp |= TRANS_DPLL_ENABLE(pipe);
2990 default: 2990 sel = TRANS_DPLLB_SEL(pipe);
2991 case 0:
2992 temp |= TRANSA_DPLL_ENABLE;
2993 sel = TRANSA_DPLLB_SEL;
2994 break;
2995 case 1:
2996 temp |= TRANSB_DPLL_ENABLE;
2997 sel = TRANSB_DPLLB_SEL;
2998 break;
2999 case 2:
3000 temp |= TRANSC_DPLL_ENABLE;
3001 sel = TRANSC_DPLLB_SEL;
3002 break;
3003 }
3004 if (intel_crtc->config.shared_dpll == DPLL_ID_PCH_PLL_B) 2991 if (intel_crtc->config.shared_dpll == DPLL_ID_PCH_PLL_B)
3005 temp |= sel; 2992 temp |= sel;
3006 else 2993 else
@@ -3480,20 +3467,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
3480 3467
3481 /* disable DPLL_SEL */ 3468 /* disable DPLL_SEL */
3482 temp = I915_READ(PCH_DPLL_SEL); 3469 temp = I915_READ(PCH_DPLL_SEL);
3483 switch (pipe) { 3470 temp &= ~(TRANS_DPLL_ENABLE(pipe) | TRANS_DPLLB_SEL(pipe));
3484 case 0:
3485 temp &= ~(TRANSA_DPLL_ENABLE | TRANSA_DPLLB_SEL);
3486 break;
3487 case 1:
3488 temp &= ~(TRANSB_DPLL_ENABLE | TRANSB_DPLLB_SEL);
3489 break;
3490 case 2:
3491 /* C shares PLL A or B */
3492 temp &= ~(TRANSC_DPLL_ENABLE | TRANSC_DPLLB_SEL);
3493 break;
3494 default:
3495 BUG(); /* wtf */
3496 }
3497 I915_WRITE(PCH_DPLL_SEL, temp); 3471 I915_WRITE(PCH_DPLL_SEL, temp);
3498 } 3472 }
3499 3473