From patchwork Tue Jul 20 16:03:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lin, Wayne" X-Patchwork-Id: 12388753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69CCAC636C9 for ; Tue, 20 Jul 2021 16:06:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 395F06100C for ; Tue, 20 Jul 2021 16:06:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 395F06100C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE3E86E459; Tue, 20 Jul 2021 16:06:21 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id EEACC6E45D for ; Tue, 20 Jul 2021 16:06:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kg7zCDULrDcI1VQ7v1MQmjAr7aqLAcHtrSJu3Uy7zQvyBt/DClsiFHagukPOsczxw1ca4W8gPYlbvOjj8a1V0VSoodVthHJJOYjbw5moJyAVTxC+W1jNKgtHxOGfnMgfyO9qjVkj4VeAD+KS+HDva0f4KNI0E6+3X/RQveomwImavEUxoA8vUC57zXMYidKskr7V6iQzKXNt0ZTPpvvgcYthNzTohbbeDCz8SjXljgloQNcDmuK6zxHLwScHFfyy/0cP0hFFPd+Ik8ZY2MzxwYDcGYddallHkgMAmy6iMr/bNFYZDQWvUNvF9OOmUABUB0QQepztWEztJNLJo/d2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GgRe0gwAxm8zAhn2oH+DKrNQWBlzFisJWCi9QjmF0L0=; b=JGhJugk54OZt/C0/F3Yq1Ub56OyUg0PCZ5fEbklKKSE/D09sR8cbHF8i1y3jD2uOp+3EgaNYKKEdAbSoVz/RU7Z0Ycq/NlaWwv5HMJVdEvr4Ynx36gs7vqIvt1FnTEXLUVGxj7iKYFkbBh/ziTFAsW6ijuesqgeKf1rfVlJeIFrrFOfdJYSBUiTa2Syv6yggo1dADwslbqcQ/x3SuhgOYTneodeSXD4aYVe6jvLyVjsrbwm5QQ8zYI9YkBpvU93Bi5sVNPz5fRyp3asniaQjCwoVF829/YOTz81eMDzXVbXnmfOgseEgSFHsSihLhARWGfBwL/H/m66zwTDkL+35jQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GgRe0gwAxm8zAhn2oH+DKrNQWBlzFisJWCi9QjmF0L0=; b=3QDVbMT+s7y6c/b2dVC8Dq6sGChss00/CTIQthk3tCryb9+ADUncimJCIKHMptK8kGzUz9Mli5C84OoBvkBWGziml96IyF7IU1eJfMZ806q9lqZAEyuq+QfmP77ACo4sDa6QO1F+KCxb4MqNO8ReOn1ThuDAy6ERP30RyqUpEu4= Received: from BN0PR03CA0049.namprd03.prod.outlook.com (2603:10b6:408:e7::24) by BL0PR12MB2482.namprd12.prod.outlook.com (2603:10b6:207:4a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Tue, 20 Jul 2021 16:06:10 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::2e) by BN0PR03CA0049.outlook.office365.com (2603:10b6:408:e7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Tue, 20 Jul 2021 16:06:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4352.24 via Frontend Transport; Tue, 20 Jul 2021 16:06:10 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 20 Jul 2021 11:06:05 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 20 Jul 2021 09:06:04 -0700 Received: from wayne-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2242.4 via Frontend Transport; Tue, 20 Jul 2021 11:05:53 -0500 From: Wayne Lin To: Subject: [PATCH 2/4] drm/dp_mst: Only create connector for connected end device Date: Wed, 21 Jul 2021 00:03:40 +0800 Message-ID: <20210720160342.11415-3-Wayne.Lin@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720160342.11415-1-Wayne.Lin@amd.com> References: <20210720160342.11415-1-Wayne.Lin@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49015f0e-f2e1-4f6d-8aa6-08d94b984a3c X-MS-TrafficTypeDiagnostic: BL0PR12MB2482: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gADEMcPxn1UnejJ5OE5GgmoxzRJ6BeCWQcSCsPdge5bHDOTCIOdC3gG77iOicdRFtfSzREvFyOyQfxJDnwYOrB/WWJwU0W4DCpmKD2xX9k3Sd0+TTYb8gtphgBSI0edqLQJXIbrFmeS8U0ZX9f+7INieqJ2tpzcV10CxQffjq5QOOuMOHxpeXeSo7U27EsYb0C033LD8x8+Q/Ku0+rai60usenrsBXfKTNtxVtL1NApmm0PoMIZD4e/Tx8UhjTAHi0EmwR8qBDfAiA8RE2xgxi/zDYdK2YiSLqH5qLOKciqdYsx2FXevqqjMIHhp3KzuF7nf0yLwPCgJ1n0iffOzvm/beBPAKf38frclhnm03W89WxiPTl6OdmjmwQfpyqNTufIQLLw36YXRuBwezkwaQ/KIqa98MBB5ccFGu/+AXilWoQMThagQ/IDwB98oG3F+XAzFUs6QrIpLJnW6BVOKwsHYyiBcPG3cZjwNiRuTcsjOIvOP36PbTIR4QADlnrjUzszATy/jsF4+sRzz5EXMWYIcTsfOaRaaIhd37P3oyfeThiEfsk1zT36QglC70DnzgY6GifteBC/G7pt9MKC8LZwisQGZ3hU4v33zacdK8aLyJMN1rFOzuE9VoX3uIwpmqSrbkmWm67UHZOvnE6iR3Sxo86d6SsYC3euph6xeDWX7TjWruOYVJBCpqPZeTL+CluSlrXKrkWYh9kRdob+CpatXOPcgFl4aiRTK3U8LaLM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(396003)(136003)(46966006)(36840700001)(356005)(1076003)(83380400001)(478600001)(36860700001)(26005)(82740400003)(186003)(316002)(426003)(6666004)(7416002)(336012)(81166007)(8936002)(2906002)(86362001)(2616005)(36756003)(4326008)(5660300002)(66574015)(6916009)(54906003)(47076005)(82310400003)(7696005)(70206006)(8676002)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2021 16:06:10.1699 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49015f0e-f2e1-4f6d-8aa6-08d94b984a3c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2482 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= , Harry Wentland , Rodrigo Siqueira , jerry.zuo@amd.com, Aurabindo Pillai , Ben Skeggs , Ankit Nautiyal , Juston Li , Thomas Zimmermann , Jani Nikula , Wayne Lin , Nikola Cornij , hersenxs.wu@amd.com, Sean Paul , Eryk Brol , stable@vger.kernel.org, Manasi Navare , Alex Deucher , Sean Paul , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [Why] Currently, we will create connectors for all output ports no matter it's connected or not. However, in MST, we can only determine whether an output port really stands for a "connector" till it is connected and check its peer device type as an end device. In current code, we have chance to create connectors for output ports connected with branch device and these are redundant connectors. e.g. StarTech 1-to-4 DP hub is constructed by internal 2 layer 1-to-2 branch devices. Creating connectors for such internal output ports are redundant. [How] Put constraint on creating connector for connected end device only. Fixes: 6f85f73821f6 ("drm/dp_mst: Add basic topology reprobing when resuming") Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Cc: Daniel Vetter Cc: Sean Paul Cc: Lyude Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Alex Deucher Cc: Nicholas Kazlauskas Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Eryk Brol Cc: Bas Nieuwenhuizen Cc: Nikola Cornij Cc: Wayne Lin Cc: "Ville Syrjälä" Cc: Jani Nikula Cc: Manasi Navare Cc: Ankit Nautiyal Cc: "José Roberto de Souza" Cc: Sean Paul Cc: Ben Skeggs Cc: dri-devel@lists.freedesktop.org Cc: # v5.5+ Signed-off-by: Wayne Lin --- drivers/gpu/drm/drm_dp_mst_topology.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 51cd7f74f026..f13c7187b07f 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2474,7 +2474,8 @@ drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb, if (port->connector) drm_modeset_unlock(&mgr->base.lock); - else if (!port->input) + else if (!port->input && port->pdt != DP_PEER_DEVICE_NONE && + drm_dp_mst_is_end_device(port->pdt, port->mcs)) drm_dp_mst_port_add_connector(mstb, port); if (send_link_addr && port->mstb) { @@ -2557,6 +2558,10 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, dowork = false; } + if (!port->input && !port->connector && new_pdt != DP_PEER_DEVICE_NONE && + drm_dp_mst_is_end_device(new_pdt, new_mcs)) + create_connector = true; + if (port->connector) drm_modeset_unlock(&mgr->base.lock); else if (create_connector)