From patchwork Wed Aug 21 20:01:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Francis, David" X-Patchwork-Id: 11108105 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 01C881395 for ; Wed, 21 Aug 2019 20:02:23 +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 DE4412339E for ; Wed, 21 Aug 2019 20:02:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE4412339E 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 3255A6E9FC; Wed, 21 Aug 2019 20:02:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe45::60b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 817B86E9F6; Wed, 21 Aug 2019 20:02:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+w5DsRTHL/HOXKb5hCEthpdsTlELohiv1IeYEyBE6gNpbfDuSOCLvZOV2pSwhGq0h+yQxK2+6zwpdDo8Ehr0RRBg/LOAk6SJ7eN8vuVf35S5pFqAWjjpgVGIHe53SwAhMJGqLoRiVgWD1f61X1Bl2BUctDpc1OCKtR3+6Vjs6os84UsTzya3YjbKI+b8k/1we6k+X9wlE/mEERgapZJS+HCCUqfQqMFu1OEIPFBq7u/6nVOvYmBHXRlfJxtBsIGsv8tr1n51SGPg5X6TaET1sup8nzf6oH+myZ/sraiLO6fu47l7cUCc94uZeNgZ6hd8ZPMtc/gs10GCyHFm6k2Hw== 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=xfOgLC2cSAo9yGSTfY+3+Nfr0DItAcG8Mx1Heg+YsCU=; b=kmXE9elYKHzu6+H5W1lj7/PkgQ1fi16a0Zhvs31I2KqPu/y72ch0H7F1/AwKGrslXCmU1Hlnc+lgSZ+x2dcw8b6I/Zrfaohd/gY2wAPyL0nUvwU9bWr+DdneOyhHnufdULq851JZI6zblxnqBY6Rh8b8WCBEmVlyyNetwwFVgY7hQT9lFS0xAXPdXtu+UA+NMTbIFmoOHVqO+m7f7m92qnC7m9HtMCG5nYGXKdAXkn7XwnX+gUKZO5tgK8CLgFsy8pmVGoisBnV4DBFrSlOQ9cUN4bH4bMe1pgpNNeI2woVi1fQQuWVl/SNuC3oOfdRgoG5k+XqVuYyDxZBfE78ASA== 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 BN4PR12CA0009.namprd12.prod.outlook.com (10.164.241.19) by BN6PR12MB1267.namprd12.prod.outlook.com (10.168.224.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Wed, 21 Aug 2019 20:02:07 +0000 Received: from CO1NAM03FT063.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by BN4PR12CA0009.outlook.office365.com (2603:10b6:403:2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Wed, 21 Aug 2019 20:02:07 +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 CO1NAM03FT063.mail.protection.outlook.com (10.152.81.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Wed, 21 Aug 2019 20:02:07 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Wed, 21 Aug 2019 15:01:43 -0500 From: David Francis To: , Subject: [PATCH v3 13/16] drm/amd/display: Validate DSC caps on MST endpoints Date: Wed, 21 Aug 2019 16:01:26 -0400 Message-ID: <20190821200129.11575-14-David.Francis@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821200129.11575-1-David.Francis@amd.com> References: <20190821200129.11575-1-David.Francis@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)(376002)(136003)(396003)(346002)(2980300002)(428003)(189003)(199004)(81156014)(70206006)(50226002)(6666004)(356004)(54906003)(110136005)(476003)(14444005)(478600001)(36756003)(70586007)(5660300002)(486006)(86362001)(126002)(11346002)(446003)(316002)(53936002)(2616005)(16586007)(186003)(8936002)(51416003)(450100002)(49486002)(50466002)(426003)(8676002)(305945005)(4326008)(2906002)(1076003)(48376002)(26005)(81166006)(76176011)(336012)(15650500001)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1267; 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: 4f94a424-08e6-47f1-d8c8-08d7267271e4 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:BN6PR12MB1267; X-MS-TrafficTypeDiagnostic: BN6PR12MB1267: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 0136C1DDA4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: kXuNmBpyw+FOO60pEVv78Qg315uh8xaoNxAqnUJbPAsFW+gExdubRhe04guVUHxZ1NZGkXQBzobr6D9gwuojSWzZH56NL0hXEm5Nb4WdmC35Ybzn9ixuRD9SG0lswyxTfim941trU3OXB4Ug2x+LK1/sf3Lo/JAGW8GfnOPDIkT+5+A0pdGB76TSHLBu3BvbWkGIi48u4y2OlYDGKxunkKQZ+pZXgt3ne/7A4b671XlNPpKDn/cHj2S8zHO8eisPGmfUMhN4y3z4gsaNW5aPyhUBOFzqMxaS8B2gWTBVYPpzVJeGhcxJMbhwaFeFmKtfxeGPJyblRTArJMewBtuuOnEMtg+bFDH91xt43GJl89TSbV/HYrRyDosjkVom+7bZZmJIGLvZxixcxT9O1fPfaHZ4tEMvxR8cZYJgOQl/csk= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2019 20:02:07.2402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f94a424-08e6-47f1-d8c8-08d7267271e4 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: BN6PR12MB1267 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=xfOgLC2cSAo9yGSTfY+3+Nfr0DItAcG8Mx1Heg+YsCU=; b=ISKoZ+qgjUGF2o21XxCwYTEvSx3Ep/8CJMCtv4KKsZi6lCjp/jXn6OqZMlDzCUof8XNTU9VihQFeOVG2YwaBYWNOnJxbUSbl8X7CjReyNttrpuFfn4F7zfRZz9UN1PniPLXsWQbf7W1JYzLWhRgpSOrW2+iv89TOujOWfLU10cQ= 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 , Wenjing Liu , Nikola Cornij Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" During MST mode enumeration, if a new dc_sink is created, populate it with dsc caps as appropriate. Use drm_dp_mst_dsc_caps_for_port to get the raw caps, then parse them onto dc_sink with dc_dsc_parse_dsc_dpcd. Cc: Wenjing Liu Cc: Nikola Cornij Signed-off-by: David Francis --- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 16218a202b59..9978c1a01eb7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -25,6 +25,7 @@ #include #include +#include #include "dm_services.h" #include "amdgpu.h" #include "amdgpu_dm.h" @@ -189,6 +190,24 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { .early_unregister = amdgpu_dm_mst_connector_early_unregister, }; +#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT +static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnector) +{ + struct dc_sink *dc_sink = aconnector->dc_sink; + struct drm_dp_mst_port *port = aconnector->port; + u8 dsc_caps[16] = { 0 }; + + if (drm_dp_mst_dsc_caps_for_port(port, dsc_caps) < 0) + return false; + + printk("Validated DSC caps 0x%x", dsc_caps[0]); + if (!dc_dsc_parse_dsc_dpcd(dsc_caps, NULL, &dc_sink->sink_dsc_caps.dsc_dec_caps)) + return false; + + return true; +} +#endif + static int dm_dp_mst_get_modes(struct drm_connector *connector) { struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); @@ -231,10 +250,16 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) /* dc_link_add_remote_sink returns a new reference */ aconnector->dc_sink = dc_sink; - if (aconnector->dc_sink) + if (aconnector->dc_sink) { amdgpu_dm_update_freesync_caps( connector, aconnector->edid); +#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT + if (!validate_dsc_caps_on_connector(aconnector)) + memset(&aconnector->dc_sink->sink_dsc_caps, + 0, sizeof(aconnector->dc_sink->sink_dsc_caps)); +#endif + } } drm_connector_update_edid_property(