From patchwork Thu Aug 22 06:54:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6A68AC531DF for ; Thu, 22 Aug 2024 06:55:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB06B10E781; Thu, 22 Aug 2024 06:55:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="I3eoZeL/"; dkim-atps=neutral Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2063.outbound.protection.outlook.com [40.107.117.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F1B310E77F; Thu, 22 Aug 2024 06:55:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e+MNeNa31xyMCWsjPNy7IxtfBMfKPU1IuvHbGcC4xL/G23tRawtKvcGVNemJ67ywR1WKP2r7P4iZLSJ9oRmOCElXvKKh00DBe/YguieAYNP/VZOx8mG45llpWQp7fM/Hq15z3OZfMNLdDdo/960nFFuLZfuXFOId66cf5pa2RJKNw8WzPt7ppCexBRtyKuBnBehsvZMY0N339w/Iz8J073nU5h/CCyRafHsN6ejKJY/P/q15QCF7HgV1+LFMGOesuwTsZN7ZO/s9X1VqOVU6jB7oAWQlKNe3J7Fm6/6nyi+QG/rQa9Eg7FgxpwJz4z8le5WVI/7FV1qn1PdJxt376A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AaG5MbNUU+PU5oj5mUfga4yQ1Xw2kXZCJD+gDoOUTgg=; b=N8I3DHcGDCl/Q0u+v4SWJorcbd7pg1Xtci9Ft0HPlQJnJtEUgQcNpxpS+tYkTWsDppqpfBHYMKpCOGTbWZV9/+LqgwQE9XPA+tJcuz6N4ULTzwrplYy8zBmesJ1dIjqvVLUcZ3EB44RFs0rv63IHMKiDCk29nzB08pba5c3va3eThynnbbNDabYEUjPQlbcFJm04D5rmRb65CTAWvh7l8qG9UhWRq7QGWMBgcMD42UulpdcLDdj/XSWMRyzTNgchHy8LR4kIt/1rChiAdQz7S0ABt10kKPATqFiozcXjDeblXItagNYk/DCTtzecEQL6oG4IuAqdHHLLD1TsAhxW9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AaG5MbNUU+PU5oj5mUfga4yQ1Xw2kXZCJD+gDoOUTgg=; b=I3eoZeL/IBZc41ivNA5nBxdKzTX/iPUvtUbzOgmjpAXfCSX/3uw4Hr5pRZu0wB3fZ9VeHSgtMpOAInGVHz5pzsQOoOs1H6aXiF0OImjjmNkVgFa1nrDB5idqu84ol3gKIN6tWRwYFirOAo7TBVbMiqTTwQMoRHRH395U56sEtEIgpaL589tI73ed3kx2lnKLr2fIICFq5F+6EcdE0u5l1+eT6ESEIZCxBVxo304Jy7E1r9/Lk1UlxcuR3oVGYbbWxCCct8KCOU2CyTtSr44ZcJeC3CoIkOm+A6KhP72vTlo+hfPIWNx8Owf+JPIXRKUD5wT9cSGA/kdLz4TlnNaPzA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:07 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:07 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 1/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:42 +0800 Message-Id: <20240822065447.1333390-2-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 302f88bb-faf8-440f-ddf1-08dcc2775b69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: dCwpgp1Akpsu7F4nW9x02nG0MbzlmykmrQDf+nIiCc4xWgwVKdi0UKIlYyBN2qAcrBjIWGpr1EfkK57QnfO/0faw1Z+u55jo1cshF9HBkPbmWBISdFA/rOXfMjIm5M3/0tzZnEeYu28WGrgFSHFjYP88D5GkzaUoWiyKeO6nNynhfehjw1dNSu5UjhM55RWlPZ3PePgy+LcRKbWqaytTziCbFGEIVXCy+S9aDKGfAnYkQSsJDu2O+kSHhbM1BBEGnEOPCMXdZrlFbphjwvq7HK6ThLfobZ1aywLlJIDbRFZnyyLiirshFBO+MZo12VGE4SB9YFBB2e/CEwxTDAZYP42BF1HT9HJKw1uzJRjLsY7iBCFBeWNPUIdTCthE8qxIGyPWgcYzK1c/yOAxSt46GgPS9UMO2mOGEpckzKxg0QKP1iUKhlfuD5TNV0MA1oadoLH+yWxcJDAoeAwlSGPRlG+ub6Tvjzt9Jt7EMfbf5OAnW3b2RlPZb2/dHUpVd8NcdMJX3pRVxvthbkBM65VNSnnqPIVxRDp0Cs3o3JfgcIlod8lA+f859KCoDeDxLstO2cwYP2tFp3aBtBvnuxkAr/NA7tFRjuzXVh7OiQgJ+j7RN+gOamHrJqo3XyQiSi1RVfnQVWLWqqGc4rxLh4SkdYZVtkS+gkGYYKbW4WyHHtXze91st8hy0mpNHOQxHASiaCT5yKl5JOb4evUxFUPVRkah8T/FybKJTma0Moi1EV6ZDmsrXQWE2U0A8HSvzV/qnQ2SaXfXAoChoScjqIkfSBKPJ02TnypggLpfpcKeEmCR+TNsPFx2QDtk4arJYiB4nLzet9UVeN4yiRlpjRMfbiwYfwL3x9lS/1WM6rIo5zFMMZ6eDCbqdB5GW5d101q7vj1VdaP3bPeh5nnJEWgkjeFDkBVEqylsAHwh+8kMqQJ2zhP2kidrRru+7x5u6wGQeYw/SBPVQTZDage08LOzWWAiHK2taX+1Zq6NPfIoAyRn1ekdhxncBniAJ3n04ujCtLK1MixWl1StNs6v0fMpdHcAKVk3f42RL/vkQ3uZY4cTw3qqZVWZkDXzytSpHm6O11644PUzOh6VSUv1qtxyy7+us97OL7f8e5VfHa1xC9Xw1xA9VDiBNJXPyMLuiGpOjORHfvbbW/HaKW3UsCiG2gSwrGrQRkJehSJqehoHPFMqbHC6Ew8AxizxsO1L/uwi06tSwTbcLZuDOD8XFNanRMQVOneRPv5M6QWL9ktPqrXYk8h4bJQ4KPsqEpGqypqyGx43RSJoN3rzvr4IlrMzwGSY51ck079WdB6PsPCtjcYP7U79+oahW5yI5qeQgORFW9PD0MvRc4IrAmv/lXOa7WqkPWvmsPLPCUhMmqAxir1M+nWbWk4PqBrIwZbgEp2su2PlC6298sAIwwF4+PFQlzSxd/2Q6ZdIYWAf3+IjH58= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BKjoH/Kxi3AzxrO/6e64YhxmzYp8VEGD4T8b3UL+RjuFdK8Fxw5VZ4kJtzPYGv1Om5E9in2Psl5gf908dlcXAwuG+Vbz6P3uXRjQFAmy2ELvbmE2S8qhralkkOTgj9YMVxXewopnOKSuyBsZMc/UVsuWivyIcUmP43J2pFLCZQLDkqCLTuSgANIYeTFwFp4l9/TbZB4y5oFHbGKAr0led6VYRBv9K0m46y17P8nqEZKW3j+19gB85h/ZF+33iCq9TXFTAfeUbLiCzc8uj9afTjduoEe4aIWH8rsuN16gFxgn7rUfMTUNyC+yHoe3Fxts3f6m+YMOHfiw0ZCYZzyVegyDaNCdl/PK9G5+MVKcAHEInjLhvoeip2cHtdpFDC2tdmY6InNmhO41K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K5pM9Ts6bRBmEaVJz2txSakY26tCGN91KW8I63tvHgzQimy8KI5axsy01xcKD/M63om/YI09EzbGJsXvdALYF1vn3Y6twLEV3HhltFNRrjlk4OLk1IxlxpIxksX72IVg7WI X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 302f88bb-faf8-440f-ddf1-08dcc2775b69 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:07.2836 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SwI3goTtQqt4tq3i/ImJvpvjE5JvBEbo+FRwHvksfavFcFzelQ+Jg10IZNrvTRQ3iW17KtN3avXaAiAyijmR8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c index 3bacf470f7c5..f8c1650eb21f 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c @@ -2300,8 +2300,8 @@ static enum bp_result get_integrated_info_v8( le32_to_cpu(info_v8->ulNbpStateNClkFreq[0]); for (i = 1; i < 4; ++i) info->minimum_n_clk = - info->minimum_n_clk < le32_to_cpu(info_v8->ulNbpStateNClkFreq[i]) ? - info->minimum_n_clk : le32_to_cpu(info_v8->ulNbpStateNClkFreq[i]); + min(info->minimum_n_clk, + le32_to_cpu(info_v8->ulNbpStateNClkFreq[i])); info->idle_n_clk = le32_to_cpu(info_v8->ulIdleNClk); info->ddr_dll_power_up_time = From patchwork Thu Aug 22 06:54:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 01B95C3DA4A for ; Thu, 22 Aug 2024 06:55:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 834A510E77F; Thu, 22 Aug 2024 06:55:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="cNB7iYUF"; dkim-atps=neutral Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2048.outbound.protection.outlook.com [40.107.117.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF51110E77F; Thu, 22 Aug 2024 06:55:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BmCUtLEyR2Ntf4ztRdo/7ZDrOgj5DDSFAGFCid/KgMiIJNhvAXlASZxPbfvZDXQaVIup1fx/hwXJsPEaGeuo+gZudAPlROB+PQInK4kfE0ne/4KAvk70vlOm52jGMZoYPCLw98JOL4tPEJVBbr7tDyuS/Sy2aU6jlbEDX33lf/PhDPzvOFd/hTnZ6a3I+AOGCo8tJqa/Yu9tnsSp4kOlpXWQ/ffWVGaW9oCCZv6kRFjQMNLqQSZWv7dwsJ2DaahqL0U3/D16SIAFzaSKq3/Pp8SDEySWNiMOBOZp1iyKQlyYvC9QUMRrL6JzC2tCPSTgck0jL6t7kh+urdlcQ00zDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KDzZO710rFLkj1elfDytM9c007FIqcUXwciJ5i4GCmw=; b=pBaRVWrD4khZvBObk2Kb+rOdzeek5VG7YlhZY6+bR5qz6LOAu4rXzZ/0fa4zj0nKVZkhfWrRA3UBjg//Sn6JSzU3fTwLBpuYBOLF4DBrgdTZzaEdZH9KNfUmAIaxkDBkRm7NICFegec2MbXDD338UtuOfDGktrTBHQis5dUEtBoEu1bMNBENNm+pTQB3+sIq2JzSW0c8HW7n2vL7dduZ0/fD8cdUNkt4WA3tJJlmW+ar4CgCTelFSAipL8SGWUt5uNyb8mjjPyI+dxs+WIMTu/b6EjiKuKuLoGglWYu+gTGKi/6X7z7cBNYy5qCzRNyrgLi+50XZ94jn0A5vLIVb+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KDzZO710rFLkj1elfDytM9c007FIqcUXwciJ5i4GCmw=; b=cNB7iYUFbzcio043P8//oGWKeiLs2kX/BqpPIwqf1Cjgyb2wX2QI3iNdER9Tw5RQ1zsxSvRoM4jA30PMUayY5hDrB+F/LDfNNXbdkEGkCicxgqIJMSJQh42pm+QUrC1GX12iK9GC6SpV07wpijOPUCntNFxwX2cLqvkE/7E6Zcx3vAedC5IU4abnpu/VI58oE3POImQTRLeL5hjfGzLPyXw8mjjetl8k3dB5cI6W4YGLdLpD25Y3wMs03ExUv3uvrLDn0j3J/5KkVl7iN/kODBjJkUlV/1Wh1Vs0VAYJoGr0JI/kA5r7E7brnmAYcwA2mEsMztkG0xfFpqksNzp1aA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:10 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:10 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 2/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:43 +0800 Message-Id: <20240822065447.1333390-3-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: d08ff8a7-3eed-4cbe-cb93-08dcc2775d81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: KzUxEynLxyolLZQy3NibDxSYA6QBFfPouAzlSR4Ig8jNfObBit45gLUXONe+jg5rX0fId/l+ZLvbvbdCU1+qdLXJL589QoengIHlyF8NRjTK4JOuVHQ5i7W5d3aMrNe8DPTEHFpKlo1exO3rIlVJyKmq1N0hXElvoFdJw8SVmIM3g80XBbnUUFtsAj/44/3hCKbXKT6LR2BvpmWxegW/yaT7Y9G1AVXczN6nlvPh/SMHRTr885Lj2aTUWportsURn5TV+hI2F6gFtbhy7H1bFytDcz6CceRZ0WcHcjoqW7WrdPXWPFEP9X6T94Nsz2D2IzM9ObEgEpQnOCyZI9P+rXunUOEitiyaMPn6/sC3BTSzddhQuq6WBMSPFv0awitbD1XJhV8FcevC0dZfmfLrPxbImrOUHnF23ox8OI/g5F8y94VR1OOMOw+QU68pBmGpUq8EISC7yIsoxWgcSFAJA/lDAbaDoFTvxGnWwrMMlfN3Kuxf+L3zUkbiBO90sCJwZDBUUKBFYTIgZFF8XG17p84xOobdiCtENExJR3TuCtFeUwdpWzrg+Gga1OUCM2mFpD4z4Bnd9AnFbKApQZcTwQgfxwdCbr+C7YlChJsEo8AMeGwu0hUQiRZHCi0cwWSIho/wRqaJcA47iyIZmT2JXl//pN/opFr916g7So8Fj24hYDuZqD2Lz5OfuSnC7fA2tEZUJr7sOwmcgm6pVwlhbyQNkNrMxpV+kqe4ZEFdDpL95YPoVfdsrvP1gNA7aSyytnrWoH0e0yCcJkojOJJlo/Hl56YT5U1icc5WRu6n9//H2Ag+f64er7onVLotLKEMerePnZrrCuNrIYofT0NekQ4ZzykrdCuF+unOzDB0pBV4za4P/TFFcQ6HxS9R4Kk7mEU8aPnjVUnOtO8NV8u0JzWtkWsdNhj1bWdYRmNeGrfbz7pfcnVA5BzHG0iir1tzaeLQzYMKQL4WLVnc87EkkFLFLDMH9JD/8Tqc+vlVen8013rw921bZ18ezqYPocFpHQ9v4KsuxQvQAn9G6lL1K5CtxUWyMktgkYQR/BuSLGPAbloIu/bNRgqEUcUeew7/gVMcepmcqrxOmsvvdI8Iaaoi69idkRQykIxQKPGpuqebtOC347eocG8nc0OH05hRa5RziV9ly9lRaFwQl18eCPKz+mMu+GmXvZyRae0bDc4z40rNIQpiMkt/2GtAJam8mzwbfFi9zDE+Dg6KBOopjrueN7qxl0N0WzFpZkqQ52RH6WGConDC4SWxuVb3cpaginlJAqh5Q4sGEdLRHgusijy2Rpb9y1Gd5DZni7loairkvi4/3zhgVORVHEfhCJKubQrwKw2TmA883jCGJEFc6D/aTidHhLjE3udWt0kNQF4Ha3tZzl18TGe6x5cHKrqWl/iDH5JCoIZ/posBDDJ1drsDOXkB6aKC11hG+XejsfM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: maFf9Pnth8IAf2kQU4sLshP+El9u7hPICOlTyaMNUqudmNTe0Zk3j/YTx9m4vhHXZRjjunJQJE09owTgaOeyujFpiwYE3phtmoCVnTE105F9oML+mOYpoeBS0AdMhfy7JA1I9SxzE/d34ioprKvZ5q2v7oRaVAAk3GMqQ8/IhvoAYy6NPdB4w1ydjXdTXb/LBgPre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0v2/7LCiOH78ycjzkTQHyyXbd1LAYeQN/pS4p7PUoVouidcvlLsdR1HtF/5760AJSBCa9ww9ErO6SuZDjLFNVkkzbSwXYBHpHoeQkK/6i4amzAAgQ2ibmS8rSFPvGy15RQa/tw5wjKs0OWkj/OkxCxlq86dgXct1wwfmYcPKLPGz4qha7G8blPGitj0kMWVTR7HY8a+TuI6ZTn8MLiDPAukBf5PNjYcPj3OlEzm5hCWACQ64kJgueumXOu6vXgnwPhhWh3SuQDdI/6rXmpg3YyDOFWpKFXQFNdxn2dXlsYSJO0xbec2KLzAi7G40WfO00IG3A5BXWV9n X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d08ff8a7-3eed-4cbe-cb93-08dcc2775d81 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:10.7316 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1x2Vo8HI2RGPnQs8OQHkgCCD1mvhlgHX369PcqWhuj91ZiNwocBDJ4FfyGJY+zi7OPv91aF4qhRMjiWN/DOWTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c index bb4f3bd7532e..4975d47b66d8 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c @@ -311,7 +311,9 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base, new_clocks->disp_dpp_voltage_level_khz = new_clocks->dppclk_khz; if (update_dispclk) - new_clocks->disp_dpp_voltage_level_khz = new_clocks->dispclk_khz > new_clocks->dppclk_khz ? new_clocks->dispclk_khz : new_clocks->dppclk_khz; + new_clocks->disp_dpp_voltage_level_khz = + max(new_clocks->dispclk_khz, + new_clocks->dppclk_khz); clk_mgr_base->clks.disp_dpp_voltage_level_khz = new_clocks->disp_dpp_voltage_level_khz; if (pp_smu && pp_smu->set_voltage_by_freq) From patchwork Thu Aug 22 06:54:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C1E36C3DA4A for ; Thu, 22 Aug 2024 06:55:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D6FC10E782; Thu, 22 Aug 2024 06:55:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="fKF6zbyG"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2089.outbound.protection.outlook.com [40.107.215.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82F8210E782; Thu, 22 Aug 2024 06:55:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l/kINyrt7h9XBEqfij7sZeJTp7ErmXFBDNNmLUtwXsaswDqiMiSALnGc6IJOUaSQmHsfgjemJ7pXyRcYbl62iAQOSzgCRxu55T6BfnyGa6buGCS6QIMYApcqTXGn596XDP2A3uwMP84ECmT/3wowiMnAFr1P4nyycHzQhjhvoqf576lGuWhkgASsasZtaR4iN3cwP1MZrGuugo8AC/3ARxng/S09hsNJj+K8+7CTHM8+sSGJwC7gsNTdIZzTxq8e6sh9boNks51vABJUPh+sH6QUsUuoaQdo+xgfn9wReQfLEb8XJpuM4IWZUsTXs3zfaM64w4ajpITrAwzNe6babw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WPHFiCX2D8HefJU2ksWv8ccMuI1S9KxOQ2E/bdwcOTg=; b=t/9sw+UlzsI+kRuDpvGWl1F8im/MBTfAnMkRcKMz6qBfyyH2W1I9Uvrym26SE2PUgN40gsPWpUtTChsafqX/EtgT0KcT+tmRWt+xGIgSxeFnqwrCZn7oFMdPs1RvH+LzSnQk5C8muNaOXLHlZCndOHl5WAtpPn8BP2wy8nU8F4KQGnBvmrDJP1ABcNvtKfMQc6Ej4u0t28P08PdD7IYTP1a9IVegbV19M68oaelCGQYhelIMQQZBpNK6RYUYPyo54EuaCw0pZwzNXF9jH+R3mGnRJYZh9uqZgHhq7Ai3+SQBX7HFUVG1Zaac6zNLwEtC/zlhLm1dxAV8YU/sMD7vXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WPHFiCX2D8HefJU2ksWv8ccMuI1S9KxOQ2E/bdwcOTg=; b=fKF6zbyGq3B4GSXOouOfyB+lD+RDl5kWLzsC8PllOcLq/hSzQhfTI/16Fslqek88/z+RaPOKFuvpHH9hcPp08ixqLZaqImC0LhTPNuXt1uWhAP4m5Nzk43mDEHQ1WzQrhSqIMfgFRMVVSVCK5AA36rhuxrcc99pRTgQ9E1bHjcLR89Fojw4iuvvoaz01Vccj3FJX+M7VeB/BedrSEvdXFfstsorAlvWz0KBN61DZkyd+Oec+Fftsjcwqk/q+uASsxabY/51f5x42i1cBkJHE3euMCMbxQ3SVLnLcmLnNYIU//lYVP3XyQp5Wt8wKuO53E3n9d2Q3H2gqSp0RGF905g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:14 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:14 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 3/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:44 +0800 Message-Id: <20240822065447.1333390-4-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 767fe392-d1f8-4669-8a05-08dcc2775f96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: bOinFU7tmkzzMIqaEQ95OfADBZrRB4d0iIshmTapctUq78Fw0/Ya4HqfDs3Az4Dn8QdM64A/P2BUOnl7AbPNDbP0GCFcTa/u8ppgwY/f+SN5fv7q6Xi3to62hr+KDjCCfgcQ2mMVhVbfxQzHNzlkMRlIcOF7IwWibspIZhc3j/GnBhV6bLeStTWwJhw+J5FrOT3+1eF+O7c1mp/qhkbmoJbTi0AYfErHsWQCFReawYiTGPVHvUtG1eIM4gOuMP0iJnbSr1shFCkVfieoyn9xVxvq2djB11HONBZqQ7mJ0kspyjq5vXgB6TJpEo0f06e/UIMpCWwW7f3Jro25fPlmV9neaFT1VZ7NHJ1c6zxaUP1eMeXpUvYfU4dtae7eqeYhN5az7FxrIUwO1mbYOKFzc7ycTyqND1jsTI9iY0d6MBVEblQ9B4+XqG6z72kTnASABg19SYN3/pD4rAU4gN0cWr+Nvd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prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S0YAj15mDkMLKsM+w+JZxWyvXaefIp7j5B3i0VzjMitobhr8RUPKOIzH3R+sNdp6x2YjfLKzHt65lXaPR0AGrlqGutJOwtAiy8Mcx0IF1VXVG8rL5Nt6ElXcU0I4uBhNVGw7ultLvqR42uPt7wATKxQRX3q1qCQ12UlOBBv+dEj16F8HgXI16XlraXSw5tIwpzG9erqtMomvBen2Dmm13bLOzTOoZG+KzZWXQOnjzapy9mqQIDkOFrUxfmFsaICkWNdv7eYcoelkR9oXTjT09XKLxsmFPtu1RXesoTS6KiAENMYMrNxpsxoXuUpokl+WBoRxlbn9MKNIpxQpeXkxWmOWryvEFQ/jdoCZaZL4ClBmd07V2TopuUVJZGikPbsic/cvNXa2HhtJQiIlmHhSA4ZHCHFnPh5lUCos4q86Ll2bIusLezF0t5xB+FYTus64II83va2pYkWZCZ3zGK6Yd2ptD7XcCKoHnmvn269SRIPhJvxM6GWGeuW+GiKa10OwZTeGdoGg1eQ0jClw09gAD/lUtHgyk1yYIXxfMMl2FeN+8nUCdSb33CnI4D5gEmGGIy8+/mq/TfnxwhV7eaRdP/E+JcuNBeeOoql/V1E3YLyY35eaJK8iWsSZFWMW0n8StbPeu29EBLqQqVkJM8CIFL6h5GAmgTgkZ1kmotMf+MI7EXqK3IROlLLLSr8jCqatdMAl5W9b6gQTWp2id43tz5tOubzAiKwl2kCO23f8Ik+sak6eVEinGjcSe+guoxrF97tdN/we/XXf4is0IHQaG2EQOuf8KcB0REDK2xaXWL2XQRqP/0IIIPDSw01/gx/sCTGn5tfY9kRJvGbZqmqeepLEwkVeTlUTlzNhknUeElVgjaqQHhncqEM+uXQxexTGLIYRyuQUMw/wXOGszCkJTX5yoEPUmpnFsFIIcDi9A3PkkUJIKwvTnwfC1IECmzTXkVSsZZhRAvTRt4lC30GGJUOrbXiInpkDolm3d7rUAyLBaEP1XaNVbamW7TbWBbQ3zYvfKCAeMXTul6OLRqyCahNp6iawBdHrqhy5alJM72mUh0h9csgtFjOIJoLl8JmD1JR79xWGaQ1NbcWyvzojDb3EoOIX2/uOg68gFkViipyyTiVFn/B73UPSilvC3CukQhgCaJAfrUzT6N3R+CrXNHdmNRfCYVAdi6dbV6mcMw24DpYO1jv6ArePctbWomNHpyg+XcmX8Jndp7qbTYgDf8U4ez81NQkeDLtQVzmPctUFLJLSg0gx4afNujn03iUJy3/Hkes8PXIcn2KKR+Ppbyon9zllu1YUBCv3Uym4fy+Cr6uH4asvaV2a5kzcB3HNzNH+Laqyh7mpmY988PyB0Z9U1bHL2BQFX1IUj0BB0izWG9NaFcn66kewqJNdx1wMoVy5LuxJDIpOaoVTwU5wSPzuykqZuSq4BIdPq3tUM9E7SRvj7A8bycnQMsO9O3PAYVP9v3+YHoyIOwsUwvxv244YMj6we7b8MPO0n3KK9e50p9oByBpVxxzniLs0HPvmMTiOQhsZ11x++Yzx8QRcgFrheqa8v44tQNPpoceawDPct478D9oJVrPCDBFfEBgv X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 767fe392-d1f8-4669-8a05-08dcc2775f96 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:14.2230 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HlZqhHZsapGHI5o+41kr5BEco66fTsapWe47ZJcYMJdNpvAX6uNTKa33Yjir22g5kFCHWsidGEm8hRT0eEMrFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index b38340c690c6..5d40f61261ad 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -797,9 +797,9 @@ static struct rect intersect_rec(const struct rect *r0, const struct rect *r1) int r0_y_end = r0->y + r0->height; int r1_y_end = r1->y + r1->height; - rec.x = r0->x > r1->x ? r0->x : r1->x; + rec.x = max(r0->x, r1->x); rec.width = r0_x_end > r1_x_end ? r1_x_end - rec.x : r0_x_end - rec.x; - rec.y = r0->y > r1->y ? r0->y : r1->y; + rec.y = max(r0->y, r1->y); rec.height = r0_y_end > r1_y_end ? r1_y_end - rec.y : r0_y_end - rec.y; /* in case that there is no intersection */ From patchwork Thu Aug 22 06:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2A1DFC531DF for ; Thu, 22 Aug 2024 06:55:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7F0610E787; Thu, 22 Aug 2024 06:55:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="n/sqiZD8"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2080.outbound.protection.outlook.com [40.107.215.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DC2C10E786; Thu, 22 Aug 2024 06:55:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l77BFyYHmGTsYXFhzSm5E9Sdh5T6j6abinQCA455+Mb/4zpeDIVETRwbLUnab5lseDizKG+PABYlF6sRAXixxNakdvF03X/a4vhsS/9qIqlHS6zyhLdjlcDcMYauJHobvUA2Sqdg+C0r9/DR9sprVva1HXs2+o3r4Ts/9Eq/yxumH9U4wEyMZemLjq1XV4AmO8JZS8Qo2b8J9g9mgsY1C0oUfHywfJsoxKDnA70sSRPx50vW5p1rmtNUt10ySGhPo8x96lOqL1xrY/m+JmhD66CMQCLH4YaQB1mOM0CBV5FgIQO8Ap7CVoone9FDNk22X5zsV9kSUVT8T6Gvz9TLmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mTsu0wrvbdIEE6vA3MQgBXlaN79AI4+N6lS1tqsz9ss=; b=faYNCsaUuXM9udTR+4AK0qnHxgDKE9ksKsaaSOq8me9WKko57NIGwvywSuX+fCeUJFFp+Zc3e+HGX5iUIHBSwRR/t93jBnKyQYis2ye5IJnKT0Vhq9/frsPKl9HdBpoo8Ix/QuLLI2Ew7yE1Q6LC5PmH//CwbH27RMDcB2CpXSKoftIYqSpe7HWZ5JJd43EACkFdQFcT+fGallYevtwDG0IVXGECvORsvp3FSHJWlTNsstnB00izW0sg/mkJQZ3qT7VqH8nrDGiAVjGx2PKUmgOjLZ21RZE/yJK61rR5ruMZi0Spi2ILytZ2mxRphTibUZ0gK+ztnXRhh/pJEh2Ppw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mTsu0wrvbdIEE6vA3MQgBXlaN79AI4+N6lS1tqsz9ss=; b=n/sqiZD8jP6H+62tXUx2GV1hfocf5+c2ZbvO0rF0SGM6NNW8VKWaIwkokW8vPDNwvM1QChyIzmIceG28+eMWRPyGP2BYHI6el8PEzqID4sG40rGb3ChKNQPgfhYzbtwdOH3CCjvKPTN9noMDJJl0nMRe66KfEeMxw05LIkT8yuMp1pHj/dfZTYb3/0OT4kWh+EDI2KwWsJUmpQvHznKLhfG8gMf2Gi/1MAQ2aZ2bULyqsf4gN3G8hp0I8zDEw08Taxq/sC4LLShWFgVViC0sHBp7Xm9Rf7l0PFNOCgFfoSVUL7qCSBGXLrMsIaXR4X87ecoWRr9XPwdGLid4Mp3+MA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:17 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:17 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 4/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:45 +0800 Message-Id: <20240822065447.1333390-5-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: de5766f6-a67e-4262-29a6-08dcc2776194 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: vjU/vMxmyuhiqygfdPQaK53WTqAYRvL/NiQmmcywaZYGE5XcHYTcEk3Q3/jivSWQABMHLh4KWrM9Y78JlfKBrRkdr5T0ZV3sLr93brlHFB7GPalTD+pTRdz9DbmqyIVIll6SRW20xxYzzrX5wl1V0RuBrabLjzlcMuZDqiVYFpXiX8bP581w+TEWpER7jrWZJaJOCl3J6URPi0vobe9XE9bj79oWDrhFw7eJ0djoLOBL94dPhaidxjp/vlkbRwfdQ1+xbkbfdBE7La7eFH4qlM0xvNkbPah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G/oA22tqXMzOPAKCCR9MCithNX8xaXVmW+/UwB1YdC8mLUJPrXkA/FhMwj2xouV3p+CEpt3Kr220je0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E/l1g/N3/ZoOYIwagU4mMyss7j+Mx0FC9gGvVH94dhUFCRuwkbRXHOstyF3mhRtC+KqN3sUO7CtkLFy2RjHKSnViWXPoeZf3K6HZ4426+72WTUHh5Kvljynj7Fu24zDjo+TepGMNXAXBh7xDsqehscCDu49edYb/+qyu/ANHXlhQgYes5Hiahe5TsiEwdlh5TMrluEJek0bOrctgX3IAhJr36hsDAoQ8fs/Vnl2wCbm+UW4z1lkoWuqq3kPZEerK5YBbxOMGP04bFWNchmQClVh5qrMOntTzpi1HV1xdFe1JBVvWoVoXei9uM3vsSgouzH+rmoaZpjFp1T6LNQF+d8lM2bDNITc06cOnXdTqZo4FAbSeOJUqJlDHdR1Puy0CS6KLK4DmAJavX/4cxPARxz0UF3H/KJDExhhk/7zY5YVlRE/p0DKVuRYWhByoFEH1JqrvciuBCmGswdFNZ0OZXqCjWori/9XXYEuuZ+rvH1icTDQlWuHAknZyAwkrXKX9BC0lP0pVMfRdCCHinQjYuT+NDSPMAwvalWGEfle/gkfl0nwSmcr0oEUbzIN6tJcvFtHUXXbjgQLw6jsC+9XcyFjNwutTHFBzsnj1OxNg2MdhpfTgvmGRM4d8WnqyjYaMHHummZipIgOYcUDOMw26HtK0g/I/yBsSMoeZu0YdAnnKfr3TTHv5pDrK9KW6VlOUneaZMN6mWoEXQuOVWuZmbDRnGI4mS5KXV9P1LTtDchHiCr+6LGarIrWvKiWkJW8Fm7xeSyVwEsl/VW9H0djJZbA+/RGzWRC6sciAMuNuKMoERSdYLhkNHijHg4+KzHuzrUhAJ8JE9GRkYiSTHOrvpw3Gb28izO2Dhfzy6cdygrKxFszqGRTjpymWZC8GaxRxuNP3E5o7IEfKNJcRh0f5YcE0UxNR9BNFkVPUnRt548y14UdY8klH6pZWQg5/+C1nyd+DELskdEAoyCbgfs2Wpp1BCxbSP2eUhNYX4tyOBGYIkGAZDlDcpUVFPZWsE0JkB5irPiGTyoMA5AnvEMo9+xQu+UquS8IDhDWOIVrDTMykdmG0/1z3RM07VmZyob46qBlHjpG1FyUxjsHe5l0eejkmye3aF3IW4p4jqxVfAb4UL5o45hlyVNYFXq57wZ079xao5cLkMv5h4iIyqOFzJPyLdwk791+emHTbxKrgt41HZji19Rf/sMYCurOImXgb348K7HWQweu+rFoFsY3qFSxwZdLKBYjoV0wrV7BxH+l9WA2Q81QxZiNIOMfo8cT28MGAqd9FXE2ufrO3e9tO/wU5dfJN4BTyGxQGl3HXC16wkJAUB27T2D65jqxbPWtTdbR7NVndkSpFF/c+SOmfqcG8TbDwaHeR/CpKb/rReLPlUEspSBqJcR5f6y7Boyb4kWs0LjwTsSjx16wlZjbvJoGamKWCPm9xyGXU/alPJcMAIkMDx9BZOAjpRu0ZB4dbv0dKnl04BMsdRF9YYrnAUpa+bV2pI+11GHRuls5iPs/0FU19ysxLJaCwGjWRhyVU9xqLG4SlpI57jVHSQWhh4RRUCY7BywvnH2koyCHPqIYCAx3EbQOagkxtd+EzDgcS X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: de5766f6-a67e-4262-29a6-08dcc2776194 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:17.5527 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UGQCHCRxng08gSgleLRfFGqhT+fJAYWKH1xWGEbPOoiKeMsxykg3plBpMLYdGzu6TyIZEMxL83I/h5QNACnOiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c index b1265124608b..f48f8cf1e232 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c @@ -606,7 +606,7 @@ static void populate_subvp_cmd_drr_info(struct dc *dc, max_drr_vblank_us = div64_u64((subvp_active_us - prefetch_us - dc->caps.subvp_fw_processing_delay_us - drr_active_us), 2) + drr_active_us; max_drr_mallregion_us = subvp_active_us - prefetch_us - mall_region_us - dc->caps.subvp_fw_processing_delay_us; - max_drr_supported_us = max_drr_vblank_us > max_drr_mallregion_us ? max_drr_vblank_us : max_drr_mallregion_us; + max_drr_supported_us = max(max_drr_vblank_us, max_drr_mallregion_us); max_vtotal_supported = div64_u64(((uint64_t)drr_timing->pix_clk_100hz * 100 * max_drr_supported_us), (((uint64_t)drr_timing->h_total * 1000000))); From patchwork Thu Aug 22 06:54:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7AF3AC3DA4A for ; Thu, 22 Aug 2024 06:55:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F191C10E783; Thu, 22 Aug 2024 06:55:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="aBrIiDTR"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2055.outbound.protection.outlook.com [40.107.215.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16DFC10E783; Thu, 22 Aug 2024 06:55:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LqsyOEgMHA++vc0obXl2Gkalo4K9V1MV61hZqhOqebpQr+Qp34YdV1rlkPKO8MnEDI/hc4WSrDgc/mGdg7WVZ8MsQef8q8FptNnX0MCpHS38T3tzJwgHH2JOyMAVkhxZvHpORHlW6M58738AsqV37Ajr+guJ46E+/fQb5lhKdkdlfiHMBSRYGXYqyx6O3F+vSuqosNBiy1Mat/NnKx9vVGfUCho8OHekSBSAFRekXAbgihOqwM1Qj0KuRbAa789nY+WN+mg+cjEYECrCoUbuULO55l2mObR/fMupybTvk0RZRm1j8ySbOSKp5zACo0C83IvKnZM43SPpMTlFhsV3Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WfXf3Thi8Fu04hOU5bFN2rxfQbx13dEfeKLe0Ovid+0=; b=zHLiOOv/lNU1AXt3UhqVxaykd8D6aE7UQLVClC4i6QqRVIWyIB2nPuTd5a4IqfM0oGmeXgbauJUn5AOJjfOpLKqK8MiS2ehki4UXlOd92tDAF1M+OWvSovPyv52tjyyxBBPkm2cCnXE6shslSJ8shaqL90o26Zu8tc1i2lb8OwJbXXnFKCJX4SrNqc5C+ap1RiaU/JU/w0CPKYsXx9PW+XZJjOsERmuzGMR2553mHa7McQc8DiBE1upLTf9rTRJggTruOT91+V8Mf9DwVlwf47ZHy1C4bSmNBzHVdwuRSPjyFWgT1XfZy8Tv/wrQiGZc/IJ9BTcimkvqfKV1TpOfow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WfXf3Thi8Fu04hOU5bFN2rxfQbx13dEfeKLe0Ovid+0=; b=aBrIiDTROuopHz7nH5bdoX1zsU4DrXWaQeZRCAatXEg/l2OBQK5cgN9S8QOteya0aNOu1oHgzm+BvrQgOxZDd+fm0G6yGK/raaR6LkO5tWcsFe5D1iT4AFqdbi1Fu/P8dHG6h+bH86b80BVIToaczeJ+sfDwi/ltSx3R05vAIsUKYMS38EBJYDjsQsfSl80WJfoR2MkM5BtSkzoGymniD0CixUADxTySNc2uc3W7Oqr7Q9FCwqxpWY1ih3DuYH81jFXwOloaK1elrPeA9AN/dTEOZURMtV+Q25fKPHMtRE7pw77deyFHPlWYaUtlL9YjB15nkAapJIpK6IeUWOF8ag== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:21 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:21 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 5/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:46 +0800 Message-Id: <20240822065447.1333390-6-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 759214f7-6826-48d0-7111-08dcc27763a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: nfylys71xeDDMKLJU2pCqUGaN0LccsaF+1W727/FEbmkstt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I5jMgAB3NDCeDKNj/evMYROvRxFy+ufTL8FQpNZw0++1vfmjnR32MfY50+ewtZmGMRpeWjSM8WpibD7rx35q2M7jLEmts0JHTzAxt4zDYo5Wyd1duMw6I4LP5QmnYgEzTuT5fxejCV1vGrJsuvs0J8zQXIJPNP3Z7dP9kRGRFX3Ri66dXkiLPZAEWEBr4RH6jXDDh6gnd8+bphdMrlFr2eu7e1oOYcj7UWL/QjflUtj1SFL78BIcklEKoWFDtUXPmwv8cxw2EXxdYTAwwsfy7S5KKGSUhCrZEV21qfTsAI9mr+xP14X4ot+00F1rMdrNBA55oDKfjQfs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DHbz82F4ucMGM1P4sa1al30tLktDc9Gs7Xxl0St/vZL95E78wPzrKFJ/zNUTTD/hLUNt9zrXWoomYgaGAGhHET4siJdpYIh5TEVsJKXaqhWCf/NTR9uLSCwIX1XrtZVoBuOFi8JpGWIDFO6YVvAqnlhF1vUT+SUQSnpwndhBoWlL/n96be5Z9y9j7ZOIYE/gXbEZp6HzGaHMWd6S7W7GcNkBDwpipTpCsq3ZIJS8sqeSFcHwuBasIwtZtlzYqcnLfDy4ZYwNXXtMggl6Ll3Bnm7buHhkk9bMeo+sNpEyQTuRpQxorMpb83PJBqp9Ui0HIrrqpBZ5X7/lMlstsiLmhH0pcdNQXG+l7yuLtY2Uq7X64yVThztcYJoYogSsHNmxlf1BKb12neNgDOR/LWdNgcj2Ykee/R3gpEZ9jRmwYxbozG9c5afHmjSPadzNzDLnGCQXPiUuqcT/OTTSVgE0/Z/n3bWJbYBnhs1a+TjOXtcLvIy11NHOT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0fiYdK6yv0P/OvODbTUNCzV X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 759214f7-6826-48d0-7111-08dcc27763a3 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:21.0061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n0Q73Zg8cltxChyx6D2DuYllgUILyQ/Ah6uOb2aiQP4jQM/6EZLTO4rKTD4c2LsZ97LHUrDH6V1r2win+UJsHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c b/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c index 9eccdb38bed4..d5fa6e79fdff 100644 --- a/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +++ b/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c @@ -17,9 +17,9 @@ static struct spl_rect intersect_rec(const struct spl_rect *r0, const struct spl int r0_y_end = r0->y + r0->height; int r1_y_end = r1->y + r1->height; - rec.x = r0->x > r1->x ? r0->x : r1->x; + rec.x = max(r0->x, r1->x); rec.width = r0_x_end > r1_x_end ? r1_x_end - rec.x : r0_x_end - rec.x; - rec.y = r0->y > r1->y ? r0->y : r1->y; + rec.y = max(r0->y, r1->y); rec.height = r0_y_end > r1_y_end ? r1_y_end - rec.y : r0_y_end - rec.y; /* in case that there is no intersection */ From patchwork Thu Aug 22 06:54:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A67D5C531DF for ; Thu, 22 Aug 2024 06:55:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E5CB10E780; Thu, 22 Aug 2024 06:55:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="JasvBrNu"; dkim-atps=neutral Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2051.outbound.protection.outlook.com [40.107.117.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF20D10E780; Thu, 22 Aug 2024 06:55:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K7gIj89v3nCTNRGG27yy+pPXEXJPfLHs83AkUy03xV6TQUK6kIHTZ5xisDYN6i1tFOseR8LtidcyeaXabqf/NEfT7Wc8N50aM72n2MzirkdeYdhhLGH2O8xf0CuCe6vmNBX/b49yH0XvRnrCKExyQhbO4IuVlo/JRk4q4QzZzOJvD22o/Zg1Nu5H3f0NnL8KzfD1iwhcf9Zr301nV93PUR7QMWRlGH3DCigUYZoUFU17//bJ0raHIJXUveXVIUFj5e+0trr16BhfsHbsprBpHrcHbTyfPcxeBPr1YcclcpoulPyeVC/rkMOlxtMTgw6BpIHHE/DjN8fb0/haYH5HBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6Nf4qHOg4Wy94B4bQcsuL4rSf5VRXrwo3ygBKI6+/bM=; b=uj2lOL8H8hbqzAeVQTMkHYjzWx2CJ2FigqaDFON8x2lJqPCRAR7TNuCtq9eWCl4dqE8nGpP6v6Eq6eiKo01tXuisazCFtioBpwodC+5ya5PK7RATVFKyiDOiQEsCGkhJqy90cyKifXuBSRwBmcaUknId41ttUNwOn1W0m+SGqKWkIkeMkcDhwJKR+k80Jh0bs36ZupB62F1YVIcsp3VzuWhGjwg130osvkg97CafqXOV+AJSSt5XcVUXXOeQT6mchccPWlF68H9t+XfYWVlV3NKm2hB4YFU/PkSQ4aF6A9JxMK6wWDVO7wYurJ/OTxzjMJ6zzA1fmXT4Tk73deU67g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Nf4qHOg4Wy94B4bQcsuL4rSf5VRXrwo3ygBKI6+/bM=; b=JasvBrNujCQfzikjWZdB5Wqgla5ArJq7nHcQgjwhSp/QbsBnC8AVP/bWvh8mxQVlwa92weUgf52iFHs0CGZVwhXbbepkLuXgkYcb4gUyGOviPGejUsRQvVJqLG8wm2IommScJIzBPNdkYeLnXxsZ26bpcoxQe9dcfj0lW68njZ19WgJHriEZ03Ztt/+EPHkWCijRKH8rIUUr0tVjAN+1TjvuFcMvnjZ6mYGdtU9/pvF4cVO7lDi7rlGPjpYIPzU/ec3YkykMPpHWA0pLWKHCoNBCamq/DCDLA9td/zS9fHAQrtsWtGtYjj/hOicOHQQxeN2/FumKUAhRAz7R7Y9fRA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by PUZPR06MB5982.apcprd06.prod.outlook.com (2603:1096:301:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 06:55:40 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 06:55:40 +0000 From: Yu Jiaoliang To: Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Hersen Wu , Dillon Varone , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1 6/6] drm/amd/display: Use max/min macro Date: Thu, 22 Aug 2024 14:54:47 +0800 Message-Id: <20240822065447.1333390-7-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065447.1333390-1-yujiaoliang@vivo.com> References: <20240822065447.1333390-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|PUZPR06MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: a7c67985-044c-4e37-ae20-08dcc2776f4c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: fCspicqFE98v7SiG5/8LnUFgTAB2uHp++FTT+fF8aCspzxwKbs+NtYW6WDWBfOe1OeBl47/DWkoTfMIye3AJiELgXySwKuBL/cSPuU2eN/l5X1/ja1/14jYDBszpFKbZgOJ49LMol5Os++DqLwEPR8CFWnjZ1yUXiafwDpLVHKPQkdvdVDv0nDAHBZ4N2kkhgDyx0d6gWhaxNqfwqv7FWVj2VrINb+sP7PvT2wqPh2fuXFv9YS6qk7sStv94vtU+YfDmcCuVQFUG8ref6zmc8ro/MYAZPf4t4/3/tlpDsA6D/S6MMFg8IzbuqgFyhXYbMAFKXZD2uCZ+9gTgK+ss3GDHSHJ9fU2GE3RKiB7+u41mZHAPsJi+AfH+gccw5bPNbEr5w5lI5MwZcMwcGK46/KxwG/glwEeW1Tv/RPMcsj4/qXfKEfE9nK5wlwzZEQk+thBrvQ+T3aEC11q9YcJ8q+1ZjRvrbWz1pQe2TXJGikafGR/SyW4U5ftkHTwsIDrl8J/GF9xRECcKKjF8R4IL0tV3depIt6X/Jq/4SlNCdDLStWPw2xmY7guFvYbNQiRzT6SuTgCCdetPGb6UrAFbudGxKvBl9+eafdYSDGALCXWw8P0yYLIUAyoewhKZgXCqGq8vx5Cj//tQwKktqiN580vYTZPVbP7rSaoPNZC3EQDCjhf7566zTZ3sK+bn/bzx8V2864IomqhqCJwK9M+K+27ZkcWDVqghvhw0B1+O3sh+jyiE20mlKr1F5zf8frjXWpn4vvfucf5mjBr9QSVuLgoCI5TGtLTz39TPbA+mIRfr6gKl7rbEw7mrBIA97HPj+nIqNVZg4mnuS1mVplSZvgi2Jga6lqw9nL5XS1l61NStSflXPnSl41WhHYcMJ+tTnv6F6/B7mXvovZrM0MKXZpvPPqbRA2BGm2lwHk0orh/MTczm0pvMGLJUFTBTloWANlK3sE0Y8SmhGT5RMyi8W8/Om45z9kDzMx0r+GG72WTIur0xwsFPhJ8/OngYspzDeOELw9y8WZWY1mxUhhsCOlyKSYH82sXIyd2R7B3LhYWeSvGm+aORzqgPsWt2MdO1i0FeINh28jYxB0VOnf90a269vB09Fq66C/6FzMaKXHDa49U2dyNJHuNgr++ew4ewTkCcY8E5lM8rrdBdNwBAkri88uma5VR35dM0QncCNUqZKHisRhkYQx5D0EtfPHWRXy2sPwEOHBNZt3Pvii8yVyTKlXZjB+T0al2OLiwVSIQOMgQaOaHEMOp/0nAsA2xsS5FTasHlhCGWWAMgtCzAeecSPKxBE92DvBye+/v9MMzIHPR782xAcYMniFnbLA/XNqCyCqsB5ckclbr9Nz6ngnxLgor4oWGDSlq5UKnt40Phcjg4z97lHCXi/OjW5Z0l97Bl05O9EPNQJTRc+3VGWKcUeuTC1fuo+hyiFR1msUs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XxJ2zNTx4sY0r1pnpXh/3cD3IiNcYwsUH1zHOeiKTS/2iyupV6yiG+fuslCPMcKjm29J/8r6KxkunAwpY9JvwwUXVBvKJz++yw3R60a5GRofMwQtaM6RCZQZvKK94s7HFQRcpedf7zE5c52UCNUGev1ZY89yA0n9+aJ+/ikC5G5dUQEMFomtm+zttaDggoNw6CgW9cG36RjUxN8S5vLyeEhakEW4VpLNH1HIL25hucudx3ZMaInR9lsFY9B7bjIXdnYzvgPb0/Qo3Kc7pWXzEJrYhSPM3tt6kOo37GSkD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0KENg2VK+Vubs+wZbyeAjOfqmuX9KXVRprTIFoFcOd6y5yvYEjGq6gpIb1AMPlWdAkSwG+/cGgvqVDFyibscmI7HumBy5LKAUqkGCo3oGs6NyupVezXGH9LCW0ZJRwEw+GyLczmUiJi+RuqYw67LKQF/DAMgREQQhxyP5NJbObabmHNicKFc9tvgs5tTLaUnMsYAPrYprE30VHEfxa5pV5PekdH32Co0q5w5sBS X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7c67985-044c-4e37-ae20-08dcc2776f4c X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:55:40.5575 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GOIG5xK1HgVGLv9kfRg8mLHmPk1MDbWWHYdEhPWS3rsCiTiTCXvIK0lX//T+Hz43wJOo0xUHORc7slqZTh6zVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5982 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang --- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index a40e6590215a..33b9b87d8d3a 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -1005,8 +1005,8 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, (stream->timing.h_total * (long long)stream->ctx->dc->caps.max_v_total)); } /* Limit minimum refresh rate to what can be supported by hardware */ - min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ? - min_hardware_refresh_in_uhz : in_config->min_refresh_in_uhz; + min_refresh_in_uhz = + max(min_hardware_refresh_in_uhz, in_config->min_refresh_in_uhz); max_refresh_in_uhz = in_config->max_refresh_in_uhz; /* Full range may be larger than current video timing, so cap at nominal */