From patchwork Tue Oct 1 16:17:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11169221 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 CFF9D1709 for ; Tue, 1 Oct 2019 16:17:54 +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 B83CF20679 for ; Tue, 1 Oct 2019 16:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B83CF20679 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 A97ED6E850; Tue, 1 Oct 2019 16:17:38 +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-eopbgr720042.outbound.protection.outlook.com [40.107.72.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28A8D6E84B; Tue, 1 Oct 2019 16:17:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ImjmfSCFElzQHDG5devgSObcv3JAiMOEUri5A/04HoU0YilAwJNwEuuPwXYL+RGKvJfLllnOIGrlvzSL9IIuCCJ8Av1BnVilId5Fs3YEr3YaGw2vUN/mxp7vmZsgE2mYnldwy1nGTFq/T3rpU+f/jxKtuxu9/zN1iqh9Zj3/XX9xwB3rFBXGIQZSwnnGt+zix0mWqDddsJCWhTG52WKgc94kf+sTTEwBpwNoL/RErS08c7UulWKp+7P2vpp0pvNzF5XrxabWwXk4MXbsvEPMdodyNyspicEy9ffsoDXzRUS12fTN9hqlPGuE7PW3rLLeNaxUvQQ5Ql6MItlMTW15Kg== 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=K7xA58T2hbz0F/NcnJeC72jc4UVZ6stnu1hOnr43Geg=; b=ejlVRPf7lEiRTveH0BLsBiYVf/sirVBztVAcLfdrC5w3AXNTB7YvfOGAvRFQpodiFZ1HkwVxiB7EH8eQ7K4j+F1ihGCQB4py7z3a5mHmsvzyKRUj2NFTbDpgbUwl+A+k1uP02rBlk0SYTdqRy7FiViOveMzentitIRxQpOq/+fporkRmwK+/ZUAzSKgIZXViL0OB6oTEWy53P2dcHzwpSJ1ghNADTh3ANGXhD0CRDG3E5P8IF5Fp/N+sOaq6mZi2wS+YcRLdkDT1Fi/C9lJQohPLjjPbuLUoodpY85czwLNGQyJD8uh4UXK9RzfcATKWrS2hnljfVceJvdMIjSRfhg== 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 MN2PR12CA0021.namprd12.prod.outlook.com (2603:10b6:208:a8::34) by BN8PR12MB2914.namprd12.prod.outlook.com (2603:10b6:408:95::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Tue, 1 Oct 2019 16:17:34 +0000 Received: from CO1NAM03FT013.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by MN2PR12CA0021.outlook.office365.com (2603:10b6:208:a8::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.23 via Frontend Transport; Tue, 1 Oct 2019 16:17:34 +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 CO1NAM03FT013.mail.protection.outlook.com (10.152.80.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Tue, 1 Oct 2019 16:17:33 +0000 Received: from mlipski-pc.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Tue, 1 Oct 2019 11:17:33 -0500 From: To: Subject: [PATCH 07/14] drm/dp_mst: Add new quirk for Synaptics MST hubs Date: Tue, 1 Oct 2019 12:17:14 -0400 Message-ID: <20191001161721.13793-8-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191001161721.13793-7-mikita.lipski@amd.com> References: <20191001161721.13793-1-mikita.lipski@amd.com> <20191001161721.13793-2-mikita.lipski@amd.com> <20191001161721.13793-3-mikita.lipski@amd.com> <20191001161721.13793-4-mikita.lipski@amd.com> <20191001161721.13793-5-mikita.lipski@amd.com> <20191001161721.13793-6-mikita.lipski@amd.com> <20191001161721.13793-7-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)(39860400002)(136003)(346002)(396003)(376002)(428003)(189003)(199004)(8936002)(450100002)(51416003)(126002)(478600001)(8676002)(2876002)(16586007)(5660300002)(6916009)(2616005)(476003)(486006)(50466002)(4326008)(7696005)(36756003)(305945005)(186003)(70206006)(70586007)(14444005)(54906003)(86362001)(76176011)(47776003)(2906002)(336012)(356004)(446003)(48376002)(26005)(426003)(53416004)(316002)(81156014)(81166006)(6666004)(1076003)(50226002)(2351001)(11346002)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2914; 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: bc54d833-2caa-4146-c2ba-08d7468addfe X-MS-TrafficTypeDiagnostic: BN8PR12MB2914: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0177904E6B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZEoFogv1klxs8c2eluXaUBHuxU7VEqOrKSTlJ744UkthcNz9KJGgCWd41IJzJTl0XByv9AyN04mwJPLjYMbAP2sSoxPfWzoSZCUow5ebKeFUnJIVC0vpP2kW6NdYSt+MzesHfc81qEs1FXFUBlbXtzgzs0YV3yHyMCJ9jPxfpQnxM427KhFXYox40gUuFW7jlY4XZWHGNipAm3FTuPKo7ekGN7lW9MaY6bA0JuOD5Q+f0t77DZmDiqbyxYg99/5KOVQSeQ3x1oiPRCuofkOPlehxfvPp1tyhZLUQk/NGGBH+oF6pcl3wBcgMA6idY6F/OXK/h7qkD7tuQm9Pi/J/hI3obOi88FHNDfA5uT1knx33kDbZRQJNi69DQS8Sa+WnaGANUQVu/itoGoREv65x5iuykv4BbNgBAJdHWSf5PTM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2019 16:17:33.8104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc54d833-2caa-4146-c2ba-08d7468addfe 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: BN8PR12MB2914 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=K7xA58T2hbz0F/NcnJeC72jc4UVZ6stnu1hOnr43Geg=; b=l2hSiFF2T/6J+qYJiegxwnmBLDH6v5L00jei8fzhPcOygIj0PNNJQCyhMvGwEs6kCptRLWvDxX60667PZC4+hVDIZsnGGoZ745n7okLTt02xMYAJCMlH7WnwktPBfr7Zlt6w2AybcGUBXhPkoluBibW0l1PTPJHf86EyyJJdHig= 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 8364502f92cf..a1331b08705f 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1434,6 +1434,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, }; /**