From patchwork Tue Jul 23 23:28:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055433 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 CA9F9138D for ; Tue, 23 Jul 2019 23:29:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE1BD28711 for ; Tue, 23 Jul 2019 23:29:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F1AD28745; Tue, 23 Jul 2019 23:29:10 +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 18BD928711 for ; Tue, 23 Jul 2019 23:29:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76D0C6E3D0; Tue, 23 Jul 2019 23:29:06 +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-eopbgr790082.outbound.protection.outlook.com [40.107.79.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 78E036E3CB; Tue, 23 Jul 2019 23:29:05 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V58QpalNS5gIOsSZugdBGXF2URBlUdbOXR7SfJqk+VZsP1deukluvjy/WIGY6AkRXsysdzRO9UGmQ8DjjNtv6lmVKQQw/Hvb4wf5F1QJ5E9xjY0L2olpilLbaOHAuFd9L4CP1NmZ4TM4z/5lqaB48iHEHihkqjJuZFZuHbBDFQJKCX/Y3rypXHauv/IzI5sFmgXoxAYzzWAvVQMUR31ZAuIFzEYHWaz42+LMaqNekJ5iv4G+/we7Q3wzqEQwMAv1uuDXzDFJRyne8vV0waMavrrFDhJ01ZBpFopbHg95wWtgFZ0Z8mCZ9LF5mkfviEXX9Q1shyKsrutKxU9pul1jOQ== 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=RcOTIf1WkUWAphJpw2lNi7ztg9ovrY4DeQuZcH+CWwk=; b=N136g4V2+GzEeihmfuj0Rquv98OJX/a2u9WLUBxSg7tePWRCDoh1v4XomYj089rTLzTzlVwTgFmKunyQDceXRJXS3V6gxPvq1JI/RTJ/oWg6AemRjhPXi76WzmBCae5IcBys+Q75KwB7bky7tRxp5IwYyRez1VAcAVsQVnLHUyalT8LGa1AgmyrEhfGgennAwZtY1skKr6zaEySs7GtQ2vBbdiXBMJErX2CtJLcQm6uM3Lve69VLu6/QAglB6kH6O/U0WIfCViCT7pEOh4RvNh0JDzQsrYph2jWxoFevaHsD9fCV3uUwHdfte2Riyjd8gcz8/QnsQ/qfb1tEFZbcAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0019.namprd12.prod.outlook.com (2603:10b6:910:16::29) by CY4PR12MB1301.namprd12.prod.outlook.com (2603:10b6:903:3e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Tue, 23 Jul 2019 23:29:04 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::201) by CY4PR1201CA0019.outlook.office365.com (2603:10b6:910:16::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.14 via Frontend Transport; Tue, 23 Jul 2019 23:29:04 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:03 +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; Tue, 23 Jul 2019 18:29:02 -0500 From: To: , Subject: [PATCH 1/9] drm/dp: Use non-cyclic idr Date: Tue, 23 Jul 2019 19:28:00 -0400 Message-ID: <20190723232808.28128-2-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(39860400002)(376002)(396003)(346002)(2980300002)(428003)(199004)(189003)(4326008)(2870700001)(49486002)(81156014)(14444005)(68736007)(305945005)(54906003)(316002)(86362001)(110136005)(5820100001)(47776003)(5660300002)(53936002)(8676002)(81166006)(126002)(446003)(23676004)(476003)(11346002)(2616005)(1076003)(186003)(426003)(26005)(2906002)(76176011)(336012)(66574012)(2876002)(8936002)(70586007)(36756003)(356004)(50226002)(486006)(70206006)(478600001)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1301; 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: e437cd97-48bb-4ef9-9a51-08d70fc58cbd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:CY4PR12MB1301; X-MS-TrafficTypeDiagnostic: CY4PR12MB1301: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: meQTDDF7a5Kp0WubQMM+Xz3To5Tk66EVP7z3G91cvG+ryC8zjpjEUkCLKJ2f624Ryn6kTmvd9peErMVG/jXghDoBqY2Q4zNXLGuL0Y9E4q8Eti+MbglhOnKuFnpCsv3Iam5UBL9EWTcHzkchTVc1/MIcEbageIkJV/+v9It92rpAPMm4ezgafe9XsikwYPN1RFgY2cqWSFp46FJGq4NRda0eLnSIeqP5I5P78BWqFCZenBqiKLAKb+dCuf1yLoiKHi0TFS8I4KYFdv00W5NR/u1oLHsrzifqp7jr7nnXlauFdiMFJ1nOHEuyvCN+jJn+3SNwyWXMbzafVHsTD57FnPCoLTUgu2n1Y6juXsawijVD1p6YNgP1dH+lBlLo0eJMO+fx38qqOngZHsiFg8nc1O0ZGmBayBkfx4K6OCRW7G4= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:03.8252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e437cd97-48bb-4ef9-9a51-08d70fc58cbd 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: CY4PR12MB1301 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=l/Ma2iadUHiom6URMMhtPwmGfbRc/PI3hD4VUPF5y6I02+9elmWmmUnBfRMrp8TGHBA8vyPVmuwM9V/64EpdZNkP7qJnVGF/CnmZohklQhIBSayJiiMDsvMvCVrNMDlJzts62AYNrj08fPZVh30NnUfLHm+oh819YTEHGtytJvY= 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 , nicholas.kazlauskas@amd.com 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 Tue Jul 23 23:28:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055437 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 64FE21399 for ; Tue, 23 Jul 2019 23:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54BE928711 for ; Tue, 23 Jul 2019 23:29:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 467A328745; Tue, 23 Jul 2019 23:29:19 +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 6CCB828711 for ; Tue, 23 Jul 2019 23:29:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D7F06E3E5; Tue, 23 Jul 2019 23:29:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800041.outbound.protection.outlook.com [40.107.80.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EABA6E3D2; Tue, 23 Jul 2019 23:29:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MR5YCj6hzb8Kd0Jdr09L9gjbIeEv4Av8VVzWfNpe5aeVs1Yt/l27FK+xOHgJvSKg94CtCoPU9lCrZ+w7UVyMdrOlGU2JzhGHvgAOPMP3rkv6pif4Buu0s30XpD4B9tapugjaHXXmqLz1OjtHwxM+LbhVcC55J3YJ+m4tQSqy7dg4Y7f0eSbGhS5kfz0qk67XVf4k5fAeitT2Gahxzcw6K1R4KED8EmFiiqgEgnUY+97ET1WkRdzQvjB22+czjn6kx3huKFL5oQlk/tfTV4t9Psc9te1CAyJBpZaqsvExqcIeH6r+S4muX4d4owPzuLSEMzpFiVwgk8Nl1BIA2IWdmQ== 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=TyjZxIK5PCR4L5jLb983FAsT4bp/Z39VEa1Xft7yn0c=; b=cFdYOBFLisJ2TlQUTnw2cM9IpBSN5KaZKlzCUA1H1E5Sr237U3Bsu/MZC73rtrt0Nup1cDT6vpIZOYMKyeqJOBD7DxPk/oErFg0TAAO2w9khr9sSoCZDRTQ7RCebDoHspb32iPHWoRZCNFILP4vWzLa7uQOAonv1B8X1fOI795TNwjB/UeQotxvFLzS2Ww8ugKznXaZLLmfmUa8QyNIgzw5UL+46YFfje7U/QsR4M2HUAJijF11A0Am1epsUzU5chDhy9vOFaXdsRXoMQARJX7T7GlAaFWS20cYlfnkyA8yITDXg+puwcYwkPJS0R5z1WXSZlz04ROFK6CCREmr4CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0019.namprd12.prod.outlook.com (2603:10b6:910:16::29) by CY4PR1201MB2487.namprd12.prod.outlook.com (2603:10b6:903:d0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Tue, 23 Jul 2019 23:29:04 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::201) by CY4PR1201CA0019.outlook.office365.com (2603:10b6:910:16::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.14 via Frontend Transport; Tue, 23 Jul 2019 23:29:04 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:04 +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; Tue, 23 Jul 2019 18:29:03 -0500 From: To: , Subject: [PATCH 2/9 v3] drm/dp_mst: Enable registration of AUX devices for MST ports Date: Tue, 23 Jul 2019 19:28:01 -0400 Message-ID: <20190723232808.28128-3-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(979002)(4636009)(136003)(376002)(396003)(346002)(39860400002)(2980300002)(428003)(189003)(199004)(110136005)(86362001)(2906002)(36756003)(2870700001)(47776003)(66574012)(4326008)(8936002)(53936002)(68736007)(81156014)(81166006)(2876002)(49486002)(30864003)(5660300002)(356004)(50226002)(14444005)(1076003)(2616005)(446003)(54906003)(336012)(316002)(70206006)(478600001)(70586007)(305945005)(476003)(11346002)(76176011)(23676004)(8676002)(186003)(5820100001)(126002)(26005)(486006)(50466002)(426003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB2487; 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: 67849d36-4d0e-42fa-838e-08d70fc58d26 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:CY4PR1201MB2487; X-MS-TrafficTypeDiagnostic: CY4PR1201MB2487: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: viAwYVRo7mWnuOouWXCRkrYBJVaQyE/o8MAqavaBbsi304K1HHSAioXUx7GPJPfZxsKxd1gn4l3C+Tg74Nf6yKMJIrXIj8FbGiLaOWGyBRPRv+1aUsL/QFQXRmVnBNQYIqDKMQFDn1enW3oZkdF+6x6SEVBcjnmvubzlp3ayVSid6JO0Kmzxc+A7iNEC/sW0k7DYnuP9QPjpwXwT06Tb9cCXInzyP7BdZYMlcNBPt+oY8spAJAhLYu3PJYXq8ZkkQ9mnbtE6PaX3IBT9YAHlHGyZQSE0Znttfv/wOILPBOsoWJvIm5U8cajU3ivZCAKL6/fPyLvS+tUt/WGveBRRIadGrpHOKeUsfeExlg+9wZbY8qmytwpFWwWHYj+12xzAzK9GPnZeKuBRax92BLjedjPbZLEMXWdjwX5srFyE4eE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:04.4808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67849d36-4d0e-42fa-838e-08d70fc58d26 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: CY4PR1201MB2487 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=TyjZxIK5PCR4L5jLb983FAsT4bp/Z39VEa1Xft7yn0c=; b=R8HZNyMYomriHJFstUYm2IafjOh3jrFmob3W9NAQwzzL/zi1/UfL+hrxcpCQN5wXAfygJOa+vEq5/NxRqQ1OfqMljYCDOZSlgWAk6Jy7VjLnB/3idscLSpP8pl8Hev3aX9tIhMTwzSuNh8wSKtr3AOAfvoF+xHc2CtMGSK+LjPo= 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 , nicholas.kazlauskas@amd.com 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. v3 changes: * Change WARN_ON_ONCE -> DRM_ERROR on dpcd read errors * Docstring and cosmetic fixes 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 | 15 ++- drivers/gpu/drm/drm_dp_mst_topology.c | 144 ++++++++++++++++++++++++-- include/drm/drm_dp_helper.h | 4 + include/drm/drm_dp_mst_helper.h | 11 ++ 4 files changed, 162 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..0cfb386754c3 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" @@ -162,7 +163,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 +215,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..4733d3350ede 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,8 @@ 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 +1490,52 @@ 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. + * + * Return: Number of bytes read, or negative error code on failure. + */ +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. + * + * Return: 0 on success, negative error code on failure. + */ +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 +1579,46 @@ 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. + * + * Return: 0 on success, negative error code on failure. + */ +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 +1641,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 +1910,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 +1922,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 +2533,58 @@ 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 (txmsg->reply.reply_type == 1) { + DRM_ERROR("mstb %p port %d: DPCD read on addr 0x%x for %d bytes NAKed\n", + mstb, port->port_num, offset, size); + 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 +2613,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..8364502f92cf 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 Tue Jul 23 23:28:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055447 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 7D6D0138D for ; Tue, 23 Jul 2019 23:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F9C628741 for ; Tue, 23 Jul 2019 23:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6405328749; Tue, 23 Jul 2019 23:29:31 +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 9394528741 for ; Tue, 23 Jul 2019 23:29:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A5726E3E9; Tue, 23 Jul 2019 23:29:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-co1nam05on0616.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe50::616]) by gabe.freedesktop.org (Postfix) with ESMTPS id D966B6E3D8; Tue, 23 Jul 2019 23:29:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RGb5d3tvZ9Ipi6MrUWGJMWDeRoGlbRzUVKcpi7Vlb/ZNDEuTep+Di4fpfq9IAzbnI+DUHXnckgh0hN+o8VCOyqk+BePw7o3GxpkR/RiaEsqgPnMsZHPXJY3g1JU8VGJeTsprtd+nBYJlBF8XRVyrUtMUkemMk9+QGXxDcD7yvyOLnfjoUyBRJZshe61MEvSLBwImyV2SbnlH4x6HXbSnOZHX0QZKJha7tS0O2GuY21HJuIlqILb4+xdypQsypbCC7m9SBp1JcdmNhwdVAuKLwECaKc1LqL4OIRe2wsl9qWJq+yEaIyU7YlD5nH2wx1DeuFYfYlxRBzVYwl/2TjjTXw== 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=D8HT84lrA98Qr66U7laEA/QzrlMKz2ZklaCO1p3N+xs=; b=HNAkjSbY3YgvyzJv3zNaiLdWFf4eCo3BhuhOEvKqK0Jq9SD4jxzw3teBm5g8GvGFbRD69MVHMZOil6ySXgugvb0J5fasV8ZdcUA9244YokStYypFsK/jklB7ifg0R9siGzF/O4WMUqYGLIP4/OM2myohaADD6ZjlgvKi9TnTTxiCpQJR5rCQrkdwkoN/pwtX2rKBPUAIHDEgBgfKlwdjBCXeiZ6WJV6hf7ECMF3DXRiIo+0Bl2qKCtACFBTrvLhsWUVBPO6uZYs1Hz2o6buyJEpiv1CsAkhUgk5b/h3MB0HWowoOooVP0YFUAz6AVbGxdTY6c9/tgWkN7HwyBv6Leg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by MWHPR1201MB2493.namprd12.prod.outlook.com (2603:10b6:300:ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.17; Tue, 23 Jul 2019 23:29:06 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:05 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:05 +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; Tue, 23 Jul 2019 18:29:03 -0500 From: To: , Subject: [PATCH 3/9] drm/nouveau: Use connector kdev as aux device parent Date: Tue, 23 Jul 2019 19:28:02 -0400 Message-ID: <20190723232808.28128-4-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(396003)(136003)(346002)(2980300002)(428003)(189003)(199004)(2870700001)(68736007)(2906002)(26005)(70586007)(70206006)(47776003)(446003)(50466002)(486006)(48376002)(86362001)(11346002)(49486002)(2876002)(186003)(5660300002)(426003)(336012)(476003)(2616005)(126002)(36756003)(4326008)(1076003)(305945005)(81166006)(14444005)(8676002)(54906003)(81156014)(110136005)(316002)(50226002)(478600001)(8936002)(356004)(53936002)(76176011)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB2493; 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: d4069bd2-3ad4-43b7-1e6a-08d70fc58d8f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR1201MB2493; X-MS-TrafficTypeDiagnostic: MWHPR1201MB2493: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mHDu4IPZXktO5waZd466jUpAdY6PqwcXqPAOMq18PoM/x4aLoMGOeq3UAiEgvddFKvdmnoHKSsoSYRpgt2I4Y0rHb8RDf82vVbm089Grw3eHKWGToSp5F+fLy7R+Ilqp6jRTIu7HMcFcF8uAC1M3lqrgrC49LAEtbrZac4NjpzcWX1Jc9zThOoR5KP0Jfnp0H4dr995nAdss7ip9kLGb24AXnaqfd6BzyN2ja+uU9VZAi2VsGukI5uO6Jd2VG8ifHdGUzYZA17ONatieH3ppvPXmwAgffeLto3vUcPh5vfounOg5po9ilFLE+8glkGnXzZKSLnieK/zj4sOVo9i02TYIlcFuIglvtlmjMUiTP0Lt1gW++HymLtgb+qYfK+h2CGWGSmuimbXf0UbVBKehxXwQVtnSVH4ltNKSt8JU0KU= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:05.2023 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4069bd2-3ad4-43b7-1e6a-08d70fc58d8f 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: MWHPR1201MB2493 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=D8HT84lrA98Qr66U7laEA/QzrlMKz2ZklaCO1p3N+xs=; b=FGyfBBsXPhkgRm5jsfLJVnaJ7MwZmEBpOpLqYwbDWQByiQBzQAY/A5+jKDYnuywbcI7sM5/XcAZ547+VSLe9kTP6TNWXdCP/DD/mF/q1jJ64JB3PfLMkfrVq5FxCDAq/GnEPYzqaY0c6uIZTmiyqU52GnwKaEB9JaAGKUR+qUkQ= 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 , nicholas.kazlauskas@amd.com 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 8f15281faa79..330d7d29a6e3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1349,7 +1349,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 Tue Jul 23 23:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055443 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 6A8A71399 for ; Tue, 23 Jul 2019 23:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 589C028741 for ; Tue, 23 Jul 2019 23:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AD4128749; Tue, 23 Jul 2019 23:29:26 +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 C59E528741 for ; Tue, 23 Jul 2019 23:29:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4501A6E3E7; Tue, 23 Jul 2019 23:29:13 +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-eopbgr770085.outbound.protection.outlook.com [40.107.77.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2E0A6E3D2; Tue, 23 Jul 2019 23:29:08 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hBskeBSrWMeKDpj0kLG5RThLi/G92S9kIldE08t3tZ80by518LUab6cBZBt52oF5zIzQ7pZdrkS8mOoyfgjl/w9nZbC7WqKI22A9WS2XyulkuFV4k3o0PJLdEQPBxsxC6Wv7Pq8ncqRTLy/cma2+KL4v70jDlmjVjjrbrmyFxYF4khvNL1KL0tGszL53vjtuGRwloxaa6sBPpGKQoudAU+dr0GFjBJvsmkEEmOmUznzzZWkjK/4Iku6ZX0O11jkDzwXU0YwQzj5trUSTvt7wshqrorpWYbFUhYhuLRRlpDmuEzQjwWju4YIel7SRrrgjv2wZJf6eHaPZRCrKuR7Osg== 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=d+1U3k9GYsWrEV/m0WSElHM9u8VbSWfg9n36hVgrw/U=; b=H7MuwMu7nhnGHX3H4w6q0go0JLk3Bmr17NmhEF+Rrpk3AqI1jws/yACnMG57hLKr4xgO7VTNN7GVnnwCYvuW206mUl4sDXt/XPwy8jFOqPhdHvjs55CYJz6IE4nq9LKRYm9LLcathmhe6erfbglXA+US9/OobdGYdfrS/+/Qmd/Pn2JClwQDWGSD9FE9DdKo2lGne9LaAsucY1tSJvqSrajd24N0sJj2wAwpOiyrIYNkET8PCslk+56IQiGgZ7Aa0c+wS2hOBfSKKRFh7jAlWuoDeZBP0u3P2EoqtJ3mtcieJPETk8tti6lxufbIjOKU1p5ZBXgrT8+Ly70w+K8+iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by MWHPR12MB1583.namprd12.prod.outlook.com (2603:10b6:301:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.17; Tue, 23 Jul 2019 23:29:07 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:06 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:06 +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; Tue, 23 Jul 2019 18:29:04 -0500 From: To: , Subject: [PATCH 4/9] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent Date: Tue, 23 Jul 2019 19:28:03 -0400 Message-ID: <20190723232808.28128-5-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(396003)(136003)(346002)(39860400002)(2980300002)(428003)(199004)(189003)(54906003)(53936002)(110136005)(2906002)(50226002)(36756003)(51416003)(48376002)(76176011)(446003)(478600001)(5660300002)(70206006)(476003)(2876002)(5024004)(86362001)(70586007)(14444005)(26005)(186003)(47776003)(2616005)(1076003)(4326008)(305945005)(336012)(68736007)(11346002)(49486002)(8936002)(126002)(316002)(81166006)(81156014)(8676002)(2870700001)(356004)(50466002)(486006)(426003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1583; 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: 65c42161-7b3d-474d-275d-08d70fc58e6a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR12MB1583; X-MS-TrafficTypeDiagnostic: MWHPR12MB1583: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: QUdcxC14ZHnHLWp6CStNJixUWkBmtJTJTeAYqzmatiMsJV3FIRsLKguiLMtu+kwVsnMX/UHs0exnAWcEMAtz4UOnvgCs2b89YXMJmRbMW7EWy/GM1pMdqhVfOmFwrZFWZrh5OJ4E/UybMon23DNQkhTE17GuUqaBKxJOM4wxVKqhtGm3rNwv0dsYcXR75Vcf3FxQLVyy2nmFXKIaf06I30zTxVGWqtfQEWm66gfqN4xAMpL0zmja9KPSispbpBkbN1d8oQsuVHVXgV3uXG/eW7/C4fXYhF5wKLjNSFrN2WLJFuujQq7Uu8WBIVEQsAXv958X1ZKkwZh9LzhZNBQYUB1UrxwKaiB/N8RfE5/5XgyMeAk7WQVEkI6nu0sWHmFxBdcAp/vd/jxj47fU2Z+R1hsIj+54ZYuN7ufLPCMA6l0= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:06.5958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65c42161-7b3d-474d-275d-08d70fc58e6a 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: MWHPR12MB1583 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=QgNSmzjgJsfhf8oBJKj2f7I4h1j1mzxHu1+rWt7rJ7Wv9MWJQnWbyL/R/4Gx1cmue6n6o2OafV4M3Zz7V9JKNY1NkX+x9c/nmhGAYLubHv7NtPfv+2WIN7rdYnl0vl3AVh+xc+AfENeHQOn4yN2h8/jL8Gec43yfj/XlGD4ILK0= 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: Nicolas Boichat , Leo Li , Enric Balletbo i Serra , nicholas.kazlauskas@amd.com 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 Tue Jul 23 23:28:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055445 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 F1FD81399 for ; Tue, 23 Jul 2019 23:29:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E391828741 for ; Tue, 23 Jul 2019 23:29:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6BF328749; Tue, 23 Jul 2019 23:29:27 +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 89CF228741 for ; Tue, 23 Jul 2019 23:29:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C6BF6E3EF; Tue, 23 Jul 2019 23:29:17 +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-eopbgr770085.outbound.protection.outlook.com [40.107.77.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 408706E3DB; Tue, 23 Jul 2019 23:29:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WUmR0pzEwUYmhd9GeO/gcz/kgmnqcpzdxvRuM5Xjei1xQ7VL95sVUXs3zR+3HrUTxVvg5bXY/7nYis/7D3grgFXiRqdCxji3Jiyz/MawJBM82z9fBnghg0O9nhrhJ63j9ng4vb7K3vBJ1ySXxCld6lUUAjy/2yHIKltfu+nV25ZJravVqjHSbfN76os0l5VW4c/9NRvZ+6JXw7sYQyYX1xjVcB4znIxndX97NR2nrOFz1usQs5rZ1LUw3EzpLqrqfhpZ48GVxMrVuUNcnnHvwGC/CbFnt5gyAbCvnk6eIufd3IM9pkXmShGEVl+d2WA1FlJuulWwaXFXo0exdHlsjQ== 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=0JsCXW5vE2UQN0bNHktwEhab0TAdTOIi/NCdKK+Ns+Q=; b=jviHkCyYHhEFT977nKwd4shFiiomD4jRjqI5wWQNb36QwwvNEFI8IHrdFRUYzHH1YnIwq4G1rLQzqGBnvB4scpiNdOkTL9k3QwMnT5Sk32me1opq2fdgpSLgtT2/Uf1TrTnycIzCVvrwfsSaVT+6hBaGDEZlBUSWFuk2pzHHsrwd8fHGbvUinAXf2XFj2CFBkVpGsOuLX++Ec/p46mhR8x0MGgW5hAoEzspI9vBzb8QKdCR3J9/XsB/cu67OKSmi094c/reJ9NnH5B5kmwqSEOi4VVYxyN1wwDW5gXPU4e6ZplK+FoxzCdo4Qwtzz/JkDK0JLlxIbW0FnSI/bwifJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by MWHPR12MB1583.namprd12.prod.outlook.com (2603:10b6:301:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.17; Tue, 23 Jul 2019 23:29:08 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:07 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:07 +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; Tue, 23 Jul 2019 18:29:04 -0500 From: To: , Subject: [PATCH 5/9] drm/amd/display: Use connector kdev as aux device parent Date: Tue, 23 Jul 2019 19:28:04 -0400 Message-ID: <20190723232808.28128-6-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(396003)(136003)(346002)(39860400002)(2980300002)(428003)(199004)(189003)(54906003)(53936002)(110136005)(2906002)(50226002)(36756003)(51416003)(48376002)(76176011)(446003)(478600001)(5660300002)(70206006)(476003)(2876002)(86362001)(70586007)(14444005)(26005)(186003)(47776003)(2616005)(1076003)(4326008)(305945005)(336012)(68736007)(11346002)(49486002)(8936002)(126002)(316002)(81166006)(81156014)(8676002)(2870700001)(356004)(50466002)(486006)(426003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1583; 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: b0280393-861a-4e6c-603b-08d70fc58efb X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR12MB1583; X-MS-TrafficTypeDiagnostic: MWHPR12MB1583: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: DrUQJu7HDv9S/ZzKCydqWZNblVGf+O7r/YvmBhrEBAhG0+7KTRv5wk3Jwi2h0pBP9WL8cWzaem08ipWzPTSLL+DrAs094unXvCKayiEuBpsbSYz2Im5+Eu28PW29fu+rro1DTuri4/iCBan0YQIcxJEctX4e7IY22uW1l9YbpJ7Eny1po27Ozqf2cGCqbaUVGgdiSecMIf51rOclafR16VRuNlr/AaM9RFZjVruMvRsIt3CLJsyMAWvqqxvII4MkNvt6N/OkFibvC22zsYiu7SLZB1wBwHSxO6D2F6ULPFWBxafzFbITTwd2vHUPl/zDLudyHGNww87E8U4vXmYlk2ZictQ4r0QzIIMw7HIt7tz9JyzncBxOwOj/jZ5UO6nrNiWNy2OOM2JDanGgJEwoadTrfJ1YtUj1dPs1rbaIyAg= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:07.5675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0280393-861a-4e6c-603b-08d70fc58efb 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: MWHPR12MB1583 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=0JsCXW5vE2UQN0bNHktwEhab0TAdTOIi/NCdKK+Ns+Q=; b=hz58JWWgOc+tY++8Rh4bh0Z7jF5Ni+CclrS2LA5i/+pEjpTPBJrIHK06TOkzUw0ttleASKOrMxSj3+bmy1hxJ2bIaqEzYCK3BkFlVaN/H6p27BDUVqxJvFLziQx1MzDIgzBZmVVBzEQPSKJhG9Ve2iHRz6uN6NsHq+b0opgUxIQ= 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@amd.com 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 Cc: Harry Wentland 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 Tue Jul 23 23:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055441 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 ED9BD138D for ; Tue, 23 Jul 2019 23:29:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE36728741 for ; Tue, 23 Jul 2019 23:29:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1EC528749; Tue, 23 Jul 2019 23:29:23 +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 859B328741 for ; Tue, 23 Jul 2019 23:29:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECB026E3EB; Tue, 23 Jul 2019 23:29:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690054.outbound.protection.outlook.com [40.107.69.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F2856E3E3; Tue, 23 Jul 2019 23:29:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W64dNbW+DVkLbUxns9DjHYi33YjbaPnvDuFQ8NQYspaopgB3VCOODRzbyH0G2bWd3B3CsM4OVlXjGo3uq9Eh8GKZVgDwWZsXszSbUlN/7AWoeiWpvtdSwfyWkiGTi0V9pvVGuR/SXerTKo/50HwMyEATJQ+vNU4keKljM+vVDDqMLBp/Qq0xhtWlG0UZl/rD5hKj0+QvbrtRn3OEU+z3BmP1YbSRCCYEbaMHA1fhs2sF1OFLTlt6JEMJc4FQAfnK4i2s3Hb+UdbFtguWy2Y+9/O0oQ/8UzG0WfFbwdDNxgZvH2ym2wptFRac7P+2oWNtPao/YTNIcs7VseRUHeMOJA== 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=M2QHNUt4kalFLqlG+5Qbbn4m7VLFc8GJcsqH1CrTyt0=; b=NWLg2y249s1uRFTCTMSnrCH6vrhcs+fFo7ukzADwHrhwtyQkx107ovjtKdhJEy5MenvXcz3BBDzq14AOVIH1gOql7agoE290jvEOIAc2jpjsWl2c8gvq2PPpbNaKTkb14yEYJ6Wyj1XZMB9QzjEF1nD/sqtf3JpkeI/W7RV+gAwe3EXYSCD0Vhzu6Fmx8atRbNsLQXSXeIk+F4KtKZ8XIF/vOAnfGaQmkt0dL8TcpmnAtgy5DdrUBWwJWb+TcWq0g6V4G0qRgt7GmBbyjDlTW5cOQwNL7dbpy2vwuZp9cz3ElCRwdnXryJ/yzeTWILtKtv6jvluTT5WC3BjLmT4jvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by DM5PR12MB1305.namprd12.prod.outlook.com (2603:10b6:3:75::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.15; Tue, 23 Jul 2019 23:29:10 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:09 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:09 +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; Tue, 23 Jul 2019 18:29:05 -0500 From: To: , Subject: [PATCH 6/9 v2] drm/i915: Implement MST Aux device registration Date: Tue, 23 Jul 2019 19:28:05 -0400 Message-ID: <20190723232808.28128-7-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(346002)(136003)(39860400002)(396003)(2980300002)(428003)(189003)(199004)(478600001)(70586007)(70206006)(47776003)(2876002)(53936002)(5660300002)(49486002)(50466002)(305945005)(48376002)(14444005)(4326008)(486006)(86362001)(476003)(110136005)(76176011)(8676002)(186003)(68736007)(126002)(50226002)(54906003)(2616005)(2870700001)(446003)(11346002)(426003)(2906002)(1076003)(336012)(36756003)(51416003)(81166006)(26005)(8936002)(81156014)(356004)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1305; 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: 2e9aa1bf-d3a3-4da0-f7b1-08d70fc59018 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1305; X-MS-TrafficTypeDiagnostic: DM5PR12MB1305: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Q6NaLwtGKOehoHWv7DQyKm4XxpXnYyXJD59E76HQSPT6snulBSDnpyk9iLxq79yr8T3/He4h4tV9KuWVMq8I+Jqtv+eV8bdy8pK9PFwBc2ZvUAcKwn6bDKzFmJu9D9nW6x/PDtb7XWX8D1qVa8PE0ONbqSok4Bp+t76X1etEJZZ0EA5NDuWBMDtMucYulHGVm/LsdG+9wf6RkY3J2Vn8N9esM6B0FoZi2Sjf/dh9Lrqfy6f2S+Ej1k8p0qDYhyHuIjwvKcg2dTJT1gNblb5odweq75xPJ9L+6tNfIngUbyyeOgYlX/kcWaaFcrix1EfUeCTLHrR9oHT4VL/AscOrzS0vX1ZHFFxUkJUdldVExYQaqoau8AkJcKyPD4CF4ft7lcSi9SPLRUXQS8CEBlfTDm0DhXGPiPQCjvO6RbWZRow= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:09.4692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e9aa1bf-d3a3-4da0-f7b1-08d70fc59018 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: DM5PR12MB1305 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=M2QHNUt4kalFLqlG+5Qbbn4m7VLFc8GJcsqH1CrTyt0=; b=XOhq5sZV0U5Ijd17Ee4pxrtj57arlw99FtUGC7EC+dbjRGHKhYEDmTZY3BIWZSBEnz3yvYVMruy+Ebvr72rnKEpVavDizwOCUiOyOO3U9KqWuNoPjWIC1rkdAXTfCXkIW3HwkXIChVPonej1rSzl/EL+Yx7xKJmf/+ZVE3Xbstc= 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 , nicholas.kazlauskas@amd.com 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 v2 changes: Unwind intel_connector_register on mst late register failure. --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 33 +++++++++++++++++++-- 1 file changed, 31 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..0633ebf3f1bf 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -400,13 +400,42 @@ 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; + + ret = drm_dp_mst_connector_late_register(connector, port); + if (ret) + intel_connector_unregister(connector); + + return ret; +} + +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 Tue Jul 23 23:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055451 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 E6CDB1399 for ; Tue, 23 Jul 2019 23:29:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D91C028741 for ; Tue, 23 Jul 2019 23:29:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CADFD28749; Tue, 23 Jul 2019 23:29: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 7FDB228741 for ; Tue, 23 Jul 2019 23:29:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A059C6E3F7; Tue, 23 Jul 2019 23:29:31 +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-eopbgr820085.outbound.protection.outlook.com [40.107.82.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A8926E3E3; Tue, 23 Jul 2019 23:29:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WcyKJyTwJfC+KlsB1SQCVIuKBpakccjio5mpTK6Uunup8HPGO89SStoToIPZzJmaZoB0tmGCAswMmB7E8SKID+sFgUT07BVnmmLZG4DYVKx7/jcPhJVUXpmozGsgpDyFp7YX5/9dxKrHqtQmVZoL6rymU5eP0aY0CQL/fgYEWAk0zGoXm5iFJ3Mq7wrsxliIFvmVQiDWk7OMC1/oYkPq8LDCiDiY44PVpTf3yrJ4794tfp/d0fWFltDcM50Pm+Rom3tAH0MU3ZQxg1V8CocWcRTcwOXno92FdHlYFv7IP8XyHGxvD5qBvCBrTTwraBT+1SdFtv4cHbAuoyAgs305fA== 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=Hl2yLcIgazvjzdeTvxWcxAwsUFugSPa+9nidH+VzVGU=; b=ZC7RufMIjUIOsbqlT/3FK2t5oZCV80GMtdHwS+/lFg2q3OAhVTAxESlZgQe8E9+Ke0qNLSl8h8Lpgm4vMvBvoOExw7gf+Uq16s4qJHTMuYdOR4biMRceKdhgdJTxww4/pJn7aGFUTq17dPv4U8FxzETWFV+qbB+ZnbeKrzGI+NVwauGvrpWeWFhwK31JeafLpjwFdKge+W575isTkBCfIN3jJfvZjn35sCJrlU9fkRdBfeqygClVBPwpdrGDGIhc4UGBpQMt9T/SfUzxqE1Mkqtnw2eK5syOu2lxeti3rjVroaMdchGvqNLYGfsvbZMG+6VH4O08AxrGbnF99CK/4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by DM5PR12MB1579.namprd12.prod.outlook.com (2603:10b6:4:c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.15; Tue, 23 Jul 2019 23:29:10 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:10 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:10 +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; Tue, 23 Jul 2019 18:29:06 -0500 From: To: , Subject: [PATCH 7/9] drm/nouveau/kms/nv50: Implement MST Aux device registration Date: Tue, 23 Jul 2019 19:28:06 -0400 Message-ID: <20190723232808.28128-8-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(39860400002)(376002)(396003)(346002)(2980300002)(428003)(199004)(189003)(68736007)(8936002)(50226002)(478600001)(110136005)(81166006)(81156014)(54906003)(47776003)(356004)(48376002)(2906002)(50466002)(1076003)(2870700001)(316002)(305945005)(70586007)(476003)(53936002)(76176011)(86362001)(5660300002)(51416003)(8676002)(336012)(2876002)(486006)(26005)(186003)(36756003)(49486002)(126002)(446003)(2616005)(4326008)(70206006)(426003)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1579; 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: 7ebe039d-03a2-4ced-61a3-08d70fc5909e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1579; X-MS-TrafficTypeDiagnostic: DM5PR12MB1579: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:110; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 2vTP26h2TM5C4S8eKBM+lO7Cru0vb1t4w92pLamvKqAZD2pmlP1mtmHX7wmnX8pTqsDvqko9PI7Fvu+E8MI0HMX/rZ1Xh/D0jNfhMGlYrq7WbAWXDcqixojftAEfv87ESu9Fk2n+RWvf5TJRMOxBv1oBlVts7nEt+x5jVvd4sSRtg7oMkHojDDeKU7zHaNVx0vdrYTxSFcSu1P7v9FR1qNa+QrzCY4OkaDhaly+gcFZD0zP6D28xAVt8bQWDPHu9fY68EOYdY5vq6Hh1dfudatsOwcNwzziCKI4lvXWfbdlsyYBxpkzi/NcnuU2tkRT76Bt1WEuI9xuaYssmOpDSMUtHc9qtORv11bxfoQ/ZWUJb+peBBOYwefL9uQO08VRiKbSXXdCB62gTq5NIemOtKtEud4614F8HpnOUgZx+exk= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:10.3235 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ebe039d-03a2-4ced-61a3-08d70fc5909e 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: DM5PR12MB1579 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=Hl2yLcIgazvjzdeTvxWcxAwsUFugSPa+9nidH+VzVGU=; b=K9yL+W0aNOu1obwnIlpiDbGFG5RufvIYNLwZIjZlY2x22bmLOZarEa8UXtO1g5i+pC7sdRtcSrmG3Yw1hTUaMf1BguevjCmrRwSW7c/7F68qleVVqmmX4cBnK9MbKNGaqQPryD86LjkUKMOL0v5Qk2GwZZcGGGAumpgg/FDHxoQ= 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 , nicholas.kazlauskas@amd.com 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 Reviewed-by: Lyude Paul --- 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 8497768f1b41..0d6e9350ba44 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1024,6 +1024,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, @@ -1034,6 +1052,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 Tue Jul 23 23:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055439 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 B28391399 for ; Tue, 23 Jul 2019 23:29:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3ADA28711 for ; Tue, 23 Jul 2019 23:29:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9789F28749; Tue, 23 Jul 2019 23:29:21 +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 495F828711 for ; Tue, 23 Jul 2019 23:29:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E33456E3DD; Tue, 23 Jul 2019 23:29:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-co1nam05on060f.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe50::60f]) by gabe.freedesktop.org (Postfix) with ESMTPS id D61FD6E3E4; Tue, 23 Jul 2019 23:29:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPdyYPBroCsJ419abXotXBfhd8pDgvfuZ/PURjzKqGB9er+ik7fwQAmggsAswfOEx+mneAAFwUAZ4fF2pf25HAnZS6bJNZ1Z1Ehi5CLwZAd5wsqmbnq9lEf2PWmiskomDYiTwxwF4/5PkGdlreqVT3HVRGgtxKCTDOHQLoFppdwSFneLd2COklVn+bppr0emB6FD7yiGnjgBH0iXERMWhG8orCb/YPbH7ShiYav/s461ZX5le9nBtTHJgv4Cp4J1Hfm+S1QSAirzs+1lf5zP0eYNfkPQpjM2MHFKduoiJIaWP4edOc04KImuavf6qDf42dE6XyKliIwbJo/tt45gSQ== 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=AtxWvtZmg/0et3/q8/dWNXDC3/jSkhtdFEe+vZGDNi4=; b=b8HlhMG7dVbX7OJMM2wzFIYa5+gUTjyCkJuqkouZ9u3o39NBGrANEkDWop5p+wZCdGuWRyER3f/Gx5XzaEAbaJG767pFlrHefBPzGuV0SpNC/0OE1MB38Hzy24uiVgvvtdYYvw832E2Ju46Vud1Spy6toNu8m1JnGXzi840m0JJUp6ETwsP7hwplKDVfDYDqmEG4QDAgoJLcIpUbgWatkg4TFztTGjf32vwKK1G1GbjLCydnY0DCq1Rt0gpQpHKYhk/RD0X2eQCnYLayZutB2XgkjEROrkY4zrkEFkBI1bB3zNnwQTGaMfBfUwoFTIgJ8k5aY8LQvcq6QWoKnX4xUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:910:16::28) by DM5PR12MB1305.namprd12.prod.outlook.com (2603:10b6:3:75::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.15; Tue, 23 Jul 2019 23:29:11 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by CY4PR1201CA0018.outlook.office365.com (2603:10b6:910:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12 via Frontend Transport; Tue, 23 Jul 2019 23:29:11 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:11 +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; Tue, 23 Jul 2019 18:29:06 -0500 From: To: , Subject: [PATCH 8/9] drm/radeon: Implement MST Aux device registration Date: Tue, 23 Jul 2019 19:28:07 -0400 Message-ID: <20190723232808.28128-9-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(346002)(136003)(39860400002)(396003)(2980300002)(428003)(189003)(199004)(478600001)(70586007)(70206006)(47776003)(2876002)(53936002)(5660300002)(49486002)(50466002)(305945005)(48376002)(14444005)(4326008)(486006)(86362001)(476003)(110136005)(76176011)(8676002)(186003)(68736007)(126002)(50226002)(54906003)(2616005)(2870700001)(446003)(11346002)(426003)(2906002)(1076003)(336012)(36756003)(51416003)(81166006)(26005)(8936002)(81156014)(356004)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1305; 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: e75a7fb4-18b2-4be8-b859-08d70fc5912a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR12MB1305; X-MS-TrafficTypeDiagnostic: DM5PR12MB1305: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: BgjLzfxDBN8M9Yj7yBfEhQwMZG86RmAoZ+1iqwpIDkQMM34Ktw1yEEOfE65YkLwA9wEvP8onH6etmWnpunA5xHAH5LycoLvXJNWFkRMzSo7z6j6L7FEPD18vx9TY0Jw54dkxg5ZFj/rQesUEok+KFgZROrqMXNznH9Zid4dFd/oxlBSW/xZs5ii4BWZdXIJN7+cW6Dfk3rUV01Q8s635U4NE6oaQCVy9cwS98JBOV5jvYEwTtgOavF2rFW7ElzUz9GdmH6OFdHkOLQcjNYQci7XKtlfe06C3acubLHv3LoHM4IUwVqPElt5Z4AZ0doqnf31UDRPGaI/CLqmyFY128bUulNlJXyuOt85utDnQEpD8sLWWQKOjQ5M2Hnzcf7rLqL2XWpCHNhGXPxDJLQctQp1LUG2akREpYR1/XjOSNsM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:11.1922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e75a7fb4-18b2-4be8-b859-08d70fc5912a 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: DM5PR12MB1305 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=AtxWvtZmg/0et3/q8/dWNXDC3/jSkhtdFEe+vZGDNi4=; b=JDfFXQaHp1gspvp7kCkSr0aaxuFmdZ5NDOgiR6pzQ2YVhv8+IhqQhxQVJcJ9n0G4q7u4Mpi8ZHqfW7ampfJEA+0aLLJ8x+CUda2FrbTgO1EpfO6172Zo/z/ZFXshxY+Ql/f0Ec5Ve7clnRHibAZIGFB0aAD/CizanlmvDQYTzvI= 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 , nicholas.kazlauskas@amd.com 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 Cc: Harry Wentland 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 Tue Jul 23 23:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 11055449 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 A87B9138D for ; Tue, 23 Jul 2019 23:29:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98DEF28741 for ; Tue, 23 Jul 2019 23:29:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D41C28749; Tue, 23 Jul 2019 23:29:32 +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 3AC2B28741 for ; Tue, 23 Jul 2019 23:29:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08F7E6E3F3; Tue, 23 Jul 2019 23:29:23 +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-eopbgr780048.outbound.protection.outlook.com [40.107.78.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFE1C6E3EE; Tue, 23 Jul 2019 23:29:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ar9rBP/zRchJSeeL4/HA17BfuVCbMeVLiar5qad0QRy/Cmihe/oODmUWA/K9CX3yPWsdhijZ5zjXyhHTAbgjp259PcZyOxfNBgA0PpEwj+wZfFSyC8ozZ1NO1Va3hMwkHSjUGkFIn2UX99GfVBY3jptlIqi/6bEJyuBF4XMT3yRCQRLNnr001sSSpjlKjSEvuHlHg+SdDoaiY3TfNLgt/Nz/Eb/mVJEdLEL6RTMvs4aMN+kb0cgBN1ODTozKi0/1pTs1M4hKFMP8sVRBHjaJYICF6vfstOwzWi22xQPc1FwmL9jF3Ir48shwlHA0cpMyokJlX28AeytuR6Ef2hdXWw== 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=rMX4HAXE+QcWiKCXNX0dXCSqR4+GVXr4+usrboA0ERU=; b=QI68YjSc+BydECHgUxvc8XYuSpBz1xKKqilwfJTep6J+zy2+qTl3nYl58tq67DXXZpFMF7fyCf/sPT3uG1agbNK/bqABReiRXA5fXe+53/JFX8FC0Cz8uD7ZKVXX0I/7dVYmala5Vei/TeAEyPVFsfNQ5bIYwmGeh43aCla10+lsRxQ1yanseSlLztR21+pzUC/KH0booYb3hEnLBdMMJe5gHd/Lelq5NTDazchMDlJOrt476ANTUaHrJp8ZEvKf9wG6RD/wLBpMjS2GUKuyEPzIoMiLjhW1rt4PWcYcxMuESmE0Zq27l7+Z/d+5HKHvfPF3QRVIsvLGCD8X0kTG1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com;dmarc=permerror action=none header.from=amd.com;dkim=none (message not signed);arc=none Received: from CY4PR1201CA0019.namprd12.prod.outlook.com (2603:10b6:910:16::29) by MWHPR1201MB2494.namprd12.prod.outlook.com (2603:10b6:300:de::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Tue, 23 Jul 2019 23:29:14 +0000 Received: from DM3NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::201) by CY4PR1201CA0019.outlook.office365.com (2603:10b6:910:16::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.14 via Frontend Transport; Tue, 23 Jul 2019 23:29:14 +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 DM3NAM03FT038.mail.protection.outlook.com (10.152.83.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 23 Jul 2019 23:29:13 +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; Tue, 23 Jul 2019 18:29:07 -0500 From: To: , Subject: [PATCH 9/9] drm/amd/display: Implement MST Aux device registration Date: Tue, 23 Jul 2019 19:28:08 -0400 Message-ID: <20190723232808.28128-10-sunpeng.li@amd.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723232808.28128-1-sunpeng.li@amd.com> References: <20190723232808.28128-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)(136003)(396003)(376002)(39860400002)(2980300002)(428003)(189003)(199004)(486006)(51416003)(70206006)(76176011)(70586007)(336012)(36756003)(356004)(478600001)(47776003)(86362001)(26005)(68736007)(305945005)(50226002)(2870700001)(53936002)(2906002)(50466002)(2876002)(81156014)(110136005)(4326008)(14444005)(81166006)(316002)(54906003)(126002)(446003)(1076003)(2616005)(49486002)(11346002)(426003)(48376002)(5660300002)(186003)(8676002)(8936002)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB2494; 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: 6b2c677e-b4bc-4e13-89ac-08d70fc592b3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR1201MB2494; X-MS-TrafficTypeDiagnostic: MWHPR1201MB2494: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0107098B6C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: rIEsI88elqxG2KqfNOq8B9CKDLycMoxOgN8UbYnB/991j5RrdBNg6pAWqQMTdw1G0so+RkzWHPeWM/wrEttFCNA47VqgS9q9rKD8PO0AxDRe2ng15k+r93OEBGj4SZmSV2IUyUpjIG7kPEOlKwd2XYoR76SsiR2GJVcQlYuxMJPwz4BQuP7KU4ZNLG60kgvjOSyR7pr7SyL9Kgq4xj8+8pK3+RnEcQ2RHpKdNsfGii9j+VDJn3pVVmpHkkE4Mv9Rz8oymt1wrcCSWU7VIch9vrAx9R3LYNJTw2SiSYK6AnoOwzdN3C5C03GpwwqrTMOmJj0SiBqFbBrxooIGZ8ITg4KfkKaFrirAgTQWlept2yF8oBXY8YMVpMtsYyYlMP5IVkgm4YTDwm/3uOIIX9YfOttnGj4PXU5X+Ld/Jr8h+6s= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2019 23:29:13.7535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b2c677e-b4bc-4e13-89ac-08d70fc592b3 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: MWHPR1201MB2494 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=rMX4HAXE+QcWiKCXNX0dXCSqR4+GVXr4+usrboA0ERU=; b=uCIgJCZ92AkjdVTkiDnmjBUGuLuhVltfbFMlVC/5LOzhMKC8yWR54qNdl1ormvnYIOCpw9DfWLg3bFVPDwY8zkN5AM/feJ8mjD0CNeIwdidVfo7t+lQkWrC0F29BghhK4b+dhlAEGxUZS0qzscqNnlHYD6r4C84l2KDcycGCu0E= 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@amd.com 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 Cc: Harry Wentland Signed-off-by: Leo Li Reviewed-by: Nicholas Kazlauskas --- .../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)