From patchwork Tue Oct 1 16:17:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11169223 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 A359917EE for ; Tue, 1 Oct 2019 16:17:57 +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 8BCD82086A for ; Tue, 1 Oct 2019 16:17:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BCD82086A 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 78CE96E853; Tue, 1 Oct 2019 16:17:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680079.outbound.protection.outlook.com [40.107.68.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF1E66E852; Tue, 1 Oct 2019 16:17:40 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRRhxUiof5MfZd8ERy+sDov9IxAY5vBl/5zJVPFXH15B/JsBm2amD4I2DmxoSAdQleF0YkXXKzW8d+5fUW7PpZXHlzCPtWms89iI5hBfSKMnO3UNMRUDmqa6yXIEwzjOgvh+NaAyTfyKQzGU84XYwcArCGML6sK1pf/rA+ubXyZyqyWsHvFFODesRFf+YNLP9UgBCfEmoJIO7NvhsgPRVehNrPkucGNQcrXqsb7u5kJBwmLpP81UyBvqlRn82IAhPlLEly5FitxOjp4tAZMvwucsNlBPZ+JnyEA3gtcHl15fnI0gerzvASLCaNy2FNQubc8BYD2RAn0XW273IrFY+w== 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=PnBHuuiuQ1sajCrfHlq7oqhaie/z4McnjjT9VodgMm4=; b=gIOev/cuTfMa7JlXiWuQIVifzp0s6g2Xibgs5j1haeGgiNYmjPNv0G/LDTdU/TvpzG8pyyo9BzG0vHqIO+R8GlIr9lM/c6cnL2zB7D37SBzvsQccpKNTalwjJ7wayZsV62oIdL7sNqXm+imPloanldLX+lE/wqgrUZYkX8LHlp05aMFvVZpK9j9ynXtV1MV6PJRqpFCqG6N+BvcHf3dDogtwQOuD7hWcyMB3xxzfa2L/PuwXQr/jUnohlnAmULIWf1y879jzHOW5t0RNfxPa8Y4f++DRCsCf6e85tpkSI/KSd0b+9X0p/o0f3Joz5oAxrnkHHmZskVOJOAwVrbtryg== 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 BN8PR12CA0016.namprd12.prod.outlook.com (2603:10b6:408:60::29) by DM6PR12MB2635.namprd12.prod.outlook.com (2603:10b6:5:4a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15; Tue, 1 Oct 2019 16:17:39 +0000 Received: from CO1NAM03FT027.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by BN8PR12CA0016.outlook.office365.com (2603:10b6:408:60::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2241.18 via Frontend Transport; Tue, 1 Oct 2019 16:17:38 +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 CO1NAM03FT027.mail.protection.outlook.com (10.152.80.161) 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:37 +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:34 -0500 From: To: Subject: [PATCH 08/14] drm/amd/display: Use correct helpers to compute timeslots Date: Tue, 1 Oct 2019 12:17:15 -0400 Message-ID: <20191001161721.13793-9-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191001161721.13793-8-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> <20191001161721.13793-8-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)(39860400002)(346002)(376002)(396003)(428003)(189003)(199004)(81156014)(8676002)(1076003)(426003)(186003)(2876002)(356004)(6666004)(336012)(5660300002)(8936002)(47776003)(81166006)(50226002)(48376002)(2351001)(53416004)(50466002)(86362001)(316002)(16586007)(76176011)(305945005)(70206006)(70586007)(478600001)(54906003)(4326008)(486006)(450100002)(11346002)(446003)(476003)(14444005)(126002)(2616005)(6916009)(26005)(2906002)(7696005)(51416003)(36756003)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2635; 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: d415ff6c-1a45-4611-2215-08d7468ae03f X-MS-TrafficTypeDiagnostic: DM6PR12MB2635: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 0177904E6B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZUexOwgyT6YFZtk7O7mvN3JiNPO8OIGpAjxxr/ywSYlMHkDfCHTKdFd3/GylqxqZRC+/631J3/+kVU9MZj29b7qVXhJ4SDbcbf0BaeYRU8RBBlLvStqWozt7wz72OQtpkxNYwsLjaQJDQDO1NbTtnBe8XWiG0rgIUAdtHwADlk4chevZOxKYZchd4OJCXlZlwXSV7ZoRQGxcjmhvLlJ2Y1JCJqJJJPICkcEzpfI84xxOWql6ZQL07DTOKGQIphUW8HokXK8r7e6Llt7HzBAF4RbqxGxJuheAzX5OsQvvXqZlzoM7DmqRNwsjiEE67GHQFFlVNhbQsiHrUuPiH1c2v0tSQpPOOfn5YOlByPOiym5okTq64wfVEGHMf3RHMqvScPaHU6MdH4RJTdpVpPgP3hrsPy7EZyAmv95VMBBirnE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2019 16:17:37.5998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d415ff6c-1a45-4611-2215-08d7468ae03f 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: DM6PR12MB2635 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=PnBHuuiuQ1sajCrfHlq7oqhaie/z4McnjjT9VodgMm4=; b=k6m2Ew77T77qGxotYCY7Pnc5mYkV1mXoeJnGztOdJ5jbHHuszzwBuMSoGoTIf/KzKwiVgMCKfKJrh/Ygch3UWWe+kIXmLXjm0KdrUQDsGQBksVZ+6NRRlOl3KwMDgDh+klj/g4pLloc3n3n3t7ZaZ0mGu4mhEzjwHE3gFC+F+94= 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 , Jerry Zuo , dri-devel@lists.freedesktop.org, Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: David Francis We were using drm helpers to convert a timing into its bandwidth, its bandwidth into pbn, and its pbn into timeslots These helpers -Did not take DSC timings into account -Used the link rate and lane count of the link's aux device, which are not the same as the link's current cap -Did not take FEC into account (FEC reduces the PBN per timeslot) For converting timing into PBN, use the new function drm_dp_calc_pbn_mode_dsc that handles the DSC case For converting PBN into time slots, amdgpu doesn't use the 'correct' atomic method (drm_dp_atomic_find_vcpi_slots), so don't add a new helper to cover our approach. Use the same means of calculating pbn per time slot as the DSC code. Cc: Jerry Zuo Cc: Nicholas Kazlauskas Signed-off-by: David Francis --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index 5256abe32e92..fc537ae25eeb 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -185,6 +185,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table( struct drm_dp_mst_topology_mgr *mst_mgr; struct drm_dp_mst_port *mst_port; bool ret; + int pbn_per_timeslot = 0; aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context; @@ -200,6 +201,11 @@ bool dm_helpers_dp_mst_write_payload_allocation_table( if (enable) { + /* Convert kilobits per second / 64 (for 64 timeslots) to pbn (54/64 megabytes per second) */ + pbn_per_timeslot = dc_link_bandwidth_kbps( + stream->link, dc_link_get_link_cap(stream->link)) / (8 * 1000 * 54); + aconnector->vcpi_slots = DIV_ROUND_UP(aconnector->pbn, pbn_per_timeslot); + ret = drm_dp_mst_allocate_vcpi(mst_mgr, mst_port, aconnector->pbn, aconnector->vcpi_slots);