From patchwork Tue Oct 29 13:52:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11217949 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 76638112B for ; Tue, 29 Oct 2019 13:53:22 +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 5CCA020862 for ; Tue, 29 Oct 2019 13:53:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CCA020862 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 ED3BC6E3D2; Tue, 29 Oct 2019 13:53:04 +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-eopbgr770045.outbound.protection.outlook.com [40.107.77.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FAB26E3C1; Tue, 29 Oct 2019 13:53:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TM4EjLXrx0yATGfzYx1pDL9atwp6sGQBAdAJd6A5pJWwZakn8Xc9ECjyMNEWWFHpoKUpY2Uu3uPxolBm2bUzMcG9wZYYePPo/aOdbvYnu2/6pO0kVazstXCA2r4HCZxSCq3XEX+0JbOqTYOBh5aHf+WDWZet6eBINxTRAi0HPkPJ9ffibKU+oWOTykjeG+ug5WkBd/dnRZHFq3G8aQVTVbgWvgFQLdek0EemDbKiOAAQXPgytspbrqB4hFf8QKgr3PVMqz6pLAUuMUikJAVVDUOVIlQSPSyzaBH2cVRzzxjv96xlFkejft3RO+Pf62POtsF3xNwSJKxpOX6q/TNd2g== 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=fnEiCA6Vgu/cT7PLsH3dGseoeVDmyywcZLnSA7pfB1A=; b=RHWtciqcsDBDKZ4JnCUGDLJf+wggYa3xEYjipStr1cic/6PlL368taxjAoeh7qz3TgoetajX+tuSmBsKWpEDlP7eeE6XwBDDF3vRQS+bHgMIhmt7Bdf1dB1WIceaa6Wa1zBFYCWcasozIJU/0l4oDxsh/xADn27s75QABl4Gr3n8vuG2aXGrl4d/4DKLwWj7UOBJPmUPYvQfookEopec59p2vMiwaq8OC5x1xWeZRXajhu2K4sf7U+H3r6w8Xf0Dp6TlS88OZN9LDbHKDA3Zl7UYcGW3rCY/BcnypqL2PMQ+Y6jAZm5OQcq/LIqXP+2AF5EUWI8vVyy/bSdQijGzPQ== 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 CH2PR12CA0018.namprd12.prod.outlook.com (2603:10b6:610:57::28) by DM5PR12MB1914.namprd12.prod.outlook.com (2603:10b6:3:109::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.17; Tue, 29 Oct 2019 13:52:57 +0000 Received: from CO1NAM03FT011.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::202) by CH2PR12CA0018.outlook.office365.com (2603:10b6:610:57::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2387.22 via Frontend Transport; Tue, 29 Oct 2019 13:52:57 +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 CO1NAM03FT011.mail.protection.outlook.com (10.152.80.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2387.20 via Frontend Transport; Tue, 29 Oct 2019 13:52:57 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Tue, 29 Oct 2019 08:52:56 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 29 Oct 2019 08:52:56 -0500 Received: from mlipski-pc.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; Tue, 29 Oct 2019 08:52:55 -0500 From: To: Subject: [PATCH 07/13] drm/dp_mst: Add new quirk for Synaptics MST hubs Date: Tue, 29 Oct 2019 09:52:39 -0400 Message-ID: <20191029135245.31152-8-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029135245.31152-1-mikita.lipski@amd.com> References: <20191029135245.31152-1-mikita.lipski@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(376002)(136003)(428003)(199004)(189003)(26005)(476003)(2906002)(478600001)(8676002)(186003)(1076003)(2351001)(2876002)(81156014)(486006)(54906003)(36756003)(14444005)(76176011)(305945005)(86362001)(7696005)(4326008)(51416003)(50226002)(316002)(81166006)(6916009)(70206006)(336012)(356004)(5660300002)(48376002)(16586007)(70586007)(8936002)(50466002)(126002)(11346002)(426003)(53416004)(446003)(47776003)(6666004)(2616005)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1914; 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: 9feb897f-2b33-4576-b958-08d75c774e01 X-MS-TrafficTypeDiagnostic: DM5PR12MB1914: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0205EDCD76 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4YfVhW0jkyJHHJGcaMrJ76GH3KBsLkc/l+5MKsPoPp+VANH2whCGupoXdnvEWBEbUFFYSj7wg4PTC2w/cETEiHjCfHsonFRJJ6i6HREI+eJsBa1wvyEn2EGPl1C5CDWWOeQB/5p5zbPB6WKaVtUYHe0luvQQ4yQSvpDBLKlC6D+BrLxhLvRS9pSCadIRklIHa7rpMa6UROGsQRGeLtN77KbbY7yHHK6/F/HH1c8EywnjHihpTAPc/P7gRd0KrVZb5ruB7gR6MxZ4e7weCjyvMMLsSy88XT4vABPceTW+2eYX7DZJ7qd3KmBgG4MQPdZ0RjpJUje5RS1pl7pZMjcuXtfnIKurmy8DLqJ/2s/rWlsyrk9bpPZwvHzvKJInQpuxMRPWyJLDXPE+2u1YGcHkSJSO4/xQxSuAyD4dj0BQqdzX2P7zU9YB3t46F9HvcaRk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2019 13:52:57.4152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9feb897f-2b33-4576-b958-08d75c774e01 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: DM5PR12MB1914 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=fnEiCA6Vgu/cT7PLsH3dGseoeVDmyywcZLnSA7pfB1A=; b=4JRgrTo8af/OgclBJoiWdaCGa2IvQ6VSzyUCRVlxIJpaJGTdAiKvK7IBGC+8V9TSK5hjiYPWlM/hPBTMtrgoCXmsdUwdvg4X5L9lgqC3nOR8ZgCPSGJJN+Wv4rJDOqx3zTP/Iog9YakUNglw7NYekfhq+M4ioVPskIVgOFzcd8c= 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: David Francis , Mikita Lipski , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Mikita Lipski Synaptics DP1.4 hubs (BRANCH_ID 0x90CC24) do not support virtual DPCD registers, but do support DSC. The DSC caps can be read from the physical aux, like in SST DSC. These hubs have many different DEVICE_IDs. Add a new quirk to detect this case. Reviewed-by: Wenjing Liu Reviewed-by: Lyude Paul Signed-off-by: David Francis --- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/drm_dp_mst_topology.c | 27 +++++++++++++++++++++++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index af1cd968adfd..02fa8c3d9a82 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1271,6 +1271,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) }, /* CH7511 seems to leave SINK_COUNT zeroed */ { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) }, + /* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */ + { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, }; #undef OUI diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index d8f9ba27b559..d5df02315e14 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -4222,6 +4222,7 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) { struct drm_dp_mst_port *immediate_upstream_port; struct drm_dp_mst_port *fec_port; + struct drm_dp_desc desc = { 0 }; if (!port) return NULL; @@ -4274,6 +4275,32 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) if (drm_dp_mst_is_virtual_dpcd(port)) return &port->aux; + /* + * Synaptics quirk + * Applies to ports for which: + * - Physical aux has Synaptics OUI + * - DPv1.4 or higher + * - Port is on primary branch device + * - Not a VGA adapter (DP_DWN_STRM_PORT_TYPE_ANALOG) + */ + if (!drm_dp_read_desc(port->mgr->aux, &desc, true)) + return NULL; + + if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) && + port->mgr->dpcd[DP_DPCD_REV] >= DP_DPCD_REV_14 && + port->parent == port->mgr->mst_primary) { + u8 downstreamport; + + if (drm_dp_dpcd_read(&port->aux, DP_DOWNSTREAMPORT_PRESENT, + &downstreamport, 1) < 0) + return NULL; + + if ((downstreamport & DP_DWN_STRM_PORT_PRESENT) && + ((downstreamport & DP_DWN_STRM_PORT_TYPE_MASK) + != DP_DWN_STRM_PORT_TYPE_ANALOG)) + return port->mgr->aux; + } + return NULL; } EXPORT_SYMBOL(drm_dp_mst_dsc_aux_for_port); diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 6e17410a0417..61ef351c5fca 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1460,6 +1460,13 @@ enum drm_dp_quirk { * The driver should ignore SINK_COUNT during detection. */ DP_DPCD_QUIRK_NO_SINK_COUNT, + /** + * @DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD: + * + * The device supports MST DSC despite not supporting Virtual DPCD. + * The DSC caps can be read from the physical aux instead. + */ + DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD, }; /**