From patchwork Wed Sep 18 20:26:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11151239 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 1A52776 for ; Wed, 18 Sep 2019 20:28: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 021DB21920 for ; Wed, 18 Sep 2019 20:28:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 021DB21920 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 1877272B06; Wed, 18 Sep 2019 20:27:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820081.outbound.protection.outlook.com [40.107.82.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1637C72AF0; Wed, 18 Sep 2019 20:27:32 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LgdsGk/jc0E2ZKK5XtFWNMyGa2thrGtFXg/81Z+Ynxe1zjItyHhxJSbwgm6N9k/YupyqDWxPJvNgWGeT7LL3Mw2L1MQ8ixnpoodySDMTSF8qQbzdB28D+gdCKGCQ7Hg45YKYnVRe78vEabn2GaT2tIKboVjZEbJPtBZd8ZLwHhfP6wJErK8ZMo+5kNS8ElDNGeDwiestNmT2wopfi8860XijwLPtk5wJrjYLaA2b5a6TMDmhrw/r/sWXlZta+Bg77Fh2ZeZUxSLR4AM+XgwFS4c9dg5RGjXPMMIJgYxr5jjY70qDY85//YcQCMNqB/eq6qN5EyoXz6VUARxePOkZUg== 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=5lWslRekWJFGzUwyn//7oOW0PfxNkaj8ERLpHjAILY8=; b=Vt2SdRjdvrZ3MEN6viAvRzKl7+R0DVXIWs7vZlIRQgB+wz16127CallqVIPWZzyaMAZNNfoPyq83AWbXKzPYJc3vPBgHFLDf/plX/opKQSkcGuOTJsWHTtQ3MQm6LREvW2/RN73wp7Ed1lNSAXHeOex+id+KCstVSmkngz8cZF6EdjoEdvFvHY0tWo/nX0b2lFq3v3x8jUhcJAnhCAEiXdpf3lQKbCXbyn/Bu0YDPgFwv89byOFfPpRRi0i98sTCi4U1ilBa9dKbyjZ9sjhWuN3WqROSxw11x4eSIeI75i7SB/fux1ss10rll7ELzAIflg0CHwAoV6089q2U/IrnNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from CH2PR12CA0008.namprd12.prod.outlook.com (2603:10b6:610:57::18) by MWHPR1201MB0095.namprd12.prod.outlook.com (2603:10b6:301:4e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.13; Wed, 18 Sep 2019 20:27:30 +0000 Received: from DM3NAM03FT014.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by CH2PR12CA0008.outlook.office365.com (2603:10b6:610:57::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.19 via Frontend Transport; Wed, 18 Sep 2019 20:27:30 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT014.mail.protection.outlook.com (10.152.82.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2263.14 via Frontend Transport; Wed, 18 Sep 2019 20:27:29 +0000 Received: from mlipski-pc.amd.com (10.180.168.240) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Wed, 18 Sep 2019 15:27:27 -0500 From: To: Subject: [PATCH 09/15] drm/dp_mst: Add new quirk for Synaptics MST hubs Date: Wed, 18 Sep 2019 16:26:46 -0400 Message-ID: <6b11214d7aaa5bff6ba60846a1569b6f2ac25b0b.1568833906.git.mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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)(346002)(396003)(376002)(39860400002)(136003)(428003)(199004)(189003)(50226002)(186003)(126002)(11346002)(8676002)(53416004)(81166006)(81156014)(70206006)(486006)(70586007)(6666004)(356004)(478600001)(336012)(4326008)(8936002)(2351001)(426003)(118296001)(16586007)(50466002)(76176011)(86362001)(36756003)(7696005)(2616005)(446003)(26005)(476003)(51416003)(47776003)(305945005)(14444005)(5660300002)(6916009)(48376002)(54906003)(2876002)(2906002)(316002)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0095; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 296e7261-c8e9-4a29-43da-08d73c76a0ae X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:MWHPR1201MB0095; X-MS-TrafficTypeDiagnostic: MWHPR1201MB0095: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 01644DCF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: YhWSJd8kgDMhSLoj9ev58z6jMSw1koSvtXvphMQdPxGFfai289xj8zFQAHJ22kmA2+l+bwjsOz6ZNggGA1piRODKphPC1Sm7CruWkGAMrjcColrYCtqsFbpIOqgHuZqbrLIDMTOKs0dsGQ0mwQ9t2G3pyZUM0WQovKSz9/N2EOrnOagH4A/fc6awfCK5W3Ukep5A+/BydDNn4y+4Rp0ISGxNfS9JrfsDejbsBos2AsFI4nnCB3wFin9gGlwKJHGJCw8lztnvCvNJJFwYv0RQMoSd/YXgU1EvAtj7QMlVA11aVQwcDSolmDpwUV/ZiSLv0LcqBSoW7AkcW7hMuyLej3NmfebE8COjS7faVIGg9GTDgu1SZwoZGhTVy+y3VBlO7wYl8YrElwU3SCWzf7hY7V1VlIJKq+QVRnbZd9DG12s= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2019 20:27:29.4826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 296e7261-c8e9-4a29-43da-08d73c76a0ae 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0095 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=5lWslRekWJFGzUwyn//7oOW0PfxNkaj8ERLpHjAILY8=; b=zE/wZqcIqM/Y0RNGGgCumAaC+yL0Cj+GcjPdUyaPhmA2Qtp0HQI9QFMifqfOCgYsJQm3jokUqQ7vCJhcHYYQ2iZRVDmQuk+rAyngOBkpOxFOzAyrWVc9EnZhPycjKx7WcJbcWBYkN5yxhjHa2nzAZZNwHdWLC46Hm6nMv5u3toY= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; 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 , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: David Francis 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. Change-Id: I9d332f273dfca0cfbced111e62f5a06c5c312893 Cc: Lyude Paul Cc: Jani Nikula Cc: Harry Wentland Reviewed-by: Wenjing Liu Signed-off-by: David Francis Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_helper.c | 4 +++- drivers/gpu/drm/drm_dp_mst_topology.c | 27 +++++++++++++++++++++++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 0cbf10727bd6..c3e1da78e442 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1288,7 +1288,9 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { /* LG LP140WF6-SPM1 eDP panel */ { OUI(0x00, 0x22, 0xb9), DEVICE_ID('s', 'i', 'v', 'a', 'r', 'T'), false, BIT(DP_DPCD_QUIRK_CONSTANT_N) }, /* Apple panels need some additional handling to support PSR */ - { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) } + { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) }, + /* 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 dd2ca065cc92..4e493d8af288 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -4219,6 +4219,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; @@ -4271,6 +4272,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 6ae1a6765f63..919ad940bfb1 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1414,6 +1414,13 @@ enum drm_dp_quirk { * driver still need to implement proper handling for such device. */ DP_DPCD_QUIRK_NO_PSR, + /** + * @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, }; /**