From patchwork Fri Dec 6 22:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Dingchen (David)" X-Patchwork-Id: 11277121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18F96109A for ; Fri, 6 Dec 2019 23:04:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E79F72173E for ; Fri, 6 Dec 2019 23:04:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E79F72173E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE1326E102; Fri, 6 Dec 2019 23:04:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060.outbound.protection.outlook.com [40.107.93.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id B34246E102 for ; Fri, 6 Dec 2019 23:04:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XkcuDawwpj164Bx7W32vw8LK+axZUOFUlcqiuGZ8fHGeYiKFa4N7/JTgH+6fnCTmpK2LHO8DGysW25LFessjDIdHYiU8614Z8H3lmBWY299REkhPOIMBPUq0esmE5TtnZAHMNyoQLpcsd/EfGCg6qQjWWGfoJ9lI61PYyYo+pfddhbK0ve82W9PN7Zho5cA+0+cHxqEkSloHnXg5/dgk4/oIaOjo6z7GaQici+tXv31fjxn079jIlQRgI+PzogIE6OAO8hVgi1vGe0nlURAuBjLw3SdS2OxX9AJVFoRa+OXJajG7FPChz8I8IidR5uv5NInhEKalpkHn4btsVDfnFg== 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=SISAzG5pWzKNruOhLY5Js+5errYWNNPStldytO77+28=; b=bxriqBmesGbWajU17BSuq5JO5kpnlpUBhYY1bjp2La8M4tijwLRD4Ol3ftH48bKhCGHSXveDGN/cFBH+deact/M/HtMklLTEBYqpO7vpXiQfr3O8UlGMX6sB8v/9M2VwTfc2vH1ktCT+Uz49IpNfA2PlG6Tvcg3+ZCLV9xkkm5OJLIw41awS2UeA/+QNuaImSyFrrkCaEp2MF6y/Pjk2lcwM6WYMtxsWSIjpVllipQz73GJ7opt/GUSpE4lY0hoQlAWJDHhcMuEIpKfOpjJgmBo8GzrjU2rYwWjJn1U/rLVsVi58I4g1rT0Y1tIlSVVe8BZXxBzNG5nPKVa5AGd1VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from BN4PR12CA0017.namprd12.prod.outlook.com (2603:10b6:403:2::27) by BN7PR12MB2756.namprd12.prod.outlook.com (2603:10b6:408:29::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.22; Fri, 6 Dec 2019 23:04:44 +0000 Received: from CO1NAM11FT021.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::200) by BN4PR12CA0017.outlook.office365.com (2603:10b6:403:2::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2516.13 via Frontend Transport; Fri, 6 Dec 2019 23:04:44 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT021.mail.protection.outlook.com (10.13.175.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2451.23 via Frontend Transport; Fri, 6 Dec 2019 23:04:44 +0000 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 6 Dec 2019 17:04:43 -0600 Received: from Jiraiya.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 6 Dec 2019 17:04:42 -0600 From: "David (Dingchen) Zhang" To: Subject: [PATCH v2] drm: add dp helper to initialize remote aux channel. Date: Fri, 6 Dec 2019 17:56:37 -0500 Message-ID: <20191206225638.609-1-dingchen.zhang@amd.com> X-Mailer: git-send-email 2.17.1 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)(428003)(199004)(189003)(50466002)(36756003)(48376002)(1076003)(305945005)(2906002)(356004)(4326008)(70586007)(70206006)(6916009)(8936002)(498600001)(336012)(51416003)(7696005)(81166006)(5660300002)(8676002)(81156014)(966005)(50226002)(426003)(6666004)(186003)(26005)(53416004)(2616005)(86362001)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR12MB2756; H:SATLEXMB01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e86e2231-3608-492c-173d-08d77aa0aee6 X-MS-TrafficTypeDiagnostic: BN7PR12MB2756: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0243E5FD68 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g2jWzO5HWDXiCefLQQ1mG04v7cTv+R9nDnmsuFS/z8iSBJxX0n6H5M3xwkm9z3/tWWKMI5n2SeKvcKNH7jo/lfsRAqT7dDN3dymgAJNm0qbqc47EDfmUQox7LSnMu0XTI02UIXuXDtq1CEqq9xSU8nfz/1DEMvJRzixcB5IzngS9qYuKvG/ZpVrv8QCybCs+I6StkMG3VELDUfKgpPVqnUdI5qiEz3bDAgd/DPbsUMSai03TYV2riApUVjTVU5Z2iZoJ/wG0bT7OISHBWY5fQjBRelNkti8r7k3S9n0hfrxTk2KxkvrHxHUDlzURti6HHxSw5Z92miY1LuAyTmJk1YqgExiqf4zJ2obhMz3iQ14eCGuvEYLfn4qGDW0fg95670K2yhAPxA1idT/ScyaRetJo/bOAEO9c2B3AJUre3hKzwVo7g/eLaTCUEXWRroIOZrTKyJ6lnvjWcfhlSrfB4pbDxtBdKc2SqvLnMpcM9T0= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2019 23:04:44.2264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e86e2231-3608-492c-173d-08d77aa0aee6 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2756 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SISAzG5pWzKNruOhLY5Js+5errYWNNPStldytO77+28=; b=rIRbYAH9UJNXfc01ABQs+aXmKPNSqC03s210fHkj99LeULWBVX/XANCKh6iRlne/59gOJAiQnxodIP50XONkJ4z+j4yw/p8O5Z+hPyRmf4TLkZLjjh9TsifrFQeC1xKTCCRgoF0fmHHhcd8jJ2Q0Yq1f1ytB4VN/tBAO7MTdFLk= 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 , "David \(Dingchen\) Zhang" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [why] We need to minimally initialize the remote aux channel, e.g. the crc work struct of remote aux to dump the sink's DPRX CRCs in MST setup. [how] Add helper that only initializes the crc work struct of the remote aux, hooke crc work queue to 'drm_dp_aux_crc_work'. Then call this helper in DP MST port initialization. This, plus David Francis' patch [1], fix the issue of MST remote aux DPCD CRCs read. [1] https://patchwork.kernel.org/patch/11217941/ Cc: Leo Li Cc: Harry Wentland Signed-off-by: David (Dingchen) Zhang Reviewed-by: Harry Wentland --- drivers/gpu/drm/drm_dp_helper.c | 13 +++++++++++++ drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++ include/drm/drm_dp_helper.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 2c7870aef469..cc4845d0fcb8 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -968,6 +968,19 @@ static void drm_dp_aux_crc_work(struct work_struct *work) } } +/** + * drm_dp_remote_aux_init() - minimally initialise a remote aux channel + * @aux: DisplayPort AUX channel + * + * Used for remote aux channel in general. Merely initialize the crc work + * struct. + */ +void drm_dp_remote_aux_init(struct drm_dp_aux *aux) +{ + INIT_WORK(&aux->crc_work, drm_dp_aux_crc_work); +} +EXPORT_SYMBOL(drm_dp_remote_aux_init); + /** * drm_dp_aux_init() - minimally initialise an aux channel * @aux: DisplayPort AUX channel diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 87fc44895d83..edafa182264a 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1945,6 +1945,9 @@ drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb, port->aux.dev = dev->dev; port->aux.is_remote = true; + /* initialize the MST downstream port's AUX crc work queue */ + drm_dp_remote_aux_init(&port->aux); + /* * Make sure the memory allocation for our parent branch stays * around until our own memory allocation is released diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 8f8f3632e697..b2e6923d5929 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1465,6 +1465,7 @@ int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]); void drm_dp_downstream_debug(struct seq_file *m, const u8 dpcd[DP_RECEIVER_CAP_SIZE], const u8 port_cap[4], struct drm_dp_aux *aux); +void drm_dp_remote_aux_init(struct drm_dp_aux *aux); void drm_dp_aux_init(struct drm_dp_aux *aux); int drm_dp_aux_register(struct drm_dp_aux *aux); void drm_dp_aux_unregister(struct drm_dp_aux *aux);