From patchwork Thu May 16 15:17:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10946809 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 16C7C112C for ; Thu, 16 May 2019 15:26:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04A9128821 for ; Thu, 16 May 2019 15:26:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC0E528B6D; Thu, 16 May 2019 15:26:58 +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 6062C28821 for ; Thu, 16 May 2019 15:26:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12BC789762; Thu, 16 May 2019 15:26:56 +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-eopbgr720045.outbound.protection.outlook.com [40.107.72.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABC2489745; Thu, 16 May 2019 15:26:54 +0000 (UTC) Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by BYAPR12MB2662.namprd12.prod.outlook.com (2603:10b6:a03:69::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Thu, 16 May 2019 15:26:53 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:53 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:52 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:51 -0500 From: To: , Subject: [PATCH 1/7] drm/dp: Use non-cyclic idr Date: Thu, 16 May 2019 11:17:57 -0400 Message-ID: <1558019883-12397-2-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(70206006)(70586007)(478600001)(5660300002)(2876002)(356004)(11346002)(50466002)(72206003)(53936002)(76176011)(2906002)(23676004)(36756003)(5820100001)(14444005)(2870700001)(4744005)(7696005)(66574012)(110136005)(450100002)(86362001)(4326008)(305945005)(53416004)(486006)(81166006)(81156014)(2616005)(476003)(8676002)(50226002)(8936002)(446003)(426003)(68736007)(86152003)(336012)(47776003)(126002)(316002)(77096007)(26005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2662; 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: 706a1c21-af59-4c3e-c8e3-08d6da12ec5d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BYAPR12MB2662; X-MS-TrafficTypeDiagnostic: BYAPR12MB2662: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: hregTiQQ5S7o4QgNWah0gYeNqY6k6tOSL6RGPmB4xzjF+ZgIqNvnzk6cL0zpw2wWPnFi+SFUaq3r+55489CLKwxWjizGVIF6a5ud2lZJWE/gPvt0UpQK0nEVU2w3qNHktL9lDkoXbS2wOE640C+d67D/UhQuVQ0veByu5dPbSmmZHpyaFyd+VYVR621r2ebbwpPm05TIsIc7CSXF8wfaB1FOQBeeQe/EaGpUqqNjZoGhLt9a3ZDdlE4f0C1g34+TApAsYLFCSqF/KSJqE048dsvwBnc8/4c7Sy7JtWCP2CpS2TiPd1K5R3GAzE6j9IfG14qIS+JmBneJH4gsledKBQTklNZq5IqvPuXX0En++GGUnxDpWSPXBeQ8Gy5fN1k2hOFNDqi5G75+RMvB3WTh1m8NPMk8rbxBofoYCZ0EpyQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:52.7868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 706a1c21-af59-4c3e-c8e3-08d6da12ec5d 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: BYAPR12MB2662 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=T9qxSsTucJuLeS3qoHfCo4hXm/pAnJLpq41ImhUUq/0=; b=cTF/RhahGWSgWWKaJMiOaZ5x2TJd7cQq9YLUUb1b4cv7aDod+Q6ou3IcNWTOllDOoO8qx0e6fKJ1/FQJttc7/WOKYF8tVsjSxD1DqQ9s5gQh1fz/89dmdizcHWnav40Qclgces3x2TTHLaoxUjrB65z1Tbedk8KlDb1H/+Uv8VM= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Lyude Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_aux_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 0e4f25d..6d84611 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -80,8 +80,7 @@ static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) kref_init(&aux_dev->refcount); mutex_lock(&aux_idr_mutex); - index = idr_alloc_cyclic(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, - GFP_KERNEL); + index = idr_alloc(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, GFP_KERNEL); mutex_unlock(&aux_idr_mutex); if (index < 0) { kfree(aux_dev); From patchwork Thu May 16 15:17:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10946813 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 05C65933 for ; Thu, 16 May 2019 15:27:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6FB128821 for ; Thu, 16 May 2019 15:27:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0CB28B6D; Thu, 16 May 2019 15:27:05 +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 CE90528821 for ; Thu, 16 May 2019 15:27:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AF2289780; Thu, 16 May 2019 15:26:58 +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-eopbgr780089.outbound.protection.outlook.com [40.107.78.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC7C789780; Thu, 16 May 2019 15:26:56 +0000 (UTC) Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by BN7PR12MB2659.namprd12.prod.outlook.com (2603:10b6:408:29::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.25; Thu, 16 May 2019 15:26:54 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:54 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:53 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:51 -0500 From: To: , Subject: [PATCH 2/7] drm/dp_mst: Register AUX devices for MST ports Date: Thu, 16 May 2019 11:17:58 -0400 Message-ID: <1558019883-12397-3-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(396003)(39860400002)(376002)(346002)(136003)(2980300002)(428003)(189003)(199004)(68736007)(110136005)(54906003)(2876002)(356004)(76176011)(86152003)(70586007)(5820100001)(2906002)(70206006)(305945005)(5660300002)(47776003)(36756003)(7696005)(23676004)(316002)(4326008)(486006)(126002)(478600001)(8676002)(26005)(186003)(8936002)(2870700001)(50226002)(72206003)(81166006)(77096007)(81156014)(50466002)(336012)(66574012)(86362001)(476003)(14444005)(53936002)(53416004)(446003)(11346002)(2616005)(426003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR12MB2659; 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: 605b5c5a-eea4-45d7-2adb-08d6da12ecef X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BN7PR12MB2659; X-MS-TrafficTypeDiagnostic: BN7PR12MB2659: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 6wV19uC3c8u/de7voMH2P/V1/aiYXktRUOJWDfk4a0/d9ollrhryBTQ8trAYH3+KPtJa8r9Rl4YHWYyAFMEBaJFSBVG7ekO9fOm1EI1SiZgBBZdcok8D8ktvrEMzirwFA3vmniSoOCCwgyHyuEGwOU6jYmmFQKkUBOWafGRIdD1P2Lwlc8aPBuM2VR1Hx4o5d5WscQXPUtvtZCH/olCPk06OOzKWkyd6X6T4sqrZGTNS3E0f6mkZca5i1fyQum9eG6s7Y9R8ovyu8/YaMbGVbvlVHPFBFdLX62S83EFZ7Yr8boodzvdnRa1f+Ma2fHKWEIM4vxlOsYDR0qpSSa2F6iGPhYaMeRlCGmNCAq5Fjaw3shzl2/817PSW/jqklHIfqiI89Wr9cgxrobIC/5zMeji4cyf28l3N1QCbKSHO7t4= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:53.7326 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 605b5c5a-eea4-45d7-2adb-08d6da12ecef 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: BN7PR12MB2659 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iuNsCEejdg7eATpJHVyB/wqPYsRxu+tXwcwVzc6iEv8=; b=k23paSzNdNdwzZDOe62rbsgtCr7JpP2co0d/vp/v+ystRvoeEwcF0ixYSenLCKZSmcYNhbcv2Y83rg3plk9cLf98F0O5Xz/F8uxTGqlDAjhkPiRO2ckD4Kqv4qhJpJS9367VRnZfH5tkLLODFKKSSIWKrnLAc2ZJALf7YlP1u/U= 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 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. Cc: Lyude Paul Signed-off-by: Ville Syrjälä Signed-off-by: Leo Li --- drivers/gpu/drm/drm_dp_aux_dev.c | 14 ++++- drivers/gpu/drm/drm_dp_mst_topology.c | 103 +++++++++++++++++++++++++++++----- include/drm/drm_dp_helper.h | 4 ++ include/drm/drm_dp_mst_helper.h | 6 ++ 4 files changed, 112 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 6d84611..01c02b9 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,7 @@ static ssize_t name_show(struct device *dev, return res; } + static DEVICE_ATTR_RO(name); static struct attribute *drm_dp_aux_attrs[] = { @@ -160,7 +162,11 @@ 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; @@ -207,7 +213,11 @@ 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 2ab16c9..54da68e 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -35,6 +35,8 @@ #include #include +#include "drm_crtc_helper_internal.h" + /** * DOC: dp mst helper * @@ -52,6 +54,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); @@ -941,6 +946,8 @@ static void drm_dp_destroy_port(struct kref *kref) struct drm_dp_mst_topology_mgr *mgr = port->mgr; if (!port->input) { + drm_dp_aux_unregister_devnode(&port->aux); + port->vcpi.num_slots = 0; kfree(port->cached_edid); @@ -1095,6 +1102,46 @@ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port) return send_link; } +/** + * drm_dp_mst_dpcd_read() - read a series of bytes from the DPCD via sideband + * @aux: Fake sideband AUX CH + * @offset: address of the (first) register to read + * @buffer: buffer to store the register values + * @size: number of bytes in @buffer + * + * Performs the same functionality for remote devices via + * sideband messaging as drm_dp_dpcd_read() does for local + * devices via actual AUX CH. + */ +ssize_t drm_dp_mst_dpcd_read(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size) +{ + struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux); + + return drm_dp_send_dpcd_read(port->mgr, port, + offset, size, buffer); +} + +/** + * drm_dp_mst_dpcd_write() - write a series of bytes to the DPCD via sideband + * @aux: Fake sideband AUX CH + * @offset: address of the (first) register to write + * @buffer: buffer containing the values to write + * @size: number of bytes in @buffer + * + * Performs the same functionality for remote devices via + * sideband messaging as drm_dp_dpcd_write() does for local + * devices via actual AUX CH. + */ +ssize_t drm_dp_mst_dpcd_write(struct drm_dp_aux *aux, + unsigned int offset, void *buffer, size_t size) +{ + struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux); + + return drm_dp_send_dpcd_write(port->mgr, port, + offset, size, buffer); +} + static void drm_dp_check_mstb_guid(struct drm_dp_mst_branch *mstb, u8 *guid) { int ret; @@ -1158,6 +1205,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; created = true; } else { old_pdt = port->pdt; @@ -1188,7 +1236,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, drm_dp_send_enum_path_resources(mstb->mgr, mstb, port); } else { port->available_pbn = 0; - } + } } if (old_pdt != port->pdt && !port->input) { @@ -1220,6 +1268,8 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, drm_connector_set_tile_property(port->connector); } (*mstb->mgr->cbs->register_connector)(port->connector); + + drm_dp_aux_register_devnode(&port->aux); } out: @@ -1404,7 +1454,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; @@ -1417,7 +1466,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) @@ -1994,26 +2042,55 @@ 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_get_validated_mstb_ref(mgr, port->parent); + if (!mstb) + return -EINVAL; txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); - if (!txmsg) - return -ENOMEM; + if (!txmsg) { + ret = -ENOMEM; + goto fail_put; + } - len = build_dpcd_read(txmsg, port->port_num, 0, 8); + len = build_dpcd_read(txmsg, port->port_num, offset, size); txmsg->dst = port->parent; drm_dp_queue_down_tx(mgr, txmsg); - return 0; + ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); + if (ret < 0) + goto fail_free; + + /* DPCD read should never be NACKed */ + if (WARN_ON_ONCE(txmsg->reply.reply_type == 1)) { + ret = -EIO; + goto fail_free; + } + + if (txmsg->reply.u.remote_dpcd_read_ack.num_bytes != size) { + ret = -EPROTO; + goto fail_free; + } + + ret = min_t(size_t, txmsg->reply.u.remote_dpcd_read_ack.num_bytes, size); + memcpy(bytes, txmsg->reply.u.remote_dpcd_read_ack.bytes, ret); + +fail_free: + kfree(txmsg); +fail_put: + drm_dp_put_mst_branch_device(mstb); + + return ret; } -#endif static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, @@ -2041,9 +2118,9 @@ 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 == 1) { - ret = -EINVAL; - } else + if (txmsg->reply.reply_type == 1) + ret = -EIO; + else ret = 0; } kfree(txmsg); diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 509667e..6dea76a 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1265,6 +1265,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 371cc28..30f8c11 100644 --- a/include/drm/drm_dp_mst_helper.h +++ b/include/drm/drm_dp_mst_helper.h @@ -615,6 +615,12 @@ 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 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); + 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 drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, From patchwork Thu May 16 15:17:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10946823 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 B3CF2112C for ; Thu, 16 May 2019 15:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A313C28821 for ; Thu, 16 May 2019 15:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97B0728B6D; Thu, 16 May 2019 15:27:17 +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 558EA28821 for ; Thu, 16 May 2019 15:27:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD4A2897E3; Thu, 16 May 2019 15:27:10 +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-eopbgr800085.outbound.protection.outlook.com [40.107.80.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id E439D89780; Thu, 16 May 2019 15:26:57 +0000 (UTC) Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by CY4PR1201MB0056.namprd12.prod.outlook.com (2603:10b6:910:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Thu, 16 May 2019 15:26:55 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:55 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:55 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:52 -0500 From: To: , Subject: [PATCH 3/7] drm/dp-mst: Use connector kdev as aux device parent Date: Thu, 16 May 2019 11:17:59 -0400 Message-ID: <1558019883-12397-4-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(376002)(39860400002)(346002)(136003)(396003)(2980300002)(428003)(189003)(199004)(53936002)(126002)(54906003)(11346002)(70206006)(486006)(446003)(110136005)(86152003)(476003)(8676002)(23676004)(2616005)(70586007)(53416004)(336012)(2870700001)(86362001)(5660300002)(426003)(50466002)(2876002)(4744005)(356004)(2906002)(66574012)(26005)(5820100001)(50226002)(14444005)(7696005)(76176011)(8936002)(36756003)(77096007)(81166006)(186003)(316002)(68736007)(4326008)(478600001)(47776003)(72206003)(305945005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0056; 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: d82b5d32-b408-4b2a-4558-08d6da12edc5 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:CY4PR1201MB0056; X-MS-TrafficTypeDiagnostic: CY4PR1201MB0056: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 86Z2W8vGk5LGD2KHmO6lNOWWBOIRRx7aDasmPOgpvcityMZmestcRC59gAYxuRO+CodbjaLbhXJTSJjhVEdCMrOC5bCg1XE3cw7HZM2BdnezNHafVATvPvA/3OgFM29lzrcqxqHS8rPgcgVUU+nUSW1Ybw7A5O0mJvlG/opSMuNKTOLwVr/VDgf3NMft1RRza/Ws/sl053XeUa3/0Yb0bBw+JOoZJGX1gR3Cu6Zy2RymwsgjUnHQYUl/JH5xFMGTtqEVvUHXlj8d/7+gsnoyGTavne/8327rVCjj20ZS6llJS+bcWnu4hSw6SpyRnaePPwNnD67zaGks62iUvTr0l0rUm6PTSGBnwuv8acoujDyvHv7M0VDBmbhSLZq1BQnZzUzB65phWzKXNUnrrk1BTqizHEefiVo2VNiqktBMTYI= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:55.1307 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d82b5d32-b408-4b2a-4558-08d6da12edc5 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: CY4PR1201MB0056 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i9MR5RSYJIr6CJOXxa55kZvaM4/p/Jhbt1LH7bU+z4k=; b=c8+MSrblisWNFGx5hgX+S21te3PbUhsCLifLVBG38o9IbxSj9ems+TtlLH8deU5wTeuXRVlzN1sVVaVXrk8Vyckst+XNhZGhNCfrOaPm5hTI1TYMw/uyOrfuWOA1q2I5EJ/U11lfixI6IAKfAkpLF01l721DQF9T4k5WCR9lro8= 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Placing the MST aux device as a child of the connector gives udev the ability to access the connector device's attributes. This will come in handy when writing udev rules to create more descriptive symlinks to the MST aux devices. Cc: Ville Syrjälä Cc: Lyude Paul Signed-off-by: Leo Li Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 54da68e..cd2f3c4 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1269,6 +1269,9 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, } (*mstb->mgr->cbs->register_connector)(port->connector); + if (port->connector->registration_state == DRM_CONNECTOR_REGISTERED) + port->aux.dev = port->connector->kdev; + drm_dp_aux_register_devnode(&port->aux); } From patchwork Thu May 16 15:18: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: 10946819 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 13E59933 for ; Thu, 16 May 2019 15:27:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02B5728821 for ; Thu, 16 May 2019 15:27:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB2CC28B6D; Thu, 16 May 2019 15:27:11 +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 A067928821 for ; Thu, 16 May 2019 15:27:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AC1D897D0; Thu, 16 May 2019 15:27:02 +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-eopbgr720063.outbound.protection.outlook.com [40.107.72.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBC3689781; Thu, 16 May 2019 15:26:58 +0000 (UTC) Received: from SN1PR12CA0079.namprd12.prod.outlook.com (2603:10b6:802:21::14) by BN6PR1201MB0052.namprd12.prod.outlook.com (2603:10b6:405:53::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.17; Thu, 16 May 2019 15:26:56 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::206) by SN1PR12CA0079.outlook.office365.com (2603:10b6:802:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:56 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:56 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:52 -0500 From: To: , Subject: [PATCH 4/7] drm/sysfs: Add mstpath attribute to connector devices Date: Thu, 16 May 2019 11:18:00 -0400 Message-ID: <1558019883-12397-5-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(39860400002)(346002)(396003)(136003)(376002)(2980300002)(428003)(199004)(189003)(476003)(70586007)(11346002)(316002)(70206006)(5660300002)(2906002)(110136005)(53936002)(2870700001)(54906003)(126002)(5820100001)(486006)(47776003)(2616005)(6666004)(426003)(356004)(446003)(76176011)(50466002)(77096007)(8676002)(53416004)(305945005)(8936002)(81156014)(81166006)(72206003)(478600001)(336012)(68736007)(66574012)(86152003)(86362001)(4326008)(50226002)(14444005)(186003)(23676004)(7696005)(36756003)(26005)(2876002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0052; 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: f76ec8a9-e6df-4c59-f80c-08d6da12ee5f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BN6PR1201MB0052; X-MS-TrafficTypeDiagnostic: BN6PR1201MB0052: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Ps5u5BEt7x0NlPXH6dFjumguraYmSMIGBPr27R4qtli5IDbMwwZ6cK91dC678U6ySLcOOfkkFcN3kkd3SPCgXykqAck2xInbv3B7VUMT4GLVHpKY9BNjaYBoRXPpDu0c702uKhJI4PamJlHFZBBr6DD5RB4FLEv8dUoG5skylv6eYpKrQzr90bEmsMzTlFPfqx7SBfXHZBrgBM4WFyDXPCjz3kEmr829xL0wNJINv2OlOXQ8GqogdoLA+bQmsxG2fOpVLuulWcpu0CyrAL4EWd95t2Q33z39mn5oWl/6fr0whYIDRo1WwQXNG30+1P+Xkz8JQAwVU3v7iMsG4M4UETcY17vCC7a5oI3cC4QFRfkWc9mKFpUXH+kBZp1/UjNBurOS3KyLS6A18Vw9gUBNKRMkYt0FEKF2kEyvH7Z6RXU= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:56.1555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f76ec8a9-e6df-4c59-f80c-08d6da12ee5f 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: BN6PR1201MB0052 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=7yFk9TOyxUZxBGE9bD2j+6e2zfnKie9RP5Jf45ehXgU=; b=17ATNaghpw1wt248W+Nx6DI0dxfwz70uUxrLJBSqLhJABuZ4qVRKtlsK9YMg6E24Nrmi9tCVlCcRqzhfz8F13i3t57FqBYNLEubn9U0bIjQVZe+WFCJlNakH+Ldcczt/tMewtlX1vDQrG40RmcgSFrKVrPIhIPOGF+9O4OmYsnk= 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li This can be used to create more descriptive symlinks for MST aux devices. Consider the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{mstpath}=="?*", SYMLINK+="drm_dp_aux/by-path/$attr{mstpath}" The following symlinks will be created (depending on your MST topology): $ ls /dev/drm_dp_aux/by-path/ card0-mst:0-1 card0-mst:0-1-1 card0-mst:0-1-8 card0-mst:0-8 Cc: Ville Syrjälä Cc: Lyude Paul Signed-off-by: Leo Li --- drivers/gpu/drm/drm_sysfs.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index ecb7b33..e000e0c 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -229,16 +229,39 @@ static ssize_t modes_show(struct device *device, return written; } +static ssize_t mstpath_show(struct device *device, + struct device_attribute *attr, + char *buf) +{ + struct drm_connector *connector = to_drm_connector(device); + ssize_t ret = 0; + char *path; + + mutex_lock(&connector->dev->mode_config.mutex); + if (!connector->path_blob_ptr) + goto unlock; + + path = connector->path_blob_ptr->data; + ret = snprintf(buf, PAGE_SIZE, "card%d-%s\n", + connector->dev->primary->index, path); + +unlock: + mutex_unlock(&connector->dev->mode_config.mutex); + return ret; +} + static DEVICE_ATTR_RW(status); static DEVICE_ATTR_RO(enabled); static DEVICE_ATTR_RO(dpms); static DEVICE_ATTR_RO(modes); +static DEVICE_ATTR_RO(mstpath); static struct attribute *connector_dev_attrs[] = { &dev_attr_status.attr, &dev_attr_enabled.attr, &dev_attr_dpms.attr, &dev_attr_modes.attr, + &dev_attr_mstpath.attr, NULL }; From patchwork Thu May 16 15:18: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: 10946817 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 56BDA112C for ; Thu, 16 May 2019 15:27:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46D2928821 for ; Thu, 16 May 2019 15:27:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B27D28B6D; Thu, 16 May 2019 15:27: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 E104028821 for ; Thu, 16 May 2019 15:27:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7A2689781; Thu, 16 May 2019 15:27:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730062.outbound.protection.outlook.com [40.107.73.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4940389781; Thu, 16 May 2019 15:27:00 +0000 (UTC) Received: from SN1PR12CA0079.namprd12.prod.outlook.com (2603:10b6:802:21::14) by BYAPR12MB2663.namprd12.prod.outlook.com (2603:10b6:a03:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.17; Thu, 16 May 2019 15:26:58 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::206) by SN1PR12CA0079.outlook.office365.com (2603:10b6:802:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:57 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:57 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:53 -0500 From: To: , Subject: [PATCH 5/7] drm/amd/display: Use connector kdev as aux device parent Date: Thu, 16 May 2019 11:18:01 -0400 Message-ID: <1558019883-12397-6-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(346002)(136003)(396003)(376002)(39860400002)(2980300002)(428003)(189003)(199004)(53936002)(68736007)(36756003)(4326008)(50226002)(126002)(66574012)(8936002)(81166006)(316002)(81156014)(2870700001)(50466002)(7696005)(86362001)(8676002)(76176011)(23676004)(54906003)(2906002)(186003)(2876002)(336012)(14444005)(70206006)(53416004)(486006)(26005)(11346002)(70586007)(110136005)(5820100001)(446003)(47776003)(426003)(72206003)(305945005)(478600001)(2616005)(356004)(6666004)(77096007)(5660300002)(86152003)(476003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2663; 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: d2609001-d12b-4ba4-49c2-08d6da12ef04 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BYAPR12MB2663; X-MS-TrafficTypeDiagnostic: BYAPR12MB2663: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: O4Pzwcl+rVc+5d8me+hHl1jllhwW8LiFSqPVMK1wM8uVGfwLg3Vxgi5lpjXsBLFieCWiZteHQ8hjAKjM4a775nKByfHjjLGuA29i9XKMZkSW1SFEOOIQxCpry8wfgCCsorN6nw3WtRyDBnf3jQNvXav1pxeW9f5RS131V3mHcxKZJMFLRAFiM+vg/3B7bMGb8ZBDgM24bZqsm3b1re4xMTHoi/oljyLazxHszzq7AyxM7T7+XIraYG944YutCvfweotDrRWrcGikdA5GRO3mufZoh2vGh88pWGjq80QB4HEpb3NlEnExmJ4GuTv7lGlwKrhDYWx60njsHRAv3pCa5hNj87FkhvqXd0LSZ37u0SkUqnOXPDTB5lTOjjdye6durYDVaS4gx86HXyq5UBivsUT1um4AHGjuPJGrOnJFQGI= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:57.2214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2609001-d12b-4ba4-49c2-08d6da12ef04 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: BYAPR12MB2663 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=EAvLEC0kEP1JhZwfxaP1bB7DkAssLjIj/BvNz+ri/EY=; b=0Tlk2mxv3ezd1QQmwcJ3YigYp5/QoWvT0r43z8iXbrqZm5xkibVRUE3F5ohEC+EJn8A+hri1viNuDcmt1kMUb0t5VuXmJzJYSVV33qKMMW7ToXzcE/KKUBkxpNldpDOORsiHJUYorWD/Nbi2K65NC7cKWfjmlPYtak1zJl5titE= 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 , Jerry Zuo , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. For example, the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*", SYMLINK+="drm_dp_aux/by-name/$id" Will create the following symlinks using the connector's name: $ ls /dev/drm_dp_aux/by-name/ card0-DP-1 card0-DP-2 card0-DP-3 Cc: Ville Syrjälä Cc: Lyude Paul Cc: Nicholas Kazlauskas Cc: Harry Wentland Cc: Jerry (Fangzhi) Zuo Signed-off-by: Leo Li Reviewed-by: Nicholas Kazlauskas --- 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 a6f44a4..083fb97 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 @@ -385,7 +385,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector) { aconnector->dm_dp_aux.aux.name = "dmdc"; - aconnector->dm_dp_aux.aux.dev = dm->adev->dev; + aconnector->dm_dp_aux.aux.dev = aconnector->base.kdev; aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer; aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; From patchwork Thu May 16 15:18: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: 10946815 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 9665B112C for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86B4B28821 for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AEFF28B6D; Thu, 16 May 2019 15:27:08 +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 0A36728821 for ; Thu, 16 May 2019 15:27:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0882A897B5; Thu, 16 May 2019 15:27:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710063.outbound.protection.outlook.com [40.107.71.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 720CF8979D; Thu, 16 May 2019 15:27:00 +0000 (UTC) Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by CY4PR1201MB0056.namprd12.prod.outlook.com (2603:10b6:910:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Thu, 16 May 2019 15:26:59 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:58 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:58 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:54 -0500 From: To: , Subject: [PATCH 6/7] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent Date: Thu, 16 May 2019 11:18:02 -0400 Message-ID: <1558019883-12397-7-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(376002)(39860400002)(346002)(136003)(396003)(2980300002)(428003)(189003)(199004)(53936002)(6666004)(126002)(54906003)(11346002)(70206006)(486006)(446003)(110136005)(86152003)(476003)(8676002)(2616005)(70586007)(53416004)(336012)(86362001)(5660300002)(426003)(50466002)(2876002)(356004)(2906002)(26005)(50226002)(5024004)(14444005)(7696005)(76176011)(8936002)(36756003)(51416003)(16586007)(77096007)(81166006)(186003)(316002)(68736007)(4326008)(48376002)(478600001)(47776003)(72206003)(305945005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0056; 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: c63b203a-e209-43af-f641-08d6da12efb6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:CY4PR1201MB0056; X-MS-TrafficTypeDiagnostic: CY4PR1201MB0056: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: bGNP/Y24zC9/iGmc3EGN+urS6oaqfQaGM+MdphrlIMOX/oeYbmte5B+X261wtb6OYu9uHyzge4EqkEZUumi7j4kJpcEplwB/J7GPmd84P9DpbVwP7Fzeo6XZyWd6B9R5GKnz/u6Uytmkh8srnZCm5WxKuA7RcCg7lsvwYzbkt5zq8hzlfNrm5si1WKWJy8okPxF6oQ/p1iDpe3ZlcS2fz6YrhDPe52zZhCTHjyICm68uuOOPIMzmrGm4PD89axBBdaX5bhiqtaLoaD41js1PSojh54QreoW9xMfJzThjjQf1nkaXw9EDUeHWepUh5mjdAQhHSV+3+PVCxlSlaHdJasXd0XO/CsQlnmkagB3f+Yo/U2Dd5/mli5FERGhLfPyqlDMnB/L0O93XVX31h7S9FPmw3XeDwwcG/LhERC17krc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:58.3964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c63b203a-e209-43af-f641-08d6da12efb6 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: CY4PR1201MB0056 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tZQfKr8LtoKi4xxeY8s7qTQKLwEeZSQ34NAZ3EqshaU=; b=AHX3OiOYmgl1EN0gqr3RI4qhP965KTPslPNZ5EVPgusU0WTnBUnjIrgn7mv7zBXagovXf908n3otDN1pVJWh8GVu7X4yz8bS1OeF9NBT0s+byapO4eIYiY3YR796SlKfVzw/J8BrRIBEV1UEtaHvbb2M2YcSZjiA+3DPb6kIu1w= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; collabora.com; dkim=none (message not signed) header.d=none; collabora.com; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Enric Balletbo i Serra , Nicolas Boichat Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. To do so, the connector needs to be registered beforehand. Therefore, shift aux registration to be after connector registration. Cc: Enric Balletbo i Serra Cc: Nicolas Boichat Signed-off-by: Leo Li --- drivers/gpu/drm/bridge/analogix-anx78xx.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c index f8433c9..9fc8b4c 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -1018,17 +1018,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); @@ -1048,6 +1037,17 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge) anx78xx->connector.polled = DRM_CONNECTOR_POLL_HPD; + /* Register aux channel */ + anx78xx->aux.name = "DP-AUX"; + anx78xx->aux.dev = &anx78xx->connector.kdev; + anx78xx->aux.transfer = anx78xx_aux_transfer; + + err = drm_dp_aux_register(&anx78xx->aux); + if (err < 0) { + DRM_ERROR("Failed to register aux channel: %d\n", err); + return err; + } + err = drm_connector_attach_encoder(&anx78xx->connector, bridge->encoder); if (err) { From patchwork Thu May 16 15:18: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: 10946821 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 482DA933 for ; Thu, 16 May 2019 15:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3569928821 for ; Thu, 16 May 2019 15:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27A8428B6D; Thu, 16 May 2019 15:27:15 +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 CE42F28821 for ; Thu, 16 May 2019 15:27:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20EAD897DC; Thu, 16 May 2019 15:27:08 +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-eopbgr790073.outbound.protection.outlook.com [40.107.79.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A9A989781; Thu, 16 May 2019 15:27:01 +0000 (UTC) Received: from SN1PR12CA0079.namprd12.prod.outlook.com (2603:10b6:802:21::14) by SN6SPR01MB0031.namprd12.prod.outlook.com (2603:10b6:805:78::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Thu, 16 May 2019 15:26:59 +0000 Received: from BY2NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::206) by SN1PR12CA0079.outlook.office365.com (2603:10b6:802:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:59 +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 BY2NAM03FT027.mail.protection.outlook.com (10.152.84.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 15:26:59 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 10:26:54 -0500 From: To: , Subject: [PATCH 7/7] drm/nouveau: Use connector kdev as aux device parent Date: Thu, 16 May 2019 11:18:03 -0400 Message-ID: <1558019883-12397-8-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558019883-12397-1-git-send-email-sunpeng.li@amd.com> References: <1558019883-12397-1-git-send-email-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)(376002)(39860400002)(346002)(396003)(136003)(2980300002)(428003)(199004)(189003)(86152003)(86362001)(47776003)(14444005)(6666004)(316002)(16586007)(2906002)(2876002)(305945005)(76176011)(356004)(68736007)(336012)(426003)(186003)(26005)(53936002)(54906003)(51416003)(77096007)(11346002)(446003)(486006)(126002)(476003)(2616005)(70586007)(7696005)(81166006)(8676002)(81156014)(50226002)(8936002)(70206006)(110136005)(50466002)(53416004)(36756003)(72206003)(478600001)(4326008)(5660300002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6SPR01MB0031; 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: 7c02361c-0b40-40c4-09f7-08d6da12f048 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:SN6SPR01MB0031; X-MS-TrafficTypeDiagnostic: SN6SPR01MB0031: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: LsIRz3z4c9vqUyMHuiUFtVEMysCAyL4T/yloKIb4aMPMgqBBOEhd2P6Qeq+1rmhuxTxFvI97vJ2yOxsaHcZdcKEMphLfdT8qXkQXWrDFrTMTi+ZMoSA7/UyNZSo13uUswyIZpjHHz0hS7OsYE2S5xFWv5MUxWybYiaes8lK5rKEACsHH19GjRuMhTv+ElaBPlhjpB1hLEg5YQlV1XmM1uKkWEw5lIIavFASPIgZAwK/N8R0uBSn7evfpY/EvgSuFytIuswryThXk9FkhQox67ErgC4iklKmEf7WrnNx5MHdk5H9tgbn+OiZ2SK97TjM9W87m0RikLxfRBFwl5hWi29+SRFa0zMKxW1aDsdspaYv3K/rpWZ+U43tNzgozaCuHhVkBGOJN36d8TQElXIJ6xZMEOBlpGjBc9/5P02LR5IE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 15:26:59.3562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c02361c-0b40-40c4-09f7-08d6da12f048 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: SN6SPR01MB0031 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=tYz6ywD0mRc2HFLTNUZB3qFvZZRg0n2VDSmWEiuxgCU=; b=JIsJtPsPDWflz01KfMieeJLVXpHawu/aCNvRGrBXp6uVLaK1MBaCPCeT1exxUrVJSUSHK2y6eB8nCaa08zodGAKp9e4Bw+Owk+hFXBjcq63TmUr0BAJm8zxTLyojIQryGVSF+6LH3gTimIlSmca/lhkNJn8+Xgmsz6GKHaxbU7s= 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 , Ben Skeggs Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. Cc: Ben Skeggs Cc: Lyude Paul 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 3f463c9..738782a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1345,7 +1345,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);