drm/i915/dp: Remove unused DSC caps from intel_dp
authorImre Deak <imre.deak@intel.com>
Wed, 11 Oct 2023 17:16:06 +0000 (20:16 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 16 Oct 2023 14:01:58 +0000 (17:01 +0300)
The previous patches converted all users of the DSC DPCD caps to look
these up from the connector, so remove the version stored in intel_dp.

A follow-up patchset will read out the MST connector specific
capabilities in intel_dp_add_mst_connector() ->
intel_dp_mst_read_decompression_port_dsc_caps().

v2:
- Rebased on intel_edp_get_dsc_sink_cap() addition in the patchset.
v3:
- Rebased on read-out fix for eDP in the patchset.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-3-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp.h
drivers/gpu/drm/i915/display/intel_dp_mst.c

index d6600079bcf74dadc8715a375dceb0cc8738287a..65ea37fe8cff326aeb0180369c2185fc0290048f 100644 (file)
@@ -1725,10 +1725,8 @@ struct intel_dp {
        u8 psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
        u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
        u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
-       u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE];
        u8 lttpr_common_caps[DP_LTTPR_COMMON_CAP_SIZE];
        u8 lttpr_phy_caps[DP_MAX_LTTPR_COUNT][DP_LTTPR_PHY_CAP_SIZE];
-       u8 fec_capable;
        u8 pcon_dsc_dpcd[DP_PCON_DSC_ENCODER_CAP_SIZE];
        /* source rates */
        int num_source_rates;
index 54a9ac555f18277b4d97f05b1254d959ecfc95ed..d324204c1ce6f1ff87e1815e8783c1cb0db93d25 100644 (file)
@@ -3490,10 +3490,9 @@ static void intel_dp_read_dsc_dpcd(struct drm_dp_aux *aux,
                    dsc_dpcd);
 }
 
-void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_dp *intel_dp,
-                              struct intel_connector *connector)
+void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_connector *connector)
 {
-       struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+       struct drm_i915_private *i915 = to_i915(connector->base.dev);
 
        /*
         * Clear the cached register set to avoid using stale values
@@ -3518,27 +3517,14 @@ void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_dp *intel_dp,
 
        drm_dbg_kms(&i915->drm, "FEC CAPABILITY: %x\n",
                    connector->dp.fec_capability);
-
-       /*
-        * TODO: remove the following intel_dp copies once all users
-        * are converted to look up DSC DPCD/FEC capability via the
-        * connector.
-        */
-       memcpy(intel_dp->dsc_dpcd, connector->dp.dsc_dpcd,
-              sizeof(intel_dp->dsc_dpcd));
-       intel_dp->fec_capable = connector->dp.fec_capability;
 }
 
-static void intel_edp_get_dsc_sink_cap(u8 edp_dpcd_rev, struct intel_dp *intel_dp,
-                                      struct intel_connector *connector)
+static void intel_edp_get_dsc_sink_cap(u8 edp_dpcd_rev, struct intel_connector *connector)
 {
        if (edp_dpcd_rev < DP_EDP_14)
                return;
 
        intel_dp_read_dsc_dpcd(connector->dp.dsc_decompression_aux, connector->dp.dsc_dpcd);
-
-       memcpy(intel_dp->dsc_dpcd, connector->dp.dsc_dpcd,
-              sizeof(intel_dp->dsc_dpcd));
 }
 
 static void intel_edp_mso_mode_fixup(struct intel_connector *connector,
@@ -3710,7 +3696,6 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector
        /* Read the eDP DSC DPCD registers */
        if (HAS_DSC(dev_priv))
                intel_edp_get_dsc_sink_cap(intel_dp->edp_dpcd[0],
-                                          intel_dp,
                                           connector);
 
        /*
@@ -5390,10 +5375,10 @@ intel_dp_detect_dsc_caps(struct intel_dp *intel_dp, struct intel_connector *conn
 
        if (intel_dp_is_edp(intel_dp))
                intel_edp_get_dsc_sink_cap(intel_dp->edp_dpcd[0],
-                                          intel_dp, connector);
+                                          connector);
        else
                intel_dp_get_dsc_sink_cap(intel_dp->dpcd[DP_DPCD_REV],
-                                         intel_dp, connector);
+                                         connector);
 }
 
 static int
@@ -5427,11 +5412,6 @@ intel_dp_detect(struct drm_connector *connector,
 
        if (status == connector_status_disconnected) {
                memset(&intel_dp->compliance, 0, sizeof(intel_dp->compliance));
-               /*
-                * TODO: Remove clearing the DPCD in intel_dp, once all
-                * user are converted to using the DPCD in connector.
-                */
-               memset(intel_dp->dsc_dpcd, 0, sizeof(intel_dp->dsc_dpcd));
                memset(intel_connector->dp.dsc_dpcd, 0, sizeof(intel_connector->dp.dsc_dpcd));
 
                if (intel_dp->is_mst) {
index 51edb587e4d247a1f74afc776d77802abf413ca0..484aea215a251294d4494ea0782942c14a215b4d 100644 (file)
@@ -163,7 +163,6 @@ intel_dp_compute_config_link_bpp_limits(struct intel_dp *intel_dp,
                                        bool dsc,
                                        struct link_config_limits *limits);
 
-void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_dp *intel_dp,
-                              struct intel_connector *connector);
+void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_connector *connector);
 
 #endif /* __INTEL_DP_H__ */
index a065388c2199f1cdb0f062c296c862538ad04e63..47f1efb50ea26b68400a961b56fa3aad98050e6e 100644 (file)
@@ -1136,7 +1136,7 @@ intel_dp_mst_read_decompression_port_dsc_caps(struct intel_dp *intel_dp,
        if (drm_dp_read_dpcd_caps(connector->dp.dsc_decompression_aux, dpcd_caps) < 0)
                return;
 
-       intel_dp_get_dsc_sink_cap(dpcd_caps[DP_DPCD_REV], intel_dp, connector);
+       intel_dp_get_dsc_sink_cap(dpcd_caps[DP_DPCD_REV], connector);
 }
 
 static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,