From patchwork Sat Nov 16 22:01:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11247749 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 1113A913 for ; Sat, 16 Nov 2019 22:02:03 +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 ECA892071E for ; Sat, 16 Nov 2019 22:02:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECA892071E 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 EFB306E1E2; Sat, 16 Nov 2019 22:01:43 +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-eopbgr800054.outbound.protection.outlook.com [40.107.80.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5883E6E1D2; Sat, 16 Nov 2019 22:01:40 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KIxMR/lkNL4JunN1bMO7RGTUT7kHdwjhyp8Z+Nvtis567cBgQkpUQxKC+rjsOaEpfjZc0zIttaQaa6XzV1qAOWxhd+w1gqQqXYUImWoEh89HgNbxVOHrpjHTTkbCsRe43PT8UKX4yNKcsYFA4Q51/sXyd6utg2Dj5XFtMQqrs1xMpcHRFvWrb48nmcDBMs3pOVPurTwXELpF5gBbRZoEMTQRD58Vo7kHEJbgrWbJFjyKRISZpTs8VpQ5QGQSxcZ04M8AFTKNbTw1z6f5mCqbT7BQlfqaFJuVmD3wtyXsAg7ELFg1pU7YWSWE+NA+tEHsgc94F1RK10z0pcGrIovzQg== 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=AgyghqZPyHZGC3zf3py8T8uMDqL40rRqKDDvrEGsZH8=; b=kFPDGJBGOpjHKm6aIvIbNFTkY7fUcwBmyzrpf4muNKXIJ/pFhTE0vHzf1z3WoWaGlEUhTkALilXu1j/qjkhEADAEx+utLSOROIn68UMB1gIOHoeE89qz+QGoiYhkzcOO5fk8niO8LuQi5s2Rj1YfLtF0Ccp44rtQX6H3Qrka3Bcs/1czwz5xdDuIhjZJOBC0YQuNDzfMECfKfRprrG6mLt6XL0H23JUpiUx4upJzJyAtfpsJIT4j22tytqOtxuQuZVVlrIT6VVWncSlvDeF8FMuIKtbuXIr3vmlNYDHHEA/irIWM+2tkmI/sQhOoy5YYYY5UFlmvauvFz6hFkykUyg== 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 CY4PR1201CA0007.namprd12.prod.outlook.com (2603:10b6:910:16::17) by BN6PR1201MB0177.namprd12.prod.outlook.com (2603:10b6:405:4d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Sat, 16 Nov 2019 22:01:37 +0000 Received: from CO1NAM11FT025.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::204) by CY4PR1201CA0007.outlook.office365.com (2603:10b6:910:16::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Sat, 16 Nov 2019 22:01:37 +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 CO1NAM11FT025.mail.protection.outlook.com (10.13.175.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2451.23 via Frontend Transport; Sat, 16 Nov 2019 22:01:37 +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; Sat, 16 Nov 2019 16:01:35 -0600 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; Sat, 16 Nov 2019 16:01:34 -0600 From: To: Subject: [PATCH v7 06/17] drm/dp_mst: Add new quirk for Synaptics MST hubs Date: Sat, 16 Nov 2019 17:01:17 -0500 Message-ID: <20191116220128.16598-7-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191116220128.16598-1-mikita.lipski@amd.com> References: <20191116220128.16598-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)(136003)(346002)(39850400004)(396003)(376002)(428003)(189003)(199004)(186003)(336012)(26005)(4326008)(8676002)(7696005)(76176011)(51416003)(6666004)(356004)(8936002)(2351001)(36756003)(50226002)(86362001)(6916009)(81156014)(70586007)(70206006)(2876002)(2906002)(5660300002)(305945005)(16586007)(81166006)(478600001)(54906003)(316002)(426003)(48376002)(50466002)(1076003)(53416004)(2616005)(446003)(476003)(11346002)(486006)(126002)(14444005)(47776003)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0177; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca4ec11f-d531-4dff-b469-08d76ae08d7f X-MS-TrafficTypeDiagnostic: BN6PR1201MB0177: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 02234DBFF6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c7nIHU9hWlRktgmOadTMmL5ihAGKp4VU8SuRhXzcD1gAuuQqBjjGWtTJMrAJ/5U0jarAhJDxytAZCZSdMevQ72DXL345F7TJsvKRoZY08PCtpi57fTlb+eGpBCdv0ky/eExVgg2MEzjLozJI4m0V3C9JeA/L71h15AkQF0PUX5Gpc/DoRMgoE9oONhmC4mT7w5WT4WfI/zaWyjqKtliuVFIDBFEs6234E36vadyuGIXDYB+SIU5p3VuuNQYvtp3unoLijIT0s8xloHFmNJlP5+SkHrlkCD27v5smd+NZQuxNoEoHfas1JHzGZI6I4ZbJc4tepTr3RhRpzHboAMPjFt3GHQIhlrfgh6pfX4A1znLCDc75D8gtogaNIW3SpmdWekEkGB00g6a8XvV44FKqJQXJpVLc8nLG68sLkzakjQqgXh1kLZEaDUqwOqq8LuDz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2019 22:01:37.3807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca4ec11f-d531-4dff-b469-08d76ae08d7f 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: BN6PR1201MB0177 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=AgyghqZPyHZGC3zf3py8T8uMDqL40rRqKDDvrEGsZH8=; b=gdI7u2IknckzE+2HIv0uXxqjyYbEJYruWF9XC80VxjuJfEcxr659uHrMfbNRw7RARST1K7Ht30YOtFZA9r9ivOatns+iKuQFMWXwj+B0dKaIuAhI8zcXQWJDnatzkbrM1aftFeGHjes0mUavkwnMCn/1FGDYiQSiGcsgbWPhOd0= 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 Signed-off-by: Mikita Lipski --- 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 5a795075d5da..5ff59e9bbbb1 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1464,6 +1464,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, }; /**