• Wayne Lin's avatar
    drm/dp_mst: Handle SST-only branch device case · db1a0795
    Wayne Lin authored
    [Why]
    While handling LINK_ADDRESS reply, current code expects a peer device
    can handle sideband message once the peer device type is reported as
    DP_PEER_DEVICE_MST_BRANCHING. However, when the connected device is
    a SST branch case, it can't handle the sideband message(MST_CAP=0 in
    DPCD 00021h).
    
    Current code will try to send LINK_ADDRESS to SST branch device and end
    up with message timeout and monitor can't display normally. As the
    result of that, we should take SST branch device into account.
    
    [How]
    According to DP 1.4 spec, we can use Peer_Device_Type as
    DP_PEER_DEVICE_MST_BRANCHING and Message_Capability_Status as 0 to
    indicate peer device as a SST-only branch device.
    
    Fix following:
    - Add the function drm_dp_mst_is_dp_mst_end_device() to decide whether a
    peer device connected to a DFP is mst end device. Which also indicates
    if the peer device is capable of handling message or not.
    - Take SST-only branch device case into account in
    drm_dp_port_set_pdt() and add a new parameter 'new_mcs'. Take sst branch
    device case as the same case as DP_PEER_DEVICE_DP_LEGACY_CONV and
    DP_PEER_DEVICE_SST_SINK. All original handling logics remain.
    - Take SST-only branch device case into account in
    drm_dp_mst_port_add_connector().
    - Fix some parts in drm_dp_mst_handle_link_address_port() to have SST
    branch device case into consideration.
    - Fix the arguments of drm_dp_port_set_pdt() in
    drm_dp_mst_handle_conn_stat().
    - Have SST branch device also report
    connector_status_connected when the ddps is true
    in drm_dp_mst_detect_port()
    - Fix the arguments of drm_dp_port_set_pdt() in
    drm_dp_delayed_destroy_port()
    
    Changes since v1:(https://patchwork.kernel.org/patch/11323079/)
    * Squash previous patch into one patch and merge the commit message here.
    * Combine the if statements mentioned in comments
    
    Fixes: c485e2c9 ("drm/dp_mst: Refactor pdt setup/teardown, add more locking")
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Harry Wentland <hwentlan@amd.com>
    Cc: Lyude Paul <lyude@redhat.com>
    Signed-off-by: default avatarWayne Lin <Wayne.Lin@amd.com>
    Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200117060350.26358-2-Wayne.Lin@amd.com
    db1a0795
drm_dp_mst_topology.c 137 KB