aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h8
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c21
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h4
4 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 987af6f5e0c6..2fcf284869df 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -58,6 +58,14 @@ enum pipe {
58}; 58};
59#define pipe_name(p) ((p) + 'A') 59#define pipe_name(p) ((p) + 'A')
60 60
61enum transcoder {
62 TRANSCODER_A = 0,
63 TRANSCODER_B,
64 TRANSCODER_C,
65 TRANSCODER_EDP = 0xF,
66};
67#define transcoder_name(t) ((t) + 'A')
68
61enum plane { 69enum plane {
62 PLANE_A = 0, 70 PLANE_A = 0,
63 PLANE_B, 71 PLANE_B,
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index c7c4b96c6650..598f83a298cf 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -26,6 +26,7 @@
26#define _I915_REG_H_ 26#define _I915_REG_H_
27 27
28#define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a))) 28#define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a)))
29#define _TRANSCODER(tran, a, b) ((a) + (tran)*((b)-(a)))
29 30
30#define _PORT(port, a, b) ((a) + (port)*((b)-(a))) 31#define _PORT(port, a, b) ((a) + (port)*((b)-(a)))
31 32
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;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 4c7ae4f3ae3b..90e706c846a4 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -195,6 +195,7 @@ struct intel_crtc {
195 struct drm_crtc base; 195 struct drm_crtc base;
196 enum pipe pipe; 196 enum pipe pipe;
197 enum plane plane; 197 enum plane plane;
198 enum transcoder cpu_transcoder;
198 u8 lut_r[256], lut_g[256], lut_b[256]; 199 u8 lut_r[256], lut_g[256], lut_b[256];
199 /* 200 /*
200 * Whether the crtc and the connected output pipeline is active. Implies 201 * Whether the crtc and the connected output pipeline is active. Implies
@@ -505,6 +506,9 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
505 struct drm_crtc *crtc); 506 struct drm_crtc *crtc);
506int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, 507int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
507 struct drm_file *file_priv); 508 struct drm_file *file_priv);
509extern enum transcoder
510intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
511 enum pipe pipe);
508extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); 512extern void intel_wait_for_vblank(struct drm_device *dev, int pipe);
509extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe); 513extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe);
510 514