Skip to content

Commit ca5d9d7

Browse files
committed
drm/dp_mst: Factor out drm_dp_mst_port_is_logical()
Factor out a function to check if an MST port is logical, used by a follow-up i915 patch in the patchset. v2: Move drm_dp_mst_aux_for_parent() forward declaration to the next patch. (Ankit) Cc: Lyude Paul <[email protected]> Cc: [email protected] Reviewed-by: Ankit Nautiyal <[email protected]> Acked-by: Maarten Lankhorst <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8976bf1 commit ca5d9d7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb,
22742274

22752275
if (port->pdt != DP_PEER_DEVICE_NONE &&
22762276
drm_dp_mst_is_end_device(port->pdt, port->mcs) &&
2277-
port->port_num >= DP_MST_LOGICAL_PORT_0)
2277+
drm_dp_mst_port_is_logical(port))
22782278
port->cached_edid = drm_edid_read_ddc(port->connector,
22792279
&port->aux.ddc);
22802280

@@ -4219,7 +4219,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
42194219
case DP_PEER_DEVICE_SST_SINK:
42204220
ret = connector_status_connected;
42214221
/* for logical ports - cache the EDID */
4222-
if (port->port_num >= DP_MST_LOGICAL_PORT_0 && !port->cached_edid)
4222+
if (drm_dp_mst_port_is_logical(port) && !port->cached_edid)
42234223
port->cached_edid = drm_edid_read_ddc(connector, &port->aux.ddc);
42244224
break;
42254225
case DP_PEER_DEVICE_DP_LEGACY_CONV:
@@ -5983,7 +5983,7 @@ static bool drm_dp_mst_is_virtual_dpcd(struct drm_dp_mst_port *port)
59835983
return false;
59845984

59855985
/* Virtual DP Sink (Internal Display Panel) */
5986-
if (port->port_num >= 8)
5986+
if (drm_dp_mst_port_is_logical(port))
59875987
return true;
59885988

59895989
/* DP-to-HDMI Protocol Converter */

include/drm/display/drm_dp_mst_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,12 @@ int __must_check drm_dp_mst_root_conn_atomic_check(struct drm_connector_state *n
949949
void drm_dp_mst_get_port_malloc(struct drm_dp_mst_port *port);
950950
void drm_dp_mst_put_port_malloc(struct drm_dp_mst_port *port);
951951

952+
static inline
953+
bool drm_dp_mst_port_is_logical(struct drm_dp_mst_port *port)
954+
{
955+
return port->port_num >= DP_MST_LOGICAL_PORT_0;
956+
}
957+
952958
struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port);
953959

954960
static inline struct drm_dp_mst_topology_state *

0 commit comments

Comments
 (0)