aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-04-25 12:29:05 -0400
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2019-05-13 06:45:51 -0400
commitda471250706e2f103a1627d1d279c9de44325993 (patch)
tree2b82a7909c03f9c7be112dac2d2d1dab31715914
parent396dd8143bdd94bd1c358a228a631c8c895a1126 (diff)
drm/i915: Fix fastset vs. pfit on/off on HSW EDP transcoder
On HSW the pipe A panel fitter lives inside the display power well, and the input MUX for the EDP transcoder needs to be configured appropriately to route the data through the power well as needed. Changing the MUX setting is not allowed while the pipe is active, so we need to force a full modeset whenever we need to change it. Currently we may end up doing a fastset which won't change the MUX settings, but it will drop the power well reference, and that kills the pipe. Cc: stable@vger.kernel.org Cc: Hans de Goede <hdegoede@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Fixes: d19f958db23c ("drm/i915: Enable fastset for non-boot modesets.") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190425162906.5242-1-ville.syrjala@linux.intel.com Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (cherry picked from commit 13b7648b7eab7e8259a2fb267b498bd9eba81ca0) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c9
-rw-r--r--drivers/gpu/drm/i915/intel_pipe_crc.c13
2 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3bd40a4a6739..5098228f1302 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12082,6 +12082,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
12082 struct intel_crtc_state *pipe_config, 12082 struct intel_crtc_state *pipe_config,
12083 bool adjust) 12083 bool adjust)
12084{ 12084{
12085 struct intel_crtc *crtc = to_intel_crtc(current_config->base.crtc);
12085 bool ret = true; 12086 bool ret = true;
12086 bool fixup_inherited = adjust && 12087 bool fixup_inherited = adjust &&
12087 (current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) && 12088 (current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
@@ -12303,6 +12304,14 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
12303 PIPE_CONF_CHECK_X(gmch_pfit.pgm_ratios); 12304 PIPE_CONF_CHECK_X(gmch_pfit.pgm_ratios);
12304 PIPE_CONF_CHECK_X(gmch_pfit.lvds_border_bits); 12305 PIPE_CONF_CHECK_X(gmch_pfit.lvds_border_bits);
12305 12306
12307 /*
12308 * Changing the EDP transcoder input mux
12309 * (A_ONOFF vs. A_ON) requires a full modeset.
12310 */
12311 if (IS_HASWELL(dev_priv) && crtc->pipe == PIPE_A &&
12312 current_config->cpu_transcoder == TRANSCODER_EDP)
12313 PIPE_CONF_CHECK_BOOL(pch_pfit.enabled);
12314
12306 if (!adjust) { 12315 if (!adjust) {
12307 PIPE_CONF_CHECK_I(pipe_src_w); 12316 PIPE_CONF_CHECK_I(pipe_src_w);
12308 PIPE_CONF_CHECK_I(pipe_src_h); 12317 PIPE_CONF_CHECK_I(pipe_src_h);
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index e94b5b1bc1b7..e7c7be4911c1 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -311,10 +311,17 @@ retry:
311 pipe_config->base.mode_changed = pipe_config->has_psr; 311 pipe_config->base.mode_changed = pipe_config->has_psr;
312 pipe_config->crc_enabled = enable; 312 pipe_config->crc_enabled = enable;
313 313
314 if (IS_HASWELL(dev_priv) && crtc->pipe == PIPE_A) { 314 if (IS_HASWELL(dev_priv) &&
315 pipe_config->base.active && crtc->pipe == PIPE_A &&
316 pipe_config->cpu_transcoder == TRANSCODER_EDP) {
317 bool old_need_power_well = pipe_config->pch_pfit.enabled ||
318 pipe_config->pch_pfit.force_thru;
319 bool new_need_power_well = pipe_config->pch_pfit.enabled ||
320 enable;
321
315 pipe_config->pch_pfit.force_thru = enable; 322 pipe_config->pch_pfit.force_thru = enable;
316 if (pipe_config->cpu_transcoder == TRANSCODER_EDP && 323
317 pipe_config->pch_pfit.enabled != enable) 324 if (old_need_power_well != new_need_power_well)
318 pipe_config->base.connectors_changed = true; 325 pipe_config->base.connectors_changed = true;
319 } 326 }
320 327