From patchwork Thu Jul 4 19:05:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FD3914C0 for ; Thu, 4 Jul 2019 19:06:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10F6528A78 for ; Thu, 4 Jul 2019 19:06:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0289928A7E; Thu, 4 Jul 2019 19:06:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B38F528A78 for ; Thu, 4 Jul 2019 19:06:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F08C46E3B5; Thu, 4 Jul 2019 19:06:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780058.outbound.protection.outlook.com [40.107.78.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 44D626E3B5; Thu, 4 Jul 2019 19:06:24 +0000 (UTC) Received: from BN8PR12CA0009.namprd12.prod.outlook.com (2603:10b6:408:60::22) by DM5PR12MB1852.namprd12.prod.outlook.com (2603:10b6:3:10a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:22 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN8PR12CA0009.outlook.office365.com (2603:10b6:408:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17 via Frontend Transport; Thu, 4 Jul 2019 19:06:21 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:21 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:20 -0500 From: To: , Subject: [PATCH 01/10] drm/dp: Use non-cyclic idr Date: Thu, 4 Jul 2019 15:05:10 -0400 Message-ID: <20190704190519.29525-2-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(39860400002)(346002)(376002)(2980300002)(428003)(199004)(189003)(68736007)(446003)(36756003)(476003)(26005)(6666004)(5660300002)(76176011)(8936002)(77096007)(486006)(478600001)(50466002)(316002)(2616005)(86362001)(23676004)(110136005)(426003)(126002)(49486002)(72206003)(5820100001)(8676002)(356004)(2906002)(186003)(70586007)(336012)(11346002)(14444005)(50226002)(47776003)(1076003)(2876002)(4326008)(54906003)(81156014)(81166006)(2870700001)(70206006)(66574012)(53936002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1852; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6892a305-7729-4292-1894-08d700b2b3bf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1852; X-MS-TrafficTypeDiagnostic: DM5PR12MB1852: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: UmjOEadb8s0L+6OwmO6YXszMwGid9XNxXmKrNl/SOQFC3IR9GkKY50X6CMiim9SbFoBD0XGD4qkk7TraG+AOzfu15Z2c1Z+yjuK0CEjANZPGOmcRmYqDRS9fqB8lHqqJ5OVrVh8T41Ae7RZk9Y1HqZ8G8uMFJxuOFGeflt2mq+FrUx9/0/bWCdCEEobeg1VBNqC/1vuBwNiRELzu7AKj79GIqltNyB6y2XCwflXFOK5PeeaiqgIZgDAy2/3AvCzXgkWBLng3t0YsCJC+877PSCCglXmuax7wTTSrbvit05CQrvMogYnrZo0B8HJvASvHCijdg/1AUC3V/FYQ+cvoRRvK0+oEGRK6Zf+/VeFw6t4DGbNm+a9MtUnCGtViq31oact+IH8KPBg0719ep7Nzpwg8f1Itlq1gSZIovYFpJKc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:21.3553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6892a305-7729-4292-1894-08d700b2b3bf 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1852 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RcOTIf1WkUWAphJpw2lNi7ztg9ovrY4DeQuZcH+CWwk=; b=lktTXA/ix6eMeEXnMDtNs5pUmXUNr849SG+Shcc+LxjNVm7q57mfEER9G5Wi9kTa3OyQClwOZErT2VhmfWh7WEb5wdFDX6oPshhxEQJ/DSnQlwOlGzE/SwyD5IHF995wBBLoMvzITnphMDQ3QAEvahkheTQgJD9CV+yTDP+KGY8= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Lyude Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_aux_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 5be28e3295f3..26e38dacf654 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -82,8 +82,7 @@ static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) kref_init(&aux_dev->refcount); mutex_lock(&aux_idr_mutex); - index = idr_alloc_cyclic(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, - GFP_KERNEL); + index = idr_alloc(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, GFP_KERNEL); mutex_unlock(&aux_idr_mutex); if (index < 0) { kfree(aux_dev); From patchwork Thu Jul 4 19:05:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 417FF14C0 for ; Thu, 4 Jul 2019 19:06:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3026C28A78 for ; Thu, 4 Jul 2019 19:06:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 247CF28A7E; Thu, 4 Jul 2019 19:06:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57E4A28A78 for ; Thu, 4 Jul 2019 19:06:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A74706E3BC; Thu, 4 Jul 2019 19:06:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700077.outbound.protection.outlook.com [40.107.70.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57D066E3B5; Thu, 4 Jul 2019 19:06:25 +0000 (UTC) Received: from BN8PR12CA0034.namprd12.prod.outlook.com (2603:10b6:408:60::47) by BN6PR12MB1841.namprd12.prod.outlook.com (2603:10b6:404:103::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:23 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by BN8PR12CA0034.outlook.office365.com (2603:10b6:408:60::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:23 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:22 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:20 -0500 From: To: , Subject: [PATCH 02/10] drm/dp_mst: Enable registration of AUX devices for MST ports (v2) Date: Thu, 4 Jul 2019 15:05:11 -0400 Message-ID: <20190704190519.29525-3-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(136003)(396003)(346002)(2980300002)(428003)(199004)(189003)(5820100001)(14444005)(6666004)(356004)(47776003)(478600001)(86362001)(2876002)(305945005)(1076003)(66574012)(30864003)(8676002)(446003)(53936002)(81156014)(81166006)(72206003)(426003)(70586007)(26005)(54906003)(126002)(5660300002)(186003)(50226002)(2906002)(316002)(77096007)(11346002)(68736007)(76176011)(8936002)(2616005)(50466002)(486006)(4326008)(70206006)(476003)(2870700001)(36756003)(110136005)(49486002)(336012)(23676004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1841; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f6a9037-9bb2-4a91-ae02-08d700b2b4c2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BN6PR12MB1841; X-MS-TrafficTypeDiagnostic: BN6PR12MB1841: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Dw0Zp9cFYE76wnzWWnzJ5ltSNVyBjF+09L17Xypm6IwevuRs2QKMXLGv1pCGaGAq3CHRMTVsKIKuduCeUZcTngLOldalOgsIH5bIRiJjft6Wl36j8PtNKIQ1hjuZR29zzVkVWS6njZJdom5AUcJRc8PmNZm7Dmk4urVNP8gijBd625NKfHQZZcIuz1xASaQs3e/xr6uVYCHslBgDGjapodF2qNeMA/2NbwFB3o/0YkDgBwH4UNBiyCxuYds0aUKAzULZQt6gDm8h1YaZ+QHB+rX3VoQsm/5ofqc2jh0bBj1zc+qSnZ1NsAccOBDP6Mag4+CsCEmc7cbv6RlLs+c0hCVzqguJIEr4AfJGEtlJyT0LctoGaPX11r8DwpkUiGdEVxVuVaEI7JRsWuXdxEaZkA65KM6N6LD5NTcxI0xb04U= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:22.9978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f6a9037-9bb2-4a91-ae02-08d700b2b4c2 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1841 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GTC40i4FZU3T/3m/CLPNPaYFYQqHCxwtxIHRT8Sfijg=; b=mEW3o1DoIA98+xxogSJJtrYS05k6dc0Vhjo7vW20w01ZIUol0XMetl6mx7nV6zYOlPiQjxqokNbKHrzF3TmRYpditVCrKQ3RF4JLy0DvqYkuMekK7KmbVI4Qk7Cu7hR3zk+UQnXWzOOXrsa5n+uLWZ7Xog7nOggr7/935y5hS8E= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä All available downstream ports - physical and logical - are exposed for each MST device. They are listed in /dev/, following the same naming scheme as SST devices by appending an incremental ID. Although all downstream ports are exposed, only some will work as expected. Consider the following topology: +---------+ | ASIC | +---------+ Conn-0| | +----v----+ +----| MST HUB |----+ | +---------+ | | | |Port-1 Port-2| +-----v-----+ +-----v-----+ | MST | | SST | | Display | | Display | +-----------+ +-----------+ |Port-1 x MST Path | MST Device ----------+---------------------------------- sst:0 | MST Hub mst:0-1 | MST Display mst:0-1-1 | MST Display's disconnected DP out mst:0-1-8 | MST Display's internal sink mst:0-2 | SST Display On certain MST displays, the upstream physical port will ACK DPCD reads. However, reads on the local logical port to the internal sink will *NAK*. i.e. reading mst:0-1 ACKs, but mst:0-1-8 NAKs. There may also be duplicates. Some displays will return the same GUID when reading DPCD from both mst:0-1 and mst:0-1-8. There are some device-dependent behavior as well. The MST hub used during testing will actually *ACK* read requests on a disconnected physical port, whereas the MST displays will NAK. In light of these discrepancies, it's simpler to expose all downstream ports - both physical and logical - and let the user decide what to use. (v2) changes: Moved remote aux device (un)registration to new mst connector late register and early unregister helpers. Drivers should call these from their own mst connector function hooks. This is to solve an issue during driver unload, where mst connector devices are unregistered before the remote aux devices are. In a setup where aux devices are created as children of connector devices, the aux device would be removed too early, and uncleanly. Doing so in early_unregister solves this issue, as that is called before connector unregistration. Signed-off-by: Ville Syrjälä Signed-off-by: Leo Li Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_aux_dev.c | 16 ++- drivers/gpu/drm/drm_dp_mst_topology.c | 137 ++++++++++++++++++++++++-- include/drm/drm_dp_helper.h | 4 + include/drm/drm_dp_mst_helper.h | 11 +++ 4 files changed, 156 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 26e38dacf654..4aa5e455e894 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -37,6 +37,7 @@ #include #include +#include #include #include "drm_crtc_helper_internal.h" @@ -116,6 +117,7 @@ static ssize_t name_show(struct device *dev, return res; } + static DEVICE_ATTR_RO(name); static struct attribute *drm_dp_aux_attrs[] = { @@ -162,7 +164,12 @@ static ssize_t auxdev_read_iter(struct kiocb *iocb, struct iov_iter *to) break; } - res = drm_dp_dpcd_read(aux_dev->aux, pos, buf, todo); + if (aux_dev->aux->is_remote) + res = drm_dp_mst_dpcd_read(aux_dev->aux, pos, buf, + todo); + else + res = drm_dp_dpcd_read(aux_dev->aux, pos, buf, todo); + if (res <= 0) break; @@ -209,7 +216,12 @@ static ssize_t auxdev_write_iter(struct kiocb *iocb, struct iov_iter *from) break; } - res = drm_dp_dpcd_write(aux_dev->aux, pos, buf, todo); + if (aux_dev->aux->is_remote) + res = drm_dp_mst_dpcd_write(aux_dev->aux, pos, buf, + todo); + else + res = drm_dp_dpcd_write(aux_dev->aux, pos, buf, todo); + if (res <= 0) break; diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 0984b9a34d55..dde79c44b625 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -36,6 +36,8 @@ #include #include +#include "drm_crtc_helper_internal.h" + /** * DOC: dp mst helper * @@ -53,6 +55,9 @@ static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr, int id, struct drm_dp_payload *payload); +static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_port *port, + int offset, int size, u8 *bytes); static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes); @@ -1238,6 +1243,9 @@ static void drm_dp_destroy_port(struct kref *kref) struct drm_dp_mst_topology_mgr *mgr = port->mgr; if (!port->input) { + + port->vcpi.num_slots = 0; + kfree(port->cached_edid); /* @@ -1483,6 +1491,48 @@ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port) return send_link; } +/** + * drm_dp_mst_dpcd_read() - read a series of bytes from the DPCD via sideband + * @aux: Fake sideband AUX CH + * @offset: address of the (first) register to read + * @buffer: buffer to store the register values + * @size: number of bytes in @buffer + * + * Performs the same functionality for remote devices via + * sideband messaging as drm_dp_dpcd_read() does for local + * devices via actual AUX CH. + */ +ssize_t drm_dp_mst_dpcd_read(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size) +{ + struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, + aux); + + return drm_dp_send_dpcd_read(port->mgr, port, + offset, size, buffer); +} + +/** + * drm_dp_mst_dpcd_write() - write a series of bytes to the DPCD via sideband + * @aux: Fake sideband AUX CH + * @offset: address of the (first) register to write + * @buffer: buffer containing the values to write + * @size: number of bytes in @buffer + * + * Performs the same functionality for remote devices via + * sideband messaging as drm_dp_dpcd_write() does for local + * devices via actual AUX CH. + */ +ssize_t drm_dp_mst_dpcd_write(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size) +{ + struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, + aux); + + return drm_dp_send_dpcd_write(port->mgr, port, + offset, size, buffer); +} + static void drm_dp_check_mstb_guid(struct drm_dp_mst_branch *mstb, u8 *guid) { int ret; @@ -1526,6 +1576,44 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, strlcat(proppath, temp, proppath_size); } +/** + * drm_dp_mst_connector_late_register() - Late MST connector registration + * @drm_connector: The MST connector + * @port: The MST port for this connector + * + * Helper to register the remote aux device for this MST port. Drivers should + * call this from their mst connector's late_register hook to enable MST aux + * devices. + */ +int drm_dp_mst_connector_late_register(struct drm_connector *connector, + struct drm_dp_mst_port *port) +{ + DRM_DEBUG_KMS("registering %s remote bus for %s\n", + port->aux.name, connector->kdev->kobj.name); + + port->aux.dev = connector->kdev; + return drm_dp_aux_register_devnode(&port->aux); +} +EXPORT_SYMBOL(drm_dp_mst_connector_late_register); + +/** + * drm_dp_mst_connector_early_unregister() - Early MST connector unregistration + * @drm_connector: The MST connector + * @port: The MST port for this connector + * + * Helper to unregister the remote aux device for this MST port, registered by + * drm_dp_mst_connector_late_register(). Drivers should call this from their mst + * connector's early_unregister hook. + */ +void drm_dp_mst_connector_early_unregister(struct drm_connector *connector, + struct drm_dp_mst_port *port) +{ + DRM_DEBUG_KMS("unregistering %s remote bus for %s\n", + port->aux.name, connector->kdev->kobj.name); + drm_dp_aux_unregister_devnode(&port->aux); +} +EXPORT_SYMBOL(drm_dp_mst_connector_early_unregister); + static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, struct drm_device *dev, struct drm_dp_link_addr_reply_port *port_msg) @@ -1548,6 +1636,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, port->mgr = mstb->mgr; port->aux.name = "DPMST"; port->aux.dev = dev->dev; + port->aux.is_remote = true; /* * Make sure the memory allocation for our parent branch stays @@ -1816,7 +1905,6 @@ static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, return false; } -#if 0 static int build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_bytes) { struct drm_dp_sideband_msg_req_body req; @@ -1829,7 +1917,6 @@ static int build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 return 0; } -#endif static int drm_dp_send_sideband_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, u8 *msg, int len) @@ -2441,26 +2528,56 @@ int drm_dp_update_payload_part2(struct drm_dp_mst_topology_mgr *mgr) } EXPORT_SYMBOL(drm_dp_update_payload_part2); -#if 0 /* unused as of yet */ static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, - int offset, int size) + int offset, int size, u8 *bytes) { int len; + int ret = 0; struct drm_dp_sideband_msg_tx *txmsg; + struct drm_dp_mst_branch *mstb; + + mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent); + if (!mstb) + return -EINVAL; txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); - if (!txmsg) - return -ENOMEM; + if (!txmsg) { + ret = -ENOMEM; + goto fail_put; + } - len = build_dpcd_read(txmsg, port->port_num, 0, 8); + len = build_dpcd_read(txmsg, port->port_num, offset, size); txmsg->dst = port->parent; drm_dp_queue_down_tx(mgr, txmsg); - return 0; + ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); + if (ret < 0) + goto fail_free; + + /* DPCD read should never be NACKed */ + if (WARN_ON_ONCE(txmsg->reply.reply_type == 1)) { + ret = -EIO; + goto fail_free; + } + + if (txmsg->reply.u.remote_dpcd_read_ack.num_bytes != size) { + ret = -EPROTO; + goto fail_free; + } + + ret = min_t(size_t, txmsg->reply.u.remote_dpcd_read_ack.num_bytes, + size); + memcpy(bytes, txmsg->reply.u.remote_dpcd_read_ack.bytes, ret); + +fail_free: + kfree(txmsg); +fail_put: + drm_dp_mst_topology_put_mstb(mstb); + + return ret; } -#endif static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, @@ -2489,7 +2606,7 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); if (ret > 0) { if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) - ret = -EINVAL; + ret = -EIO; else ret = 0; } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 397896b5b21a..cb2deface950 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1309,6 +1309,10 @@ struct drm_dp_aux { * @cec: struct containing fields used for CEC-Tunneling-over-AUX. */ struct drm_dp_aux_cec cec; + /** + * @is_remote: Is this "AUX CH" actually using sideband messaging. + */ + bool is_remote; }; ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset, diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h index 8c97a5f92c47..2ba6253ea6d3 100644 --- a/include/drm/drm_dp_mst_helper.h +++ b/include/drm/drm_dp_mst_helper.h @@ -643,6 +643,17 @@ void drm_dp_mst_dump_topology(struct seq_file *m, void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr); int __must_check drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr); + +ssize_t drm_dp_mst_dpcd_read(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size); +ssize_t drm_dp_mst_dpcd_write(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size); + +int drm_dp_mst_connector_late_register(struct drm_connector *connector, + struct drm_dp_mst_port *port); +void drm_dp_mst_connector_early_unregister(struct drm_connector *connector, + struct drm_dp_mst_port *port); + struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr); int __must_check From patchwork Thu Jul 4 19:05:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1F61912 for ; Thu, 4 Jul 2019 19:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2C0B28A78 for ; Thu, 4 Jul 2019 19:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A78AB28A7E; Thu, 4 Jul 2019 19:06:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5754228A78 for ; Thu, 4 Jul 2019 19:06:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F420A6E3BB; Thu, 4 Jul 2019 19:06:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710082.outbound.protection.outlook.com [40.107.71.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18B486E3BF; Thu, 4 Jul 2019 19:06:27 +0000 (UTC) Received: from BN8PR12CA0034.namprd12.prod.outlook.com (20.178.208.47) by MWHPR12MB1853.namprd12.prod.outlook.com (10.175.55.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Thu, 4 Jul 2019 19:06:24 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by BN8PR12CA0034.outlook.office365.com (2603:10b6:408:60::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:24 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:24 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:21 -0500 From: To: , Subject: [PATCH 03/10] drm/sysfs: Add mstpath attribute to connector devices Date: Thu, 4 Jul 2019 15:05:12 -0400 Message-ID: <20190704190519.29525-4-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(396003)(39860400002)(346002)(2980300002)(428003)(189003)(199004)(426003)(86362001)(336012)(51416003)(2870700001)(81166006)(72206003)(81156014)(2906002)(53936002)(50466002)(486006)(49486002)(356004)(5660300002)(77096007)(2616005)(476003)(47776003)(2876002)(54906003)(110136005)(11346002)(6666004)(126002)(446003)(316002)(76176011)(305945005)(48376002)(4326008)(14444005)(26005)(1076003)(68736007)(70586007)(70206006)(478600001)(186003)(50226002)(36756003)(8676002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1853; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc20d7b8-f4ca-4eb6-d8cd-08d700b2b553 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR12MB1853; X-MS-TrafficTypeDiagnostic: MWHPR12MB1853: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: NtA94wCP+Wy/Y4xDCVJRST0bs6MUx9P1WCksDqjlosRRSBdy+sMLARUnItaPWHGDMk1DZB7AZgvdzaUTekS9S9LpwOurZH5ybw44hF4UMza8yuE2FMnfbtGRZVua0dnlTotTROXl6vjuaps7YWTgXzNbm9bhPttLMdhExWWgQF+4vsZQX8+Sk+gnxyN84CfSHn3jcokeaV2ZfWDfnGXnOrDNjgd9mt/ToIiWE/MpuihKZi7N76i1y90gisr/jlmfE/TLbPjkIhhXx/uuRiztOv7pgUn3Gt5uXkZDs0qY78SZ4IvbQBX1G23QACvdzhuh07lwBZs0AvjzuUdphVQzKHAXbKl5HjdBrBSss/jSwEzNmcD6Yd/LXVchO0YpxLdGe4JCDoWKxDPMgeyUljMOccS3WYMI6gMThxRRTykcCpk= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:24.0049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc20d7b8-f4ca-4eb6-d8cd-08d700b2b553 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1853 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h+3gst5YjhqJe3AaE/ls5vzkvJ8xbYHZVWH9mcDD4os=; b=P3jWJwtPI7mpC3wrvBOGapSD85WX6g9zUGAS0E9+W5rKKCULU/sLvSHLtYFuIEbuA0WJjBqXcGXoaW29T3+razRPqdL76mxeGGyrouEfUsFzXJNvtBZGYM40iCaYYU5sD7t1l91QLl2kH5stE0H/sK8Pn8MRayur/qAwM9KdlMk= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li This can be used to create more descriptive symlinks for MST aux devices. Consider the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{mstpath}=="?*", SYMLINK+="drm_dp_aux/by-path/$attr{mstpath}" The following symlinks will be created (depending on your MST topology): $ ls /dev/drm_dp_aux/by-path/ card0-mst:0-1 card0-mst:0-1-1 card0-mst:0-1-8 card0-mst:0-8 Signed-off-by: Leo Li --- drivers/gpu/drm/drm_sysfs.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index ad10810bc972..53fd1f71e900 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -236,16 +236,39 @@ static ssize_t modes_show(struct device *device, return written; } +static ssize_t mstpath_show(struct device *device, + struct device_attribute *attr, + char *buf) +{ + struct drm_connector *connector = to_drm_connector(device); + ssize_t ret = 0; + char *path; + + mutex_lock(&connector->dev->mode_config.mutex); + if (!connector->path_blob_ptr) + goto unlock; + + path = connector->path_blob_ptr->data; + ret = snprintf(buf, PAGE_SIZE, "card%d-%s\n", + connector->dev->primary->index, path); + +unlock: + mutex_unlock(&connector->dev->mode_config.mutex); + return ret; +} + static DEVICE_ATTR_RW(status); static DEVICE_ATTR_RO(enabled); static DEVICE_ATTR_RO(dpms); static DEVICE_ATTR_RO(modes); +static DEVICE_ATTR_RO(mstpath); static struct attribute *connector_dev_attrs[] = { &dev_attr_status.attr, &dev_attr_enabled.attr, &dev_attr_dpms.attr, &dev_attr_modes.attr, + &dev_attr_mstpath.attr, NULL }; From patchwork Thu Jul 4 19:05:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C246814C0 for ; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B37C428A78 for ; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7CFA28A7E; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6319328A78 for ; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3F186E3C6; Thu, 4 Jul 2019 19:06:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740051.outbound.protection.outlook.com [40.107.74.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B4526E3BF; Thu, 4 Jul 2019 19:06:28 +0000 (UTC) Received: from BN8PR12CA0009.namprd12.prod.outlook.com (2603:10b6:408:60::22) by BN8PR12MB2849.namprd12.prod.outlook.com (2603:10b6:408:9a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 19:06:27 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN8PR12CA0009.outlook.office365.com (2603:10b6:408:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17 via Frontend Transport; Thu, 4 Jul 2019 19:06:26 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:25 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:21 -0500 From: To: , Subject: [PATCH 04/10] drm/nouveau: Use connector kdev as aux device parent Date: Thu, 4 Jul 2019 15:05:13 -0400 Message-ID: <20190704190519.29525-5-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(346002)(2980300002)(428003)(189003)(199004)(86362001)(2870700001)(8676002)(81166006)(81156014)(426003)(11346002)(50226002)(446003)(5660300002)(68736007)(53936002)(4744005)(49486002)(76176011)(486006)(8936002)(47776003)(1076003)(476003)(51416003)(2616005)(356004)(6666004)(126002)(36756003)(4326008)(336012)(2906002)(77096007)(26005)(54906003)(48376002)(14444005)(316002)(2876002)(110136005)(305945005)(72206003)(478600001)(186003)(70586007)(70206006)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2849; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f326c6e9-8fa0-4f03-856e-08d700b2b659 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BN8PR12MB2849; X-MS-TrafficTypeDiagnostic: BN8PR12MB2849: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mekOEeCpLNS1e8BO/hImfgK+K43PaW9+0GfMPlv43JNFRb63BTlBCHpzgfJWFhoM27+YYefSU9Ahd8H9JX/iC/7wCTVYDBgGHpyOWku7SlsGU0ynCnhpeNOT1O8R9G8qnrngJz1D1CdlWdSfVailRusTRJTEl2YrX6V3in88PU84V/vmB55odSFtfqMXMUDFIjvZY/y1cKmaX5dhY4QE61vu7TILp6xjUxpvwvwvpoRfGRrSLNHDUEuY+OaaMKz37N4uRmnsBPrqA/nmXo1UflrQDoFLR4SCHlae9s0D0EwyTiA8ivHmUo9S4R9bdY8uMm2ggBI/LnWx/276+RVxZJ9bXhW1BcuN2GRE+TPc9F9yrqDUb697y5ziQ6rZLhg/UhImjMfYl63d2olszKRzbMADYNnZ4xs575OkPIBkh+Q= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:25.6748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f326c6e9-8fa0-4f03-856e-08d700b2b659 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2849 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cETKXBe2JhrNZoq6j4UwZscJQJyW6UwVltMrHrXS2HU=; b=mvdF06f9D3lyewza6mEG4WNooJvk7mBrLgy5QCMXN9u/CLuC21pJgzUehfSRJdVFmv9yR6Z/jKDBz8XGA8Lw2J4hKqdeoEePvZ+vPPI5ABV547ijjARBK5UqdJYAmU05y1QgRFes63mfrI0IzOaPOS9V1RkwU+QD/Dguc+82m78= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Ben Skeggs Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. Cc: Ben Skeggs Signed-off-by: Leo Li Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 4116ee62adaf..e32def09ef89 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1346,7 +1346,7 @@ nouveau_connector_create(struct drm_device *dev, break; case DRM_MODE_CONNECTOR_DisplayPort: case DRM_MODE_CONNECTOR_eDP: - nv_connector->aux.dev = dev->dev; + nv_connector->aux.dev = connector->kdev; nv_connector->aux.transfer = nouveau_connector_aux_xfer; snprintf(aux_name, sizeof(aux_name), "sor-%04x-%04x", dcbe->hasht, dcbe->hashm); From patchwork Thu Jul 4 19:05:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03B2C14C0 for ; Thu, 4 Jul 2019 19:06:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E876128A78 for ; Thu, 4 Jul 2019 19:06:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC8DB28A7E; Thu, 4 Jul 2019 19:06:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B29E528A78 for ; Thu, 4 Jul 2019 19:06:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4576E3C9; Thu, 4 Jul 2019 19:06:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680055.outbound.protection.outlook.com [40.107.68.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04AEA6E3C7; Thu, 4 Jul 2019 19:06:30 +0000 (UTC) Received: from BN8PR12CA0009.namprd12.prod.outlook.com (2603:10b6:408:60::22) by CY4PR12MB1191.namprd12.prod.outlook.com (2603:10b6:903:44::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:29 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN8PR12CA0009.outlook.office365.com (2603:10b6:408:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17 via Frontend Transport; Thu, 4 Jul 2019 19:06:28 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:27 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:22 -0500 From: To: , Subject: [PATCH 05/10] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent Date: Thu, 4 Jul 2019 15:05:14 -0400 Message-ID: <20190704190519.29525-6-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(376002)(136003)(39860400002)(2980300002)(428003)(189003)(199004)(50226002)(446003)(2876002)(2616005)(426003)(11346002)(51416003)(86362001)(1076003)(476003)(186003)(81156014)(49486002)(14444005)(8936002)(8676002)(76176011)(50466002)(6666004)(81166006)(305945005)(356004)(77096007)(5024004)(336012)(26005)(2870700001)(70206006)(48376002)(5660300002)(316002)(36756003)(4326008)(47776003)(2906002)(68736007)(70586007)(486006)(53936002)(54906003)(110136005)(126002)(72206003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1191; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 106e3f1d-e4c9-458b-6d1a-08d700b2b772 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:CY4PR12MB1191; X-MS-TrafficTypeDiagnostic: CY4PR12MB1191: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ihkacEUJIJaFxaV9wpVH+LNs2msrm0noz7n1RiXlGJFXpHwi+gG1lZsYkstplYwK041oB2VEswxaAT64kni4nye2LN0Y5PKAsYSZBLhTV/FhoXqPziYmfe4hdRcdQLrCztFwv8buGGFbmQRpW04IPXa2h9b1z+am16+l9NNNiWpEwt69WTJ0JNMsnywr5uVyS97X9iICaqmUsCifGQ83sTSfJH0ipzD3TleKQyFwvEoHMkYFQDx4aRkkVAy8rXNr5j2SnNJ1X2p6U1eGtjhW6O5b/Sn29FElKZA3g5qV7J/zTowFWXdaQja2OBLkvSAUzW0UzbwGiCf9HI8/zCrNHpPHiv3ww9sqC6ORFHZ5koAWd5x45TQjwiWO3tZOgJgM2X5DhxVYwZtlOjQEO+G/ECNC5n61gBfekgYNymCaq90= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:27.4432 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 106e3f1d-e4c9-458b-6d1a-08d700b2b772 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1191 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d+1U3k9GYsWrEV/m0WSElHM9u8VbSWfg9n36hVgrw/U=; b=IBJd3ntV5f/fDAs2iGaqvPM4v6s8OpzEwPCbLxlc2Kn5yJaPbDy99JD8isZA9KvRcySL0RLB0XCn0P9BbxB+1/XEpv+3gSCNMUTRQ95LgQHX6jA9MlFdjzbQ4jVBBUBBVcGfavLO1MNjkrie83ZEHCZKESQ4Xlezd6gN1Sci9Hs= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Enric Balletbo i Serra , Nicolas Boichat Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. To do so, the connector needs to be registered beforehand. Therefore, shift aux registration to be after connector registration. Cc: Enric Balletbo i Serra Cc: Nicolas Boichat Signed-off-by: Leo Li --- drivers/gpu/drm/bridge/analogix-anx78xx.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c index 3c7cc5af735c..c2800cd3e2ee 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -1008,17 +1008,6 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge) return -ENODEV; } - /* Register aux channel */ - anx78xx->aux.name = "DP-AUX"; - anx78xx->aux.dev = &anx78xx->client->dev; - anx78xx->aux.transfer = anx78xx_aux_transfer; - - err = drm_dp_aux_register(&anx78xx->aux); - if (err < 0) { - DRM_ERROR("Failed to register aux channel: %d\n", err); - return err; - } - err = drm_connector_init(bridge->dev, &anx78xx->connector, &anx78xx_connector_funcs, DRM_MODE_CONNECTOR_DisplayPort); @@ -1038,6 +1027,17 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge) anx78xx->connector.polled = DRM_CONNECTOR_POLL_HPD; + /* Register aux channel */ + anx78xx->aux.name = "DP-AUX"; + anx78xx->aux.dev = anx78xx->connector.kdev; + anx78xx->aux.transfer = anx78xx_aux_transfer; + + err = drm_dp_aux_register(&anx78xx->aux); + if (err < 0) { + DRM_ERROR("Failed to register aux channel: %d\n", err); + return err; + } + err = drm_connector_attach_encoder(&anx78xx->connector, bridge->encoder); if (err) { From patchwork Thu Jul 4 19:05:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76359912 for ; Thu, 4 Jul 2019 19:06:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66CF528A78 for ; Thu, 4 Jul 2019 19:06:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B17D28A7E; Thu, 4 Jul 2019 19:06:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BB6E28A78 for ; Thu, 4 Jul 2019 19:06:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A0F26E3C7; Thu, 4 Jul 2019 19:06:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740078.outbound.protection.outlook.com [40.107.74.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 831DB6E3CE; Thu, 4 Jul 2019 19:06:32 +0000 (UTC) Received: from BN8PR12CA0009.namprd12.prod.outlook.com (2603:10b6:408:60::22) by DM5PR12MB1193.namprd12.prod.outlook.com (2603:10b6:3:70::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:30 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN8PR12CA0009.outlook.office365.com (2603:10b6:408:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.17 via Frontend Transport; Thu, 4 Jul 2019 19:06:30 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:29 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:22 -0500 From: To: , Subject: [PATCH 06/10] drm/amd/display: Use connector kdev as aux device parent Date: Thu, 4 Jul 2019 15:05:15 -0400 Message-ID: <20190704190519.29525-7-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(39860400002)(136003)(376002)(2980300002)(428003)(189003)(199004)(126002)(70586007)(68736007)(305945005)(5660300002)(47776003)(478600001)(50226002)(2616005)(2906002)(426003)(446003)(2870700001)(2876002)(70206006)(486006)(476003)(36756003)(110136005)(53936002)(77096007)(81166006)(6666004)(356004)(48376002)(186003)(14444005)(54906003)(4326008)(336012)(50466002)(11346002)(316002)(8676002)(49486002)(26005)(1076003)(76176011)(72206003)(51416003)(86362001)(81156014)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1193; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca282082-25fe-416b-14a2-08d700b2b8c2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1193; X-MS-TrafficTypeDiagnostic: DM5PR12MB1193: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: UnQzGUSeyEt8BgO7BI6Of5Qs9MoR0V9d1Rw9W6bYOiNcV4GXmqTUpQcMOnKWG7rbrQxq6ga5gZ4Jbc6yHqIZn39C5KLYlEC580G4JaJ3QBMRqdPL5j++BH7pLiwWWHfyKKe3hw1J5C+/va93xQXtAzrCVTuJNZotmI7Mr4zf+vabb+Mgup2Coc7EHEZ2B/7L1NyekFL3DN0flcchV5XXYXxxkYQknZnv35N81Qgy3iA9L7beOTCoxFMBsHbDHGXbQ2NI+1JUbk9kPACvkEW4ybkfY+BYdusTcKgjjpbpLENokXL9RGa6FHhHSe/ncntk27ahbe84wrX0ZnnReXHtpyKYp8NOaG5J4QG9+h6KvepFyJeS2BfSGeKyykgIfWrZwN4vaYjTxHz1D3NtbCG1O0MkEW2J6gnDrivIsY1kdQc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:29.7138 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca282082-25fe-416b-14a2-08d700b2b8c2 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1193 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ITmCUh6iv5B9UsKOHh6GC4ZjRYk514mEnMGiKRgjcC8=; b=CPSTqj5cIzTig0nCLkZ1HXLunght7AWsptwSZ3KNf2BMCWrIous8QmHDMFm4zGVDT8+eWcXtGljr41h2+qrcWUeVMFuhMy91X/WkCpAdjDq0jiX1ImsaP15v+/oAqLt3UlIGmgmUO083+NO50aXe8Gt61QL553EHQgXrdTrVJz0= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Jerry Zuo , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. For example, the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*", SYMLINK+="drm_dp_aux/by-name/$id" Will create the following symlinks using the connector's name: $ ls /dev/drm_dp_aux/by-name/ card0-DP-1 card0-DP-2 card0-DP-3 Cc: Nicholas Kazlauskas Cc: Jerry (Fangzhi) Zuo Signed-off-by: Leo Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 6e205ee36ac3..53d2cfe62e13 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -388,7 +388,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector) { aconnector->dm_dp_aux.aux.name = "dmdc"; - aconnector->dm_dp_aux.aux.dev = dm->adev->dev; + aconnector->dm_dp_aux.aux.dev = aconnector->base.kdev; aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer; aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; From patchwork Thu Jul 4 19:05:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 911FE912 for ; Thu, 4 Jul 2019 19:06:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81A8228A78 for ; Thu, 4 Jul 2019 19:06:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 762D228A7E; Thu, 4 Jul 2019 19:06:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 769A528A78 for ; Thu, 4 Jul 2019 19:06:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B301F6E3D2; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790080.outbound.protection.outlook.com [40.107.79.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2403A6E3C7; Thu, 4 Jul 2019 19:06:34 +0000 (UTC) Received: from BN8PR12CA0019.namprd12.prod.outlook.com (2603:10b6:408:60::32) by BYAPR12MB2854.namprd12.prod.outlook.com (2603:10b6:a03:12c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 19:06:32 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by BN8PR12CA0019.outlook.office365.com (2603:10b6:408:60::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:31 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:31 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:23 -0500 From: To: , Subject: [PATCH 07/10] drm/i915: Implement MST Aux device registration Date: Thu, 4 Jul 2019 15:05:16 -0400 Message-ID: <20190704190519.29525-8-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(68736007)(2870700001)(77096007)(110136005)(26005)(36756003)(2876002)(14444005)(76176011)(2906002)(8676002)(54906003)(5660300002)(486006)(186003)(49486002)(47776003)(50466002)(51416003)(81156014)(81166006)(305945005)(476003)(86362001)(446003)(11346002)(426003)(2616005)(72206003)(8936002)(478600001)(70206006)(4326008)(316002)(336012)(70586007)(50226002)(48376002)(53936002)(1076003)(126002)(6666004)(356004); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2854; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d68e1c3-d5b9-4eae-ec01-08d700b2b9a1 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BYAPR12MB2854; X-MS-TrafficTypeDiagnostic: BYAPR12MB2854: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 2ACy4uQfEPUXKYjfj8pJ4d0/+p2keLpDCbdehZO8STOW3rbyi0v9pjDiaUW73MBzPD3LKYsBQKrJeR4vlQEm3HhrSRdZ5wzco+gPO8vDe9QGFLnxCrJpgjRpp4MckdHzgQ6ci2cD5eUCc1rPkdnKwuG/g1eEnOvLou6p6IIAT9JvA6K4m4L/hKhteRYCTmEQmlucdiQKIWIZ2rvRhoCZ7vI6CutmuI7iKHKJ5PKQQ36Tch4egxdAHHgrYrtzWtl8ADSJFPxWSfP81aHFRmIjrMCuEMJachuLbz6GdpIYOdDwI06rb5EjCS+ggd1/4wiFxj1FuhMIVNXJ6uFTaMZPGMGHQj8/ocKF0QCroeeT06RvmqMr3/9dXmG36F1fM+jpShS4v0slRO9ZHrMumcbSCcnCH4nebxzvBI+0ieYbGnY= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:31.1427 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d68e1c3-d5b9-4eae-ec01-08d700b2b9a1 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2854 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P/xbAwEqipqurBk+/l7aEwleZzUyoatfx9xtGXdQdiI=; b=Sw3wpjKxHmHYnU18hVdlQTwSFpwUhjroLPj8kh2OhWqzgh4mD2tQKkxhmRfc/zKuZqEy7AsyVawXKozDRL5YoZx1hVtBqEDiuIHFTWU/YdW5NVwfjqrTctt28MWEKn7vQf76HnLR2e2FWyZmn1Nk7IXrfzRGokLFGvr6QDNUB60= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Signed-off-by: Leo Li --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 29 +++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 60652ebbdf61..be309016f746 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -400,13 +400,38 @@ intel_dp_mst_detect(struct drm_connector *connector, bool force) intel_connector->port); } +static int +intel_dp_mst_connector_late_register(struct drm_connector *connector) +{ + struct intel_connector *intel_connector = to_intel_connector(connector); + struct drm_dp_mst_port *port = intel_connector->port; + + int ret; + + ret = intel_connector_register(connector); + if (ret) + return ret; + + return drm_dp_mst_connector_late_register(connector, port); +} + +static void +intel_dp_mst_connector_early_unregister(struct drm_connector *connector) +{ + struct intel_connector *intel_connector = to_intel_connector(connector); + struct drm_dp_mst_port *port = intel_connector->port; + + drm_dp_mst_connector_early_unregister(connector, port); + intel_connector_unregister(connector); +} + static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .detect = intel_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_get_property = intel_digital_connector_atomic_get_property, .atomic_set_property = intel_digital_connector_atomic_set_property, - .late_register = intel_connector_register, - .early_unregister = intel_connector_unregister, + .late_register = intel_dp_mst_connector_late_register, + .early_unregister = intel_dp_mst_connector_early_unregister, .destroy = intel_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = intel_digital_connector_duplicate_state, From patchwork Thu Jul 4 19:05:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08F7A14C0 for ; Thu, 4 Jul 2019 19:06:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE10528A78 for ; Thu, 4 Jul 2019 19:06:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E224928A7E; Thu, 4 Jul 2019 19:06:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D2B728A78 for ; Thu, 4 Jul 2019 19:06:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38A976E3DA; Thu, 4 Jul 2019 19:06:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780055.outbound.protection.outlook.com [40.107.78.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE6276E3D0; Thu, 4 Jul 2019 19:06:35 +0000 (UTC) Received: from BN8PR12CA0034.namprd12.prod.outlook.com (2603:10b6:408:60::47) by DM5PR12MB1195.namprd12.prod.outlook.com (2603:10b6:3:7a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:33 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by BN8PR12CA0034.outlook.office365.com (2603:10b6:408:60::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:33 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:32 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:23 -0500 From: To: , Subject: [PATCH 08/10] drm/nouveau/kms/nv50: Implement MST Aux device registration Date: Thu, 4 Jul 2019 15:05:17 -0400 Message-ID: <20190704190519.29525-9-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(189003)(199004)(2876002)(478600001)(186003)(305945005)(8676002)(316002)(72206003)(48376002)(81166006)(50466002)(51416003)(8936002)(76176011)(49486002)(36756003)(53936002)(356004)(81156014)(86362001)(446003)(11346002)(126002)(50226002)(54906003)(70586007)(70206006)(4326008)(77096007)(6666004)(426003)(26005)(2870700001)(2906002)(486006)(5660300002)(1076003)(110136005)(47776003)(476003)(68736007)(2616005)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1195; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c02e92c0-9be5-44d2-0c23-08d700b2ba97 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1195; X-MS-TrafficTypeDiagnostic: DM5PR12MB1195: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:110; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: DnBzH6BOqgdZm9HLKmg2/Qt49a9uapX6j3Ewr2n71gTbih8slQqkyHgpDbJWCO/UJJInwIpua/htwaJDLmKrv7g61YB4a0twYBOfFXR2i3aQ7ejZlUOnlXRHc+fpDOpwjaqQASn+HpcvFjuOexp7YCJJmsMYWRJ9XxTzOUD2dt3iFfidGVOdoDDtXMjgeVL4VAEWSnEo1e1cmk2aLkptr9TPZhaDMEtLTUjXLar7bBe9fHgmyq8bNwCoGGggMUbu3db5tuyGNq0nzPd5ln8+S1PlEQlcgE9HJVmPViPhUtjJHovq9mDr1nZ+ePATnFnyW8atOCJX3TD3+0sqndAht/+krylr6dqWu4gHdRgCqvdR53LE+sh1vEvS63+ismKzpLId875f0ZTSvs5wPJLmoB5g975AMEycs+cRYqJofgQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:32.7862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c02e92c0-9be5-44d2-0c23-08d700b2ba97 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1195 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oPqw21VoUrk7TVAhyJioH1PoEhzXIQH98O7s5NHh5QI=; b=PWGcxIO76gXoNdNphW1qkL/wJfEI8NwfwjD9abblczU6+83Q+b4c6F6HcN7/LHQ9EPUZAS472jpXcGNQ/tobyKmxP+hVoV1v8z+4lOt4ICgWkjBJAbHogB9ah8NYdYBSutXwNnDlZ3yiEZNXnLJmuhLqPqH0S0NK5IVf9pr/TmE= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Ben Skeggs Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Ben Skeggs Signed-off-by: Leo Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 7ba373f493b2..6d0fbb6036cf 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1019,6 +1019,24 @@ nv50_mstc_destroy(struct drm_connector *connector) kfree(mstc); } +static int +nv50_mstc_late_register(struct drm_connector *connector) +{ + struct nv50_mstc *mstc = nv50_mstc(connector); + struct drm_dp_mst_port *port = mstc->port; + + return drm_dp_mst_connector_late_register(connector, port); +} + +static void +nv50_mstc_early_unregister(struct drm_connector *connector) +{ + struct nv50_mstc *mstc = nv50_mstc(connector); + struct drm_dp_mst_port *port = mstc->port; + + drm_dp_mst_connector_early_unregister(connector, port); +} + static const struct drm_connector_funcs nv50_mstc = { .reset = nouveau_conn_reset, @@ -1029,6 +1047,8 @@ nv50_mstc = { .atomic_destroy_state = nouveau_conn_atomic_destroy_state, .atomic_set_property = nouveau_conn_atomic_set_property, .atomic_get_property = nouveau_conn_atomic_get_property, + .late_register = nv50_mstc_late_register, + .early_unregister = nv50_mstc_early_unregister, }; static int From patchwork Thu Jul 4 19:05:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6006912 for ; Thu, 4 Jul 2019 19:06:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95B2C28A78 for ; Thu, 4 Jul 2019 19:06:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A1DD28A80; Thu, 4 Jul 2019 19:06:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C58A28A78 for ; Thu, 4 Jul 2019 19:06:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C2426E3DD; Thu, 4 Jul 2019 19:06:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770087.outbound.protection.outlook.com [40.107.77.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5C186E3D6; Thu, 4 Jul 2019 19:06:37 +0000 (UTC) Received: from BN8PR12CA0019.namprd12.prod.outlook.com (2603:10b6:408:60::32) by BN6PR12MB1186.namprd12.prod.outlook.com (2603:10b6:404:1c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Thu, 4 Jul 2019 19:06:34 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by BN8PR12CA0019.outlook.office365.com (2603:10b6:408:60::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:34 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:34 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:24 -0500 From: To: , Subject: [PATCH 09/10] drm/radeon: Implement MST Aux device registration Date: Thu, 4 Jul 2019 15:05:18 -0400 Message-ID: <20190704190519.29525-10-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(39860400002)(376002)(346002)(2980300002)(428003)(199004)(189003)(1076003)(68736007)(50226002)(48376002)(81156014)(47776003)(81166006)(2906002)(8936002)(2870700001)(5660300002)(336012)(72206003)(478600001)(8676002)(305945005)(2876002)(70586007)(316002)(426003)(126002)(446003)(14444005)(476003)(50466002)(36756003)(54906003)(53936002)(51416003)(77096007)(4326008)(356004)(6666004)(26005)(70206006)(110136005)(186003)(2616005)(486006)(11346002)(86362001)(76176011)(49486002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1186; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40d0b346-d0f1-4d2b-883a-08d700b2bb68 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BN6PR12MB1186; X-MS-TrafficTypeDiagnostic: BN6PR12MB1186: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ZYq0nkWc8whvrzQqnP36noaGqR+RXeeKacuFoiJgBmaFmFLSSDcHjOd5BkM6r0LinJjBwQsRu40C4EDAPW04uSIxrBMGnY2fQO2Tee2QDKyIvyfFuCVS06VFK+M8hFL5UbtC0FzLC+x8Lh2R07s/JQFKycZLjNumSpnmsFyBFNjudqjDdiOxLrRGCmkQb1x7uGYdEpcTFT96ET74NplY/bWaGdt2c82qfxJhbK811HSFOVNtjW1O9gV4EJ+NNiGybzuRIo5gQqT6y3ZLfzjTCIBY9f+sakiO1QZcLfdpFyMlNVBLvGORMAg3L3QZbFcwqVioDmhFuEVlI7D5nuj5CEfdLqgPTcYtMmTqko3kq+Ntkz0ZGlH8rMMPUxNXHo2kcBIj0s9V55bdvqbBnF50x+wr/c6wkfPc7OmPXqubXvU= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:34.1626 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40d0b346-d0f1-4d2b-883a-08d700b2bb68 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1186 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B8wYiAJ2Xh33yB9E+rInlTBkW9mTCSWPql5jsZ/BFx0=; b=g+0TR+1VwsJ2Kxa1P5jD+Dy2iS2wgk3htySV8c2sri0vK4tCYOl+9DcwCahv7LvUBuRQknzsaN5d7haqUmvx8lU15qH2Et3Y2lYhziiZHbjBYTEPQ/tWWfAv5arUHf3/JOKmLng4OtdHoMz83fN23dUFbww74+PXJTVs7giN830= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Alex Deucher Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Alex Deucher Signed-off-by: Leo Li --- drivers/gpu/drm/radeon/radeon_dp_mst.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index 2994f07fbad9..2d53699734fb 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c @@ -260,11 +260,33 @@ radeon_dp_mst_connector_destroy(struct drm_connector *connector) kfree(radeon_connector); } +static int +radeon_dp_mst_connector_late_register(struct drm_connector *connector) +{ + struct radeon_connector *radeon_connector = + to_radeon_connector(connector); + struct drm_dp_mst_port *port = radeon_connector->port; + + return drm_dp_mst_connector_late_register(connector, port); +} + +static void +radeon_dp_mst_connector_early_unregister(struct drm_connector *connector) +{ + struct radeon_connector *radeon_connector = + to_radeon_connector(connector); + struct drm_dp_mst_port *port = radeon_connector->port; + + drm_dp_mst_connector_early_unregister(connector, port); +} + static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = { .dpms = drm_helper_connector_dpms, .detect = radeon_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = radeon_dp_mst_connector_destroy, + .late_register = radeon_dp_mst_connector_late_register, + .early_unregister = radeon_dp_mst_connector_early_unregister, }; static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, From patchwork Thu Jul 4 19:05:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11031863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAC0114C0 for ; Thu, 4 Jul 2019 19:06:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB2A728A78 for ; Thu, 4 Jul 2019 19:06:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F44928A7E; Thu, 4 Jul 2019 19:06:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5158828A78 for ; Thu, 4 Jul 2019 19:06:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C5796E3DB; Thu, 4 Jul 2019 19:06:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820054.outbound.protection.outlook.com [40.107.82.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6CB36E3DB; Thu, 4 Jul 2019 19:06:38 +0000 (UTC) Received: from BN8PR12CA0019.namprd12.prod.outlook.com (20.178.208.32) by BN8PR12MB2851.namprd12.prod.outlook.com (20.179.64.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.16; Thu, 4 Jul 2019 19:06:35 +0000 Received: from DM3NAM03FT017.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by BN8PR12CA0019.outlook.office365.com (2603:10b6:408:60::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16 via Frontend Transport; Thu, 4 Jul 2019 19:06:35 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT017.mail.protection.outlook.com (10.152.82.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Thu, 4 Jul 2019 19:06:35 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 4 Jul 2019 14:06:24 -0500 From: To: , Subject: [PATCH 10/10] drm/amd/display: Implement MST Aux device registration Date: Thu, 4 Jul 2019 15:05:19 -0400 Message-ID: <20190704190519.29525-11-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704190519.29525-1-sunpeng.li@amd.com> References: <20190704190519.29525-1-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(428003)(199004)(189003)(110136005)(11346002)(54906003)(305945005)(8936002)(49486002)(50226002)(36756003)(53936002)(486006)(126002)(336012)(476003)(2616005)(446003)(4326008)(76176011)(14444005)(426003)(186003)(2906002)(48376002)(1076003)(8676002)(72206003)(77096007)(2870700001)(316002)(68736007)(5660300002)(50466002)(70206006)(47776003)(51416003)(2876002)(70586007)(26005)(6666004)(86362001)(81166006)(81156014)(356004)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2851; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b446187-94f2-46df-7bb7-08d700b2bbfe X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BN8PR12MB2851; X-MS-TrafficTypeDiagnostic: BN8PR12MB2851: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0088C92887 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: lcwwVuCWFANRzGQQlfLsl4MLgPGHI/3pgx2/nF5A1OTBi1IeYiGhGWtcqHxnkU2A/d6K6eAJErpRMVgnzJKhFH2JjTRARDHo5E8RPE7tyGfIOyGSENtJyOvesLRdBBknZ3ksrgcSASUA6QwIqRXlL31esBPEaijf1gVCK8gyrodlsPrWc3GrfMF9uUKp7LUU+IX5+3kJI+wXBFcOWhj04iQ4xxHhFnaJ15SVuwo1sTJlOY8DquO68k5vw4H5Cy9I9QW3bF9arAF2HwWkMhpqCRYrf28wQjyWApKQvp1Txgq24AA5PeHZqPpmrVAGT43FG5jraWfE+9ArQJszbifDnOm2XXDN/qub/ptYY1eeY1J+BijfNemDgv+/2klNRUBtX1L8sXXrxT6AmsXE3XxSK/6tZI5BF9yH1J/wR96/Zfs= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2019 19:06:35.1573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b446187-94f2-46df-7bb7-08d700b2bbfe 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2851 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BGbz64FOm7IKpvZhMdz6SsYWNclo1MCz/vAqKmtOKkQ=; b=i2M8OtzvgnLKqv2xGfkvlRU8YfZLkG8lGrnTTcz9U0JqOwYVEwBYBzCwDqEBhxEuaW4sRaI0v/9o5pTh4tQJo3tCGUkcfVEgFpQsnQ1a5nVWsdjxOlvuBYW2QRi0FdKNKFkqJREGSXgkkgXVVsWNURTfxvLIcKWupDwxeSlg6X4= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Jerry Zuo , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Jerry Zuo Cc: Nicholas Kazlauskas Signed-off-by: Leo Li --- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 53d2cfe62e13..16218a202b59 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -156,6 +156,26 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) kfree(amdgpu_dm_connector); } +static int +amdgpu_dm_mst_connector_late_register(struct drm_connector *connector) +{ + struct amdgpu_dm_connector *amdgpu_dm_connector = + to_amdgpu_dm_connector(connector); + struct drm_dp_mst_port *port = amdgpu_dm_connector->port; + + return drm_dp_mst_connector_late_register(connector, port); +} + +static void +amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector) +{ + struct amdgpu_dm_connector *amdgpu_dm_connector = + to_amdgpu_dm_connector(connector); + struct drm_dp_mst_port *port = amdgpu_dm_connector->port; + + drm_dp_mst_connector_early_unregister(connector, port); +} + static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { .detect = dm_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, @@ -164,7 +184,9 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { .atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_set_property = amdgpu_dm_connector_atomic_set_property, - .atomic_get_property = amdgpu_dm_connector_atomic_get_property + .atomic_get_property = amdgpu_dm_connector_atomic_get_property, + .late_register = amdgpu_dm_mst_connector_late_register, + .early_unregister = amdgpu_dm_mst_connector_early_unregister, }; static int dm_dp_mst_get_modes(struct drm_connector *connector)