]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/i915/chv: Add vlv_pipe_to_channel
authorChon Ming Lee <chon.ming.lee@intel.com>
Wed, 9 Apr 2014 10:28:16 +0000 (13:28 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 12 May 2014 17:50:12 +0000 (19:50 +0200)
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>
drivers/gpu/drm/i915/intel_drv.h

index 9d5816d06b53818ad1b0ccd199c537740e0a5be9..acfc5c853b384904b36c8d76c597bb4ad6b9ed91 100644 (file)
@@ -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)
 {