From patchwork Thu Dec 5 16:55:04 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: 11275213 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 DC750138D for ; Thu, 5 Dec 2019 17:04:12 +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 B4F9424651 for ; Thu, 5 Dec 2019 17:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4F9424651 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 F19026F8B2; Thu, 5 Dec 2019 17:04:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680047.outbound.protection.outlook.com [40.107.68.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE23C6F8B2 for ; Thu, 5 Dec 2019 17:04:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GsD87TJFnW/Ig3DjIxo0aUKtymsOPb/w563vWwcywSimMCFP3tKX4UP3CJ/mFl7OMXgubNWXTVmPXbizkEuDr3xalHv1qitIv6MBPm+1SYudMJeWo3TRVOznPxY5mVQKiPAg9LKiuuHajS8WN3MBEb9MqoA2QcYEnladQReJk6AgT3sFGdawaXZMQ7lPoLEy7F+LxN4xI2fikfMB9z+4sj5eXNBCabyIaGGiaIxxQlL4Q2OBmPFJfyxdzqYyWbsP9VHFF4T0vt4Bw9G1RmhqlU2ax8BG2337h/VT/PCMauJfaasX6eBYS6r/7o4rQSV5o8KStpvJHAPMZDod8RedOQ== 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=weltssFBQbPN60FHq+C12HZrCOO8tu1rUHB6JQbHNZ0=; b=alWs2hCN1UwoZ69Kkht4Bmn+t8YddGfY0KIzalMLBg+7VdvVW86CeUxt6Y1imcpJ6dzBZkU0NHfF95muKrg1xKVljaihKDoGFkq3kTW8TqmjVemf7Pxbv1e1BtU0zSvEewHP9zUU4cF2BBY4Ka3/oDnaVwp+9mktD0NRd2xGeg20q5F7MpS+F7MuxYGOpjOfup6Wkpju7V4pSRXK1rWQ3umhtws96UCAcDVgGLK4gJ3PVg68hlyZHXf+IPXZsytNEZd26ijgOOKpXpHyOLLb7FrRrLf23Qduj89OPfzFoCCOiwIfB7CR1rr+j1RBn6yMLvCyp2syezXrGY0wi/XZfg== 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 MN2PR12CA0006.namprd12.prod.outlook.com (2603:10b6:208:a8::19) by CH2PR12MB3783.namprd12.prod.outlook.com (2603:10b6:610:2f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.12; Thu, 5 Dec 2019 17:04:08 +0000 Received: from CO1NAM11FT068.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::208) by MN2PR12CA0006.outlook.office365.com (2603:10b6:208:a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2516.14 via Frontend Transport; Thu, 5 Dec 2019 17:04:08 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT068.mail.protection.outlook.com (10.13.175.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2451.23 via Frontend Transport; Thu, 5 Dec 2019 17:04:07 +0000 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Dec 2019 11:04:06 -0600 Received: from Jiraiya.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 5 Dec 2019 11:04:05 -0600 From: "David (Dingchen) Zhang" To: Subject: [PATCH 1/2] drm: add dp helper to initialize remote aux channel. Date: Thu, 5 Dec 2019 11:55:04 -0500 Message-ID: <20191205165504.3682-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)(39860400002)(396003)(376002)(346002)(136003)(428003)(199004)(189003)(356004)(1076003)(50466002)(4326008)(316002)(53416004)(48376002)(478600001)(16586007)(36756003)(26005)(5660300002)(186003)(7696005)(50226002)(2616005)(426003)(305945005)(6916009)(70586007)(81156014)(70206006)(54906003)(8936002)(81166006)(8676002)(2906002)(86362001)(336012)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR12MB3783; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c551c48-2fd4-4da9-fcac-08d779a523bf X-MS-TrafficTypeDiagnostic: CH2PR12MB3783: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 02426D11FE X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F7k3Vv/F+8k8BgOixVHuoPjMOeqj9zALFus4u9ltdRebCJVN2549xwj7fJHnbvOu38cCW5mqj3Whx5F8FkoNNKRi1bAvPCF0rX2v1uTOfYfJImAmWA/shwfGK/Vs2Z57NwalHYtl3JyrS7z/m27a3ZAZPabLAhbhMWK35Rde0mOi/wlrm3uhwXCuwp8iKAltFQsARMU0+NG/GJCvhzqM72gLfkhCb2rxKgRbMpGhhfbynmCNcJGb3zXqPyxYWeIwBcxEhTkqxfgdSONvH3IqplsLEBNuiydtV1ZpHT3VygIjyijyat+f8/cH74R7eYGROqEIOehH1ryi2i4zUpmKJGa3tvJOUKGOfGvq+g5VDffhJhoaI0TpfV6UQ8xmyxPr8qaHwooRHMD0nhAhnuzqlOgKOLjFlb3efo+k2vEg830kDiSJoFanujDNVn86mrCw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2019 17:04:07.0922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c551c48-2fd4-4da9-fcac-08d779a523bf 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3783 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=weltssFBQbPN60FHq+C12HZrCOO8tu1rUHB6JQbHNZ0=; b=P7CZ/apF5+aoTRP6VS18IPlPy1rJm4or3PtTjNlJTlSHC4wB2cAn/GIxZK2j5CO6veAzxFMPstEHzxfk3j8ezBjid8G0X3QLeMEOfTOu+x+1dBsoVImrSRBP2L/XOydHu5na6Ra7UYEjlRMWMUC8C/MESgObQYEIXyshvfM+4qQ= 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. Cc: Leo Li Cc: Harry Wentland Signed-off-by: David (Dingchen) Zhang --- 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 fc39323e7d52..37312593dd0a 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1091,6 +1091,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 d5df02315e14..4308316fe211 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1642,6 +1642,9 @@ static void drm_dp_add_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 61ef351c5fca..da0a69f10e38 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1403,6 +1403,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);