aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-10-24 13:59:34 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-26 04:24:45 -0400
commita5c961d1f3a9ab5ba0e5706e866192f8108143fe (patch)
tree56b373ee551c1f4047ed06bd8ded849370966645 /drivers/gpu/drm/i915/intel_display.c
parent8361663420435bd915cb5beb20df8da29e06c1dd (diff)
drm/i915: add TRANSCODER_EDP
Before Haswell we used to have the CPU pipes and the PCH transcoders. We had the same amount of pipes and transcoders, and there was a 1:1 mapping between them. After Haswell what we used to call CPU pipe was split into CPU pipe and CPU transcoder. So now we have 3 CPU pipes (A, B and C), 4 CPU transcoders (A, B, C and EDP) and 1 PCH transcoder (only used for VGA). For all the outputs except for EDP we have an 1:1 mapping on the CPU pipes and CPU transcoders, so if you're using CPU pipe A you have to use CPU transcoder A. When have an eDP output you have to use transcoder EDP and you can attach this CPU transcoder to any of the 3 CPU pipes. When using VGA you need to select a pair of matching CPU pipes/transcoders (A/A, B/B, C/C) and you also need to enable/use the PCH transcoder. For now we're just creating the cpu_transcoder definitions and setting cpu_transcoder to TRANSCODER_EDP on DDI eDP code, but none of the registers was ported to use transcoder instead of pipe. The goal is to keep the code backwards-compatible since on all cases except when using eDP we must have pipe == cpu_transcoder. V2: Comment the haswell_crtc_off chunk, suggested by Damien Lespiau and Daniel Vetter. We currently need the haswell_crtc_off chunk because TRANSCODER_EDP can be used by any CRTC, so when you stop using it you have to stop saying you're using it, otherwise you may have at some point 2 CRTCs claiming they're using TRANSCODER_EDP (a disabled CRTC and an enabled one), then the HW state readout code will get completely confused. In other words: Imagine the following case: xrandr --output eDP1 --auto --crtc 0 xrandr --output eDP1 --off xrandr --output eDP1 --auto --crtc 2 After the last command you could get a "pipe A assertion failure (expected off, current on)" because CRTC 0 still claims it's using TRANSCODER_EDP, so the HW state readout function will read it (through PIPECONF) and expect it to be off, when it's actually on because it's being used by CRTC 2. So when we make "intel_crtc->cpu_transcoder = intel_crtc->pipe" we make sure we're pointing to our own original CRTC which is certainly not used by any other CRTC. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1f02486e444c..74e7625b19dc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -937,6 +937,15 @@ intel_vlv_find_best_pll(const intel_limit_t *limit, struct drm_crtc *crtc,
937 return true; 937 return true;
938} 938}
939 939
940enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
941 enum pipe pipe)
942{
943 struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
944 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
945
946 return intel_crtc->cpu_transcoder;
947}
948
940static void ironlake_wait_for_vblank(struct drm_device *dev, int pipe) 949static void ironlake_wait_for_vblank(struct drm_device *dev, int pipe)
941{ 950{
942 struct drm_i915_private *dev_priv = dev->dev_private; 951 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3482,6 +3491,12 @@ static void ironlake_crtc_off(struct drm_crtc *crtc)
3482 3491
3483static void haswell_crtc_off(struct drm_crtc *crtc) 3492static void haswell_crtc_off(struct drm_crtc *crtc)
3484{ 3493{
3494 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
3495
3496 /* Stop saying we're using TRANSCODER_EDP because some other CRTC might
3497 * start using it. */
3498 intel_crtc->cpu_transcoder = intel_crtc->pipe;
3499
3485 intel_ddi_put_crtc_pll(crtc); 3500 intel_ddi_put_crtc_pll(crtc);
3486} 3501}
3487 3502
@@ -5358,6 +5373,11 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc,
5358 num_connectors++; 5373 num_connectors++;
5359 } 5374 }
5360 5375
5376 if (is_cpu_edp)
5377 intel_crtc->cpu_transcoder = TRANSCODER_EDP;
5378 else
5379 intel_crtc->cpu_transcoder = pipe;
5380
5361 /* We are not sure yet this won't happen. */ 5381 /* We are not sure yet this won't happen. */
5362 WARN(!HAS_PCH_LPT(dev), "Unexpected PCH type %d\n", 5382 WARN(!HAS_PCH_LPT(dev), "Unexpected PCH type %d\n",
5363 INTEL_PCH_TYPE(dev)); 5383 INTEL_PCH_TYPE(dev));
@@ -7894,6 +7914,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
7894 /* Swap pipes & planes for FBC on pre-965 */ 7914 /* Swap pipes & planes for FBC on pre-965 */
7895 intel_crtc->pipe = pipe; 7915 intel_crtc->pipe = pipe;
7896 intel_crtc->plane = pipe; 7916 intel_crtc->plane = pipe;
7917 intel_crtc->cpu_transcoder = pipe;
7897 if (IS_MOBILE(dev) && IS_GEN3(dev)) { 7918 if (IS_MOBILE(dev) && IS_GEN3(dev)) {
7898 DRM_DEBUG_KMS("swapping pipes & planes for FBC\n"); 7919 DRM_DEBUG_KMS("swapping pipes & planes for FBC\n");
7899 intel_crtc->plane = !pipe; 7920 intel_crtc->plane = !pipe;