Commit 7b713e9e authored by Mykola Lysenko's avatar Mykola Lysenko Committed by Greg Kroah-Hartman

drm/dp/mst: fix in MSTB RAD initialization

commit 75af4c8c upstream.

This fix is needed to support more then two
branch displays, so RAD address consist at
least of 2 elements
Acked-by: default avatarDave Airlie <airlied@gmail.com>
Signed-off-by: default avatarMykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15963151
...@@ -973,17 +973,17 @@ static struct drm_dp_mst_port *drm_dp_get_port(struct drm_dp_mst_branch *mstb, u ...@@ -973,17 +973,17 @@ static struct drm_dp_mst_port *drm_dp_get_port(struct drm_dp_mst_branch *mstb, u
static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port, static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port,
u8 *rad) u8 *rad)
{ {
int lct = port->parent->lct; int parent_lct = port->parent->lct;
int shift = 4; int shift = 4;
int idx = lct / 2; int idx = (parent_lct - 1) / 2;
if (lct > 1) { if (parent_lct > 1) {
memcpy(rad, port->parent->rad, idx); memcpy(rad, port->parent->rad, idx + 1);
shift = (lct % 2) ? 4 : 0; shift = (parent_lct % 2) ? 4 : 0;
} else } else
rad[0] = 0; rad[0] = 0;
rad[idx] |= port->port_num << shift; rad[idx] |= port->port_num << shift;
return lct + 1; return parent_lct + 1;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment