Skip to content

Commit fa207d2

Browse files
committed
drm/i915/dp_mst: Rename intel_dp_mst_encoder_active_links() to intel_dp_mst_active_streams()
It's not clear which encoder intel_dp_mst_encoder_active_links() refers to (primary/stream), but there is also no reason to call the queried property an encoder property; remove encoder from the name. Also it's the number of MST streams being queried, vs. the number of MST links (there is one MST link carrying one or more MST streams), so rename link to stream as well. While at it pass intel_dp to the function, which is more logical and makes it easier to re-use the function later (without the need to get the digital port pointer). Also move the function earlier, next to the related ones. 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-5-imre.deak@intel.com
1 parent 39abe4a commit fa207d2

4 files changed

Lines changed: 20 additions & 21 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
877877
encoder->base.base.id, encoder->base.name);
878878

879879
if (!mst_pipe_mask && dp128b132b_pipe_mask) {
880-
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
880+
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
881881

882882
/*
883883
* If we don't have 8b/10b MST, but have more than one
@@ -890,7 +890,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
890890
* can assume it's SST.
891891
*/
892892
if (hweight8(dp128b132b_pipe_mask) > 1 ||
893-
intel_dp_mst_encoder_active_links(dig_port))
893+
intel_dp_mst_active_streams(intel_dp))
894894
mst_pipe_mask = dp128b132b_pipe_mask;
895895
}
896896

@@ -4109,13 +4109,13 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
41094109
} else if (ddi_mode == TRANS_DDI_MODE_SELECT_DP_MST) {
41104110
intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
41114111
} else if (ddi_mode == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B && HAS_DP20(display)) {
4112-
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
4112+
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
41134113

41144114
/*
41154115
* If this is true, we know we're being called from mst stream
41164116
* encoder's ->get_config().
41174117
*/
4118-
if (intel_dp_mst_encoder_active_links(dig_port))
4118+
if (intel_dp_mst_active_streams(intel_dp))
41194119
intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
41204120
else
41214121
intel_ddi_read_func_ctl_dp_sst(encoder, pipe_config, ddi_func_ctl);

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ static struct intel_dp *to_primary_dp(struct intel_encoder *encoder)
105105
return &dig_port->dp;
106106
}
107107

108+
int intel_dp_mst_active_streams(struct intel_dp *intel_dp)
109+
{
110+
return intel_dp->mst.active_links;
111+
}
112+
108113
static bool intel_dp_mst_dec_active_streams(struct intel_dp *intel_dp)
109114
{
110115
struct intel_display *display = to_intel_display(intel_dp);
@@ -1887,12 +1892,6 @@ mst_stream_encoders_create(struct intel_digital_port *dig_port)
18871892
return true;
18881893
}
18891894

1890-
int
1891-
intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port)
1892-
{
1893-
return dig_port->dp.mst.active_links;
1894-
}
1895-
18961895
int
18971896
intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_base_id)
18981897
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct intel_link_bw_limits;
1818

1919
int intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_id);
2020
void intel_dp_mst_encoder_cleanup(struct intel_digital_port *dig_port);
21-
int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
21+
int intel_dp_mst_active_streams(struct intel_dp *intel_dp);
2222
bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
2323
bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
2424
bool intel_dp_mst_source_support(struct intel_dp *intel_dp);

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,28 +1547,28 @@ void intel_tc_port_init_mode(struct intel_digital_port *dig_port)
15471547
mutex_unlock(&tc->lock);
15481548
}
15491549

1550-
static bool tc_port_has_active_links(struct intel_tc_port *tc,
1551-
const struct intel_crtc_state *crtc_state)
1550+
static bool tc_port_has_active_streams(struct intel_tc_port *tc,
1551+
const struct intel_crtc_state *crtc_state)
15521552
{
15531553
struct intel_display *display = to_intel_display(tc->dig_port);
15541554
struct intel_digital_port *dig_port = tc->dig_port;
15551555
enum icl_port_dpll_id pll_type = ICL_PORT_DPLL_DEFAULT;
1556-
int active_links = 0;
1556+
int active_streams = 0;
15571557

15581558
if (dig_port->dp.is_mst) {
15591559
/* TODO: get the PLL type for MST, once HW readout is done for it. */
1560-
active_links = intel_dp_mst_encoder_active_links(dig_port);
1560+
active_streams = intel_dp_mst_active_streams(&dig_port->dp);
15611561
} else if (crtc_state && crtc_state->hw.active) {
15621562
pll_type = intel_ddi_port_pll_type(&dig_port->base, crtc_state);
1563-
active_links = 1;
1563+
active_streams = 1;
15641564
}
15651565

1566-
if (active_links && !tc_phy_is_connected(tc, pll_type))
1566+
if (active_streams && !tc_phy_is_connected(tc, pll_type))
15671567
drm_err(display->drm,
1568-
"Port %s: PHY disconnected with %d active link(s)\n",
1569-
tc->port_name, active_links);
1568+
"Port %s: PHY disconnected with %d active stream(s)\n",
1569+
tc->port_name, active_streams);
15701570

1571-
return active_links;
1571+
return active_streams;
15721572
}
15731573

15741574
/**
@@ -1592,7 +1592,7 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
15921592
mutex_lock(&tc->lock);
15931593

15941594
drm_WARN_ON(display->drm, tc->link_refcount != 1);
1595-
if (!tc_port_has_active_links(tc, crtc_state)) {
1595+
if (!tc_port_has_active_streams(tc, crtc_state)) {
15961596
/*
15971597
* TBT-alt is the default mode in any case the PHY ownership is not
15981598
* held (regardless of the sink's connected live state), so

0 commit comments

Comments
 (0)