summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChon Ming Lee <chon.ming.lee@intel.com>2014-04-09 13:28:16 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-12 19:50:12 +0200
commiteb69b0e59ac845666b7b284ca83a1fef17ebaa9f (patch)
tree86121715725c51d23c90f9d6a54cbfbda407453f
parent00fc31b72ea773fa966a486e54ca379045bd2cfd (diff)
drm/i915/chv: Add vlv_pipe_to_channel
Cherryview has 3 pipes. Some of the pll dpio offset calculation is based on pipe number. Need to use vlv_pipe_to_channel to calculate the correct phy channel to use for the pipe. Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9d5816d06b53..acfc5c853b38 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -570,6 +570,20 @@ vlv_dport_to_channel(struct intel_digital_port *dport)
}
}
+static inline int
+vlv_pipe_to_channel(enum pipe pipe)
+{
+ switch (pipe) {
+ case PIPE_A:
+ case PIPE_C:
+ return DPIO_CH0;
+ case PIPE_B:
+ return DPIO_CH1;
+ default:
+ BUG();
+ }
+}
+
static inline struct drm_crtc *
intel_get_crtc_for_pipe(struct drm_device *dev, int pipe)
{