OSDN Git Service

drm/i915: Add hardware readout for FEC
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 25 Sep 2019 08:21:10 +0000 (10:21 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 25 Sep 2019 11:26:49 +0000 (13:26 +0200)
Readout the FEC state in encoder->get_config(), this will allow
us to ensure that we can correctly inherit the state from boot,
and that we set FEC during modeset.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190925082110.17439-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display.c

index 33cd766..14fe987 100644 (file)
@@ -4021,6 +4021,23 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
                pipe_config->lane_count =
                        ((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
                intel_dp_get_m_n(intel_crtc, pipe_config);
+
+               if (INTEL_GEN(dev_priv) >= 11) {
+                       i915_reg_t dp_tp_ctl;
+
+                       if (IS_GEN(dev_priv, 11))
+                               dp_tp_ctl = DP_TP_CTL(encoder->port);
+                       else
+                               dp_tp_ctl = TGL_DP_TP_CTL(pipe_config->cpu_transcoder);
+
+                       pipe_config->fec_enable =
+                               I915_READ(dp_tp_ctl) & DP_TP_CTL_FEC_ENABLE;
+
+                       DRM_DEBUG_KMS("[ENCODER:%d:%s] Fec status: %u\n",
+                                     encoder->base.base.id, encoder->base.name,
+                                     pipe_config->fec_enable);
+               }
+
                break;
        case TRANS_DDI_MODE_SELECT_DP_MST:
                pipe_config->output_types |= BIT(INTEL_OUTPUT_DP_MST);
index c4c9286..31698a5 100644 (file)
@@ -12836,6 +12836,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
        PIPE_CONF_CHECK_BOOL(hdmi_scrambling);
        PIPE_CONF_CHECK_BOOL(hdmi_high_tmds_clock_ratio);
        PIPE_CONF_CHECK_BOOL(has_infoframe);
+       PIPE_CONF_CHECK_BOOL(fec_enable);
 
        PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio);