aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2014-11-13 12:51:47 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-14 05:28:04 -0500
commitbd2e244f847d8e8067afc30fa979b3968085cbb2 (patch)
treedb82d4687aad80baabe2a93c0798a7b0ee365641 /drivers/gpu/drm/i915/intel_display.c
parent830c81db2dc9dccc505adc7d4651324ea5332add (diff)
drm/i915/skl: fetch, enable/disable pfit as needed v2
This moved around on SKL, so we need to make sure we read/write the correct regs. v2: fixup WIN_POS offsets (Paulo) zero out WIN_POS reg at disable time (Paulo) Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuougseek.org> Signed-off-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.c62
1 files changed, 58 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8f47b988a233..c42a0401bfa5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4003,6 +4003,19 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
4003 } 4003 }
4004} 4004}
4005 4005
4006static void skylake_pfit_enable(struct intel_crtc *crtc)
4007{
4008 struct drm_device *dev = crtc->base.dev;
4009 struct drm_i915_private *dev_priv = dev->dev_private;
4010 int pipe = crtc->pipe;
4011
4012 if (crtc->config.pch_pfit.enabled) {
4013 I915_WRITE(PS_CTL(pipe), PS_ENABLE);
4014 I915_WRITE(PS_WIN_POS(pipe), crtc->config.pch_pfit.pos);
4015 I915_WRITE(PS_WIN_SZ(pipe), crtc->config.pch_pfit.size);
4016 }
4017}
4018
4006static void ironlake_pfit_enable(struct intel_crtc *crtc) 4019static void ironlake_pfit_enable(struct intel_crtc *crtc)
4007{ 4020{
4008 struct drm_device *dev = crtc->base.dev; 4021 struct drm_device *dev = crtc->base.dev;
@@ -4386,7 +4399,10 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
4386 4399
4387 intel_ddi_enable_pipe_clock(intel_crtc); 4400 intel_ddi_enable_pipe_clock(intel_crtc);
4388 4401
4389 ironlake_pfit_enable(intel_crtc); 4402 if (IS_SKYLAKE(dev))
4403 skylake_pfit_enable(intel_crtc);
4404 else
4405 ironlake_pfit_enable(intel_crtc);
4390 4406
4391 /* 4407 /*
4392 * On ILK+ LUT must be loaded before the pipe is running but with 4408 * On ILK+ LUT must be loaded before the pipe is running but with
@@ -4420,6 +4436,21 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
4420 intel_crtc_enable_planes(crtc); 4436 intel_crtc_enable_planes(crtc);
4421} 4437}
4422 4438
4439static void skylake_pfit_disable(struct intel_crtc *crtc)
4440{
4441 struct drm_device *dev = crtc->base.dev;
4442 struct drm_i915_private *dev_priv = dev->dev_private;
4443 int pipe = crtc->pipe;
4444
4445 /* To avoid upsetting the power well on haswell only disable the pfit if
4446 * it's in use. The hw state code will make sure we get this right. */
4447 if (crtc->config.pch_pfit.enabled) {
4448 I915_WRITE(PS_CTL(pipe), 0);
4449 I915_WRITE(PS_WIN_POS(pipe), 0);
4450 I915_WRITE(PS_WIN_SZ(pipe), 0);
4451 }
4452}
4453
4423static void ironlake_pfit_disable(struct intel_crtc *crtc) 4454static void ironlake_pfit_disable(struct intel_crtc *crtc)
4424{ 4455{
4425 struct drm_device *dev = crtc->base.dev; 4456 struct drm_device *dev = crtc->base.dev;
@@ -4532,7 +4563,10 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
4532 4563
4533 intel_ddi_disable_transcoder_func(dev_priv, cpu_transcoder); 4564 intel_ddi_disable_transcoder_func(dev_priv, cpu_transcoder);
4534 4565
4535 ironlake_pfit_disable(intel_crtc); 4566 if (IS_SKYLAKE(dev))
4567 skylake_pfit_disable(intel_crtc);
4568 else
4569 ironlake_pfit_disable(intel_crtc);
4536 4570
4537 intel_ddi_disable_pipe_clock(intel_crtc); 4571 intel_ddi_disable_pipe_clock(intel_crtc);
4538 4572
@@ -7547,6 +7581,22 @@ static void ironlake_get_fdi_m_n_config(struct intel_crtc *crtc,
7547 &pipe_config->fdi_m_n, NULL); 7581 &pipe_config->fdi_m_n, NULL);
7548} 7582}
7549 7583
7584static void skylake_get_pfit_config(struct intel_crtc *crtc,
7585 struct intel_crtc_config *pipe_config)
7586{
7587 struct drm_device *dev = crtc->base.dev;
7588 struct drm_i915_private *dev_priv = dev->dev_private;
7589 uint32_t tmp;
7590
7591 tmp = I915_READ(PS_CTL(crtc->pipe));
7592
7593 if (tmp & PS_ENABLE) {
7594 pipe_config->pch_pfit.enabled = true;
7595 pipe_config->pch_pfit.pos = I915_READ(PS_WIN_POS(crtc->pipe));
7596 pipe_config->pch_pfit.size = I915_READ(PS_WIN_SZ(crtc->pipe));
7597 }
7598}
7599
7550static void ironlake_get_pfit_config(struct intel_crtc *crtc, 7600static void ironlake_get_pfit_config(struct intel_crtc *crtc,
7551 struct intel_crtc_config *pipe_config) 7601 struct intel_crtc_config *pipe_config)
7552{ 7602{
@@ -8092,8 +8142,12 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
8092 intel_get_pipe_timings(crtc, pipe_config); 8142 intel_get_pipe_timings(crtc, pipe_config);
8093 8143
8094 pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe); 8144 pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
8095 if (intel_display_power_is_enabled(dev_priv, pfit_domain)) 8145 if (intel_display_power_is_enabled(dev_priv, pfit_domain)) {
8096 ironlake_get_pfit_config(crtc, pipe_config); 8146 if (IS_SKYLAKE(dev))
8147 skylake_get_pfit_config(crtc, pipe_config);
8148 else
8149 ironlake_get_pfit_config(crtc, pipe_config);
8150 }
8097 8151
8098 if (IS_HASWELL(dev)) 8152 if (IS_HASWELL(dev))
8099 pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) && 8153 pipe_config->ips_enabled = hsw_crtc_supports_ips(crtc) &&