Skip to content

Commit 4f41071

Browse files
committed
drm/i915/dp_mst: Use intel_dp_mst_active_streams() instead of open-coding it
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
1 parent fa207d2 commit 4f41071

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5018,7 +5018,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
50185018

50195019
drm_dbg_kms(display->drm, "DPRX ESI: %4ph\n", esi);
50205020

5021-
if (intel_dp->mst.active_links > 0 && link_ok &&
5021+
if (intel_dp_mst_active_streams(intel_dp) > 0 && link_ok &&
50225022
esi[3] & LINK_STATUS_CHANGED) {
50235023
if (!intel_dp_mst_link_status(intel_dp))
50245024
link_ok = false;

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ static void mst_stream_disable(struct intel_atomic_state *state,
10281028
to_intel_connector(old_conn_state->connector);
10291029
enum transcoder trans = old_crtc_state->cpu_transcoder;
10301030

1031-
if (intel_dp->mst.active_links == 1)
1031+
if (intel_dp_mst_active_streams(intel_dp) == 1)
10321032
intel_dp->link.active = false;
10331033

10341034
intel_hdcp_disable(intel_mst->connector);
@@ -1144,7 +1144,7 @@ static void mst_stream_post_pll_disable(struct intel_atomic_state *state,
11441144
struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
11451145
struct intel_dp *intel_dp = to_primary_dp(encoder);
11461146

1147-
if (intel_dp->mst.active_links == 0 &&
1147+
if (intel_dp_mst_active_streams(intel_dp) == 0 &&
11481148
primary_encoder->post_pll_disable)
11491149
primary_encoder->post_pll_disable(state, primary_encoder, old_crtc_state, old_conn_state);
11501150
}
@@ -1157,7 +1157,7 @@ static void mst_stream_pre_pll_enable(struct intel_atomic_state *state,
11571157
struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
11581158
struct intel_dp *intel_dp = to_primary_dp(encoder);
11591159

1160-
if (intel_dp->mst.active_links == 0)
1160+
if (intel_dp_mst_active_streams(intel_dp) == 0)
11611161
primary_encoder->pre_pll_enable(state, primary_encoder,
11621162
pipe_config, NULL);
11631163
else
@@ -1303,7 +1303,7 @@ static void mst_stream_enable(struct intel_atomic_state *state,
13031303
struct drm_dp_mst_topology_state *mst_state =
13041304
drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst.mgr);
13051305
enum transcoder trans = pipe_config->cpu_transcoder;
1306-
bool first_mst_stream = intel_dp->mst.active_links == 1;
1306+
bool first_mst_stream = intel_dp_mst_active_streams(intel_dp) == 1;
13071307
struct intel_crtc *pipe_crtc;
13081308
int ret, i, min_hblank;
13091309

drivers/gpu/drm/i915/display/intel_hdcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "intel_display_power_well.h"
2525
#include "intel_display_rpm.h"
2626
#include "intel_display_types.h"
27+
#include "intel_dp_mst.h"
2728
#include "intel_hdcp.h"
2829
#include "intel_hdcp_gsc.h"
2930
#include "intel_hdcp_regs.h"
@@ -137,7 +138,7 @@ intel_hdcp_required_content_stream(struct intel_atomic_state *state,
137138
data->k++;
138139

139140
/* if there is only one active stream */
140-
if (dig_port->dp.mst.active_links <= 1)
141+
if (intel_dp_mst_active_streams(&dig_port->dp) <= 1)
141142
break;
142143
}
143144
drm_connector_list_iter_end(&conn_iter);

0 commit comments

Comments
 (0)