diff options
author | Vandana Kannan <vandana.kannan@intel.com> | 2014-08-05 10:51:22 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-08 11:43:24 -0400 |
commit | f769cd247d2be5af377adf82882eddd1dce183c4 (patch) | |
tree | 283fce94ff58babcb01ec26e196441feaf58504c /drivers/gpu/drm/i915/intel_display.c | |
parent | be71eabebaf9f142612d34d42292b454e984dcb5 (diff) |
drm/i915: Set M2_N2 registers during mode set
For Gen < 8, set M2_N2 registers on every mode set. This is required to make
sure M2_N2 registers are set during boot, resume from sleep for cross-
checking the state. The register is set only if DRRS is supported.
v2: Patch rebased
v3: Daniel's review comments
- Removed HAS_DRRS(dev) and added bool has_drrs to pipe_config to
track drrs support
v4: Jesse's review comments
- Made changes to set m2_n2 in intel_dp_set_m_n()
Signed-off-by: Vandana Kannan <vandana.kannan@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
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.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 018fb7222f60..acee1416eb93 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -91,11 +91,11 @@ static int intel_framebuffer_init(struct drm_device *dev, | |||
91 | struct intel_framebuffer *ifb, | 91 | struct intel_framebuffer *ifb, |
92 | struct drm_mode_fb_cmd2 *mode_cmd, | 92 | struct drm_mode_fb_cmd2 *mode_cmd, |
93 | struct drm_i915_gem_object *obj); | 93 | struct drm_i915_gem_object *obj); |
94 | static void intel_dp_set_m_n(struct intel_crtc *crtc); | ||
95 | static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc); | 94 | static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc); |
96 | static void intel_set_pipe_timings(struct intel_crtc *intel_crtc); | 95 | static void intel_set_pipe_timings(struct intel_crtc *intel_crtc); |
97 | static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, | 96 | static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, |
98 | struct intel_link_m_n *m_n); | 97 | struct intel_link_m_n *m_n, |
98 | struct intel_link_m_n *m2_n2); | ||
99 | static void ironlake_set_pipeconf(struct drm_crtc *crtc); | 99 | static void ironlake_set_pipeconf(struct drm_crtc *crtc); |
100 | static void haswell_set_pipeconf(struct drm_crtc *crtc); | 100 | static void haswell_set_pipeconf(struct drm_crtc *crtc); |
101 | static void intel_set_pipe_csc(struct drm_crtc *crtc); | 101 | static void intel_set_pipe_csc(struct drm_crtc *crtc); |
@@ -3980,7 +3980,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
3980 | 3980 | ||
3981 | if (intel_crtc->config.has_pch_encoder) { | 3981 | if (intel_crtc->config.has_pch_encoder) { |
3982 | intel_cpu_transcoder_set_m_n(intel_crtc, | 3982 | intel_cpu_transcoder_set_m_n(intel_crtc, |
3983 | &intel_crtc->config.fdi_m_n); | 3983 | &intel_crtc->config.fdi_m_n, NULL); |
3984 | } | 3984 | } |
3985 | 3985 | ||
3986 | ironlake_set_pipeconf(crtc); | 3986 | ironlake_set_pipeconf(crtc); |
@@ -4093,7 +4093,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc) | |||
4093 | 4093 | ||
4094 | if (intel_crtc->config.has_pch_encoder) { | 4094 | if (intel_crtc->config.has_pch_encoder) { |
4095 | intel_cpu_transcoder_set_m_n(intel_crtc, | 4095 | intel_cpu_transcoder_set_m_n(intel_crtc, |
4096 | &intel_crtc->config.fdi_m_n); | 4096 | &intel_crtc->config.fdi_m_n, NULL); |
4097 | } | 4097 | } |
4098 | 4098 | ||
4099 | haswell_set_pipeconf(crtc); | 4099 | haswell_set_pipeconf(crtc); |
@@ -5509,7 +5509,8 @@ static void intel_pch_transcoder_set_m_n(struct intel_crtc *crtc, | |||
5509 | } | 5509 | } |
5510 | 5510 | ||
5511 | static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, | 5511 | static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, |
5512 | struct intel_link_m_n *m_n) | 5512 | struct intel_link_m_n *m_n, |
5513 | struct intel_link_m_n *m2_n2) | ||
5513 | { | 5514 | { |
5514 | struct drm_device *dev = crtc->base.dev; | 5515 | struct drm_device *dev = crtc->base.dev; |
5515 | struct drm_i915_private *dev_priv = dev->dev_private; | 5516 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5521,6 +5522,18 @@ static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, | |||
5521 | I915_WRITE(PIPE_DATA_N1(transcoder), m_n->gmch_n); | 5522 | I915_WRITE(PIPE_DATA_N1(transcoder), m_n->gmch_n); |
5522 | I915_WRITE(PIPE_LINK_M1(transcoder), m_n->link_m); | 5523 | I915_WRITE(PIPE_LINK_M1(transcoder), m_n->link_m); |
5523 | I915_WRITE(PIPE_LINK_N1(transcoder), m_n->link_n); | 5524 | I915_WRITE(PIPE_LINK_N1(transcoder), m_n->link_n); |
5525 | /* M2_N2 registers to be set only for gen < 8 (M2_N2 available | ||
5526 | * for gen < 8) and if DRRS is supported (to make sure the | ||
5527 | * registers are not unnecessarily accessed). | ||
5528 | */ | ||
5529 | if (m2_n2 && INTEL_INFO(dev)->gen < 8 && | ||
5530 | crtc->config.has_drrs) { | ||
5531 | I915_WRITE(PIPE_DATA_M2(transcoder), | ||
5532 | TU_SIZE(m2_n2->tu) | m2_n2->gmch_m); | ||
5533 | I915_WRITE(PIPE_DATA_N2(transcoder), m2_n2->gmch_n); | ||
5534 | I915_WRITE(PIPE_LINK_M2(transcoder), m2_n2->link_m); | ||
5535 | I915_WRITE(PIPE_LINK_N2(transcoder), m2_n2->link_n); | ||
5536 | } | ||
5524 | } else { | 5537 | } else { |
5525 | I915_WRITE(PIPE_DATA_M_G4X(pipe), TU_SIZE(m_n->tu) | m_n->gmch_m); | 5538 | I915_WRITE(PIPE_DATA_M_G4X(pipe), TU_SIZE(m_n->tu) | m_n->gmch_m); |
5526 | I915_WRITE(PIPE_DATA_N_G4X(pipe), m_n->gmch_n); | 5539 | I915_WRITE(PIPE_DATA_N_G4X(pipe), m_n->gmch_n); |
@@ -5529,12 +5542,13 @@ static void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, | |||
5529 | } | 5542 | } |
5530 | } | 5543 | } |
5531 | 5544 | ||
5532 | static void intel_dp_set_m_n(struct intel_crtc *crtc) | 5545 | void intel_dp_set_m_n(struct intel_crtc *crtc) |
5533 | { | 5546 | { |
5534 | if (crtc->config.has_pch_encoder) | 5547 | if (crtc->config.has_pch_encoder) |
5535 | intel_pch_transcoder_set_m_n(crtc, &crtc->config.dp_m_n); | 5548 | intel_pch_transcoder_set_m_n(crtc, &crtc->config.dp_m_n); |
5536 | else | 5549 | else |
5537 | intel_cpu_transcoder_set_m_n(crtc, &crtc->config.dp_m_n); | 5550 | intel_cpu_transcoder_set_m_n(crtc, &crtc->config.dp_m_n, |
5551 | &crtc->config.dp_m2_n2); | ||
5538 | } | 5552 | } |
5539 | 5553 | ||
5540 | static void vlv_update_pll(struct intel_crtc *crtc) | 5554 | static void vlv_update_pll(struct intel_crtc *crtc) |