]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp_mst: Use intel_dp_mst_active_streams() instead of open-coding it
authorImre Deak <imre.deak@intel.com>
Fri, 4 Apr 2025 15:03:09 +0000 (18:03 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 7 Apr 2025 13:25:28 +0000 (16:25 +0300)
Use intel_dp_mst_active_streams() everywhere, instead of open-coding it.

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-6-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp_mst.c
drivers/gpu/drm/i915/display/intel_hdcp.c

index aae944183d11106a179b1be16af10851b70edf76..aeb14a5455fd1d02ecf3dd910bf71ad860b3cd0b 100644 (file)
@@ -5018,7 +5018,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
 
                drm_dbg_kms(display->drm, "DPRX ESI: %4ph\n", esi);
 
-               if (intel_dp->mst.active_links > 0 && link_ok &&
+               if (intel_dp_mst_active_streams(intel_dp) > 0 && link_ok &&
                    esi[3] & LINK_STATUS_CHANGED) {
                        if (!intel_dp_mst_link_status(intel_dp))
                                link_ok = false;
index 2a4bbe692558dcfe26a6f26f6390ca713653b7b5..9ae025ace3c0d7d013efcbd12cd7e6b32eb49ab1 100644 (file)
@@ -1028,7 +1028,7 @@ static void mst_stream_disable(struct intel_atomic_state *state,
                to_intel_connector(old_conn_state->connector);
        enum transcoder trans = old_crtc_state->cpu_transcoder;
 
-       if (intel_dp->mst.active_links == 1)
+       if (intel_dp_mst_active_streams(intel_dp) == 1)
                intel_dp->link.active = false;
 
        intel_hdcp_disable(intel_mst->connector);
@@ -1144,7 +1144,7 @@ static void mst_stream_post_pll_disable(struct intel_atomic_state *state,
        struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
        struct intel_dp *intel_dp = to_primary_dp(encoder);
 
-       if (intel_dp->mst.active_links == 0 &&
+       if (intel_dp_mst_active_streams(intel_dp) == 0 &&
            primary_encoder->post_pll_disable)
                primary_encoder->post_pll_disable(state, primary_encoder, old_crtc_state, old_conn_state);
 }
@@ -1157,7 +1157,7 @@ static void mst_stream_pre_pll_enable(struct intel_atomic_state *state,
        struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
        struct intel_dp *intel_dp = to_primary_dp(encoder);
 
-       if (intel_dp->mst.active_links == 0)
+       if (intel_dp_mst_active_streams(intel_dp) == 0)
                primary_encoder->pre_pll_enable(state, primary_encoder,
                                                pipe_config, NULL);
        else
@@ -1303,7 +1303,7 @@ static void mst_stream_enable(struct intel_atomic_state *state,
        struct drm_dp_mst_topology_state *mst_state =
                drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst.mgr);
        enum transcoder trans = pipe_config->cpu_transcoder;
-       bool first_mst_stream = intel_dp->mst.active_links == 1;
+       bool first_mst_stream = intel_dp_mst_active_streams(intel_dp) == 1;
        struct intel_crtc *pipe_crtc;
        int ret, i, min_hblank;
 
index 72a43ef6e4d2a6360c248d1b806db7d27fbc3bb3..411f17655f89583ec83965de7401952afcce4e9b 100644 (file)
@@ -24,6 +24,7 @@
 #include "intel_display_power_well.h"
 #include "intel_display_rpm.h"
 #include "intel_display_types.h"
+#include "intel_dp_mst.h"
 #include "intel_hdcp.h"
 #include "intel_hdcp_gsc.h"
 #include "intel_hdcp_regs.h"
@@ -137,7 +138,7 @@ intel_hdcp_required_content_stream(struct intel_atomic_state *state,
                data->k++;
 
                /* if there is only one active stream */
-               if (dig_port->dp.mst.active_links <= 1)
+               if (intel_dp_mst_active_streams(&dig_port->dp) <= 1)
                        break;
        }
        drm_connector_list_iter_end(&conn_iter);