From patchwork Wed Oct 30 19:24:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11219991 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 DCF4714DB for ; Wed, 30 Oct 2019 19:25:11 +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 C316D204FD for ; Wed, 30 Oct 2019 19:25:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C316D204FD 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 997786ED38; Wed, 30 Oct 2019 19:24:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-dm3nam05on062e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe51::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22A686ED19; Wed, 30 Oct 2019 19:24:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gcRTZ7Z/KzHZg21s/1Rp4uzqSEmx8TmiT0LKJPK+f/avexYiBibYhQmm8LcQerdwIXgX9a03Ccx22R2jc2wl9AJrgI20p1zBovvM5UYj5hy5l6Ql6N/w5sAQygntCy9GT5904GHf39o1erBLyaB1YuLUFhqpPBWMJscjweS+QN0Op98F8Gjg3g4UTMb5bmrtYKrLfjTwmdQu1W99NRU29dMUwR8FUBuQJEK8HPcwKj96UpufzMYxJWaLtu3/5iRFuCtRZ/7ddImLCGH2aXshT8KzQv+ed4QsbcXugMPqfvfW+xbCmbxz8Cwv34/Nt5PRmZh1xeSyfVF5exwM60N/aA== 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=kKbJ5/tbSD22pGn1Eu5ajryY9RZs2dxJuhPj7xAGf+pThnB9dQ7T40KW9XNeZ6q/XwR4NTj7mghImYu3qrNuIaXLzCeCuxF1c0JkhNu+pPp0bDAeBA5+0pUgTmAGzVal+GNujwTg3C957qyndIA80d53l6XZvqsnshCKhofZvD3AzSB+ffxWSrJigLYd/tT/nvYifZYyTx2f8wXJPpxw74m9JpivcJz4sL+Q+//8GCTwQQI+SdQm7SsYzUyuii+MFaqXQuvFdLMGFvJJM1pp9xPSvFo0wcdeoUY6uqD0cvyGsfCq2waZadb9uF1752UklgKAm2lN13j7M1XYUMCeIQ== 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 DM6PR12CA0036.namprd12.prod.outlook.com (2603:10b6:5:1c0::49) by DM5PR12MB1434.namprd12.prod.outlook.com (2603:10b6:3:77::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.17; Wed, 30 Oct 2019 19:24:42 +0000 Received: from CO1NAM03FT041.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by DM6PR12CA0036.outlook.office365.com (2603:10b6:5:1c0::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2408.19 via Frontend Transport; Wed, 30 Oct 2019 19:24:42 +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 CO1NAM03FT041.mail.protection.outlook.com (10.152.81.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2387.20 via Frontend Transport; Wed, 30 Oct 2019 19:24:41 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Wed, 30 Oct 2019 14:24:41 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 30 Oct 2019 14:24:41 -0500 Received: from mlipski-pc.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 30 Oct 2019 14:24:40 -0500 From: To: Subject: [PATCH 07/13] drm/dp_mst: Add new quirk for Synaptics MST hubs Date: Wed, 30 Oct 2019 15:24:25 -0400 Message-ID: <20191030192431.5798-8-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030192431.5798-1-mikita.lipski@amd.com> References: <20191030192431.5798-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)(376002)(396003)(346002)(136003)(39860400002)(428003)(189003)(199004)(356004)(70206006)(26005)(6666004)(6916009)(70586007)(4326008)(86362001)(47776003)(2351001)(426003)(446003)(336012)(11346002)(316002)(16586007)(2616005)(1076003)(54906003)(76176011)(7696005)(51416003)(186003)(8676002)(50466002)(48376002)(476003)(5660300002)(126002)(486006)(50226002)(36756003)(14444005)(305945005)(2876002)(2906002)(81156014)(81166006)(53416004)(8936002)(478600001)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1434; 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: 09c2e6ba-7105-4b25-6eb9-08d75d6ed067 X-MS-TrafficTypeDiagnostic: DM5PR12MB1434: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 02065A9E77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LFdB7Z8En2t2TC/DAc+8EDGQD2lGcYxRCaDckwgx5MXPOhUQ3SbazDhjbRetdBIq067S90WaNb33g6VrXv75kvhFIUBONxMl3NHbTbqDRkkdKMiZTTG9Az1yTkem0XJfxJxjx8MXIn6HzlCh1e8nPNoeCj/ElNP0uBDBYNV17Zw/JWPJFBTSh8eLaVhfsNCNvqV9Ifzo/jr3PiNaMekqJGDTkwUg48dPu+XA89iwZLwg3tGXK51hoACnBY1Coqk047wHMG3Q0YhnOugjji9G7dyRMmUVp6J3Birb/8VkAyugZ/T5qU4aC2qvBUTxeq7K5EbZOZgiH8Dmmn1Zn8b+Ab1ynNgI343vnwnr4uI46VtuHyx3J/zT5qDvciAuu2YkRlLKXDRcBJ9sl7dZ49z+YhPWzHPcIPgesyYOlPoCH2i59rYZSFiVZIvvhrKYid8W X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2019 19:24:41.8798 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09c2e6ba-7105-4b25-6eb9-08d75d6ed067 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: DM5PR12MB1434 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=VKagFxki/7v/xqKHJKrCDT4opIB0Dk6WIVpfiEoFF8hKVDfd1yQTmXPH/KWkhk+lPRzGInC5NaJVVqOivyn6Mt3trmMvkHLQaz03Cp2ImwDuK2qgel61kn8Ul49U/Z4k5oMMwj/lVfDzlFk5D731zvbHRyov5y+Q4QD+Wi9Je24= 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, }; /**