]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp: Rename intel_dp::link_trained to link.active
authorImre Deak <imre.deak@intel.com>
Fri, 4 Apr 2025 15:03:05 +0000 (18:03 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 7 Apr 2025 13:24:59 +0000 (16:24 +0300)
The intel_dp::link_trained flag indicates whether the link is active,
regardless of whether the link training passed or failed. For clarity
rename the flag to 'active'. While at it move the flag under
intel_dp::link.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250404150310.1156696-2-imre.deak@intel.com
drivers/gpu/drm/i915/display/g4x_dp.c
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp_link_training.c
drivers/gpu/drm/i915/display/intel_dp_mst.c

index 55b9e9bfcc4d06770a7820f79187d1e5d23e0fec..b39aae9165df6102becd3ba338d7e6c86919f14a 100644 (file)
@@ -519,7 +519,7 @@ static void intel_disable_dp(struct intel_atomic_state *state,
 {
        struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 
-       intel_dp->link_trained = false;
+       intel_dp->link.active = false;
 
        /*
         * Make sure the panel is off before trying to change the mode.
index 56068b2ef964a8a4d74112f909645b2ec3543baa..f381ceb59c7d4ec3c7c2cc529ff878c5e2769903 100644 (file)
@@ -3550,7 +3550,7 @@ static void intel_ddi_disable_dp(struct intel_atomic_state *state,
        struct intel_connector *connector =
                to_intel_connector(old_conn_state->connector);
 
-       intel_dp->link_trained = false;
+       intel_dp->link.active = false;
 
        intel_psr_disable(intel_dp, old_crtc_state);
        intel_edp_backlight_off(old_conn_state);
index 367b53a9eae2ab7ab126d80ae9f635c6a2471fbd..769e3a48d9c5e0b12e635d8f01ad46c5785ce7f6 100644 (file)
@@ -1658,7 +1658,6 @@ struct intel_dp {
        int link_rate;
        u8 lane_count;
        u8 sink_count;
-       bool link_trained;
        bool needs_modeset_retry;
        bool use_max_params;
        u8 dpcd[DP_RECEIVER_CAP_SIZE];
@@ -1683,6 +1682,7 @@ struct intel_dp {
        int common_rates[DP_MAX_SUPPORTED_RATES];
        struct {
                /* TODO: move the rest of link specific fields to here */
+               bool active;
                /* common rate,lane_count configs in bw order */
                int num_configs;
 #define INTEL_DP_MAX_LANE_COUNT                        4
index 7b95d62730e6f0c27c07fb59f16476369c4762a4..df8c86fd133e2abd8fbdccc6c4114018de99b8fe 100644 (file)
@@ -3222,7 +3222,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
                              int link_rate, int lane_count)
 {
        memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
-       intel_dp->link_trained = false;
+       intel_dp->link.active = false;
        intel_dp->needs_modeset_retry = false;
        intel_dp->link_rate = link_rate;
        intel_dp->lane_count = lane_count;
@@ -3586,7 +3586,7 @@ void intel_dp_sync_state(struct intel_encoder *encoder,
        if (crtc_state) {
                intel_dp_reset_link_params(intel_dp);
                intel_dp_set_link_params(intel_dp, crtc_state->port_clock, crtc_state->lane_count);
-               intel_dp->link_trained = true;
+               intel_dp->link.active = true;
        }
 }
 
@@ -5081,7 +5081,7 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
 {
        u8 link_status[DP_LINK_STATUS_SIZE];
 
-       if (!intel_dp->link_trained)
+       if (!intel_dp->link.active)
                return false;
 
        /*
index 53480914f2394811e636dcd61dfffc860b869e21..6efdd629330242794a183f665c26f0d8515c59d7 100644 (file)
@@ -168,7 +168,7 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_
         * resetting its internal state when the mode is changed from
         * non-transparent to transparent.
         */
-       if (intel_dp->link_trained) {
+       if (intel_dp->link.active) {
                if (lttpr_count < 0 || intel_dp_lttpr_transparent_mode_enabled(intel_dp))
                        goto out_reset_lttpr_count;
 
@@ -1142,7 +1142,7 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
        struct intel_display *display = to_intel_display(intel_dp);
        struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
 
-       intel_dp->link_trained = true;
+       intel_dp->link.active = true;
 
        intel_dp_disable_dpcd_training_pattern(intel_dp, DP_PHY_DPRX);
        intel_dp_program_link_training_pattern(intel_dp, crtc_state, DP_PHY_DPRX,
@@ -1735,7 +1735,7 @@ static int i915_dp_force_link_rate_show(struct seq_file *m, void *data)
        if (err)
                return err;
 
-       if (intel_dp->link_trained)
+       if (intel_dp->link.active)
                current_rate = intel_dp->link_rate;
        force_rate = intel_dp->link.force_rate;
 
@@ -1833,7 +1833,7 @@ static int i915_dp_force_lane_count_show(struct seq_file *m, void *data)
        if (err)
                return err;
 
-       if (intel_dp->link_trained)
+       if (intel_dp->link.active)
                current_lane_count = intel_dp->lane_count;
        force_lane_count = intel_dp->link.force_lane_count;
 
index d2988b9a6e7bd55d2ea4d34230c4d017e1f4cc93..325c2a0346553ee520767b7831afe587c9b2c1f4 100644 (file)
@@ -1004,7 +1004,7 @@ static void mst_stream_disable(struct intel_atomic_state *state,
                    intel_dp->mst.active_links);
 
        if (intel_dp->mst.active_links == 1)
-               intel_dp->link_trained = false;
+               intel_dp->link.active = false;
 
        intel_hdcp_disable(intel_mst->connector);
 
@@ -2108,7 +2108,7 @@ void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp)
        u8 rate_select;
        u8 link_bw;
 
-       if (intel_dp->link_trained)
+       if (intel_dp->link.active)
                return;
 
        if (intel_mst_probed_link_params_valid(intel_dp, link_rate, lane_count))