From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754411AbcCBAiK (ORCPT ); Tue, 1 Mar 2016 19:38:10 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:43800 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756212AbcCAX5H (ORCPT ); Tue, 1 Mar 2016 18:57:07 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=Y9kKuUWGMIM35U8wyE+ZvwqX20Kaz9C4PR2Zx9sS52p072jOzrPhlLd2c8r5ML3/8DQZSkOyD7Ql pEc0c8IUv30KswFIoXoGEbEVl8gTLXMjvuLgdMluS+Ap5ULRoymeqjJtI3FmkayEpVJzzk6t/Syo sXQvSwmU+fV8IkdOqfw=; From: Greg Kroah-Hartman Subject: [PATCH 4.4 198/342] drm/dp/mst: fix in MSTB RAD initialization X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Dave Airlie , Mykola Lysenko , Alex Deucher Message-Id: <20160301234534.324647529@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.69c392874efe40ffa7a32583ed62ff71 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:54:50 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mykola Lysenko commit 75af4c8c4c0f60d7ad135419805798f144e9baf9 upstream. This fix is needed to support more then two branch displays, so RAD address consist at least of 2 elements Acked-by: Dave Airlie Signed-off-by: Mykola Lysenko Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -973,17 +973,17 @@ static struct drm_dp_mst_port *drm_dp_ge static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port, u8 *rad) { - int lct = port->parent->lct; + int parent_lct = port->parent->lct; int shift = 4; - int idx = lct / 2; - if (lct > 1) { - memcpy(rad, port->parent->rad, idx); - shift = (lct % 2) ? 4 : 0; + int idx = (parent_lct - 1) / 2; + if (parent_lct > 1) { + memcpy(rad, port->parent->rad, idx + 1); + shift = (parent_lct % 2) ? 4 : 0; } else rad[0] = 0; rad[idx] |= port->port_num << shift; - return lct + 1; + return parent_lct + 1; } /*