From patchwork Thu Aug 22 06:29:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772697 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 13901C531DF for ; Thu, 22 Aug 2024 06:30:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92C8110E745; Thu, 22 Aug 2024 06:30:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="Casx9A7o"; dkim-atps=neutral Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2055.outbound.protection.outlook.com [40.107.117.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE51E10E745; Thu, 22 Aug 2024 06:30:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jIuY3Kiw3rPLakY+SxLvoNfaeSscY9Prponf2NQG2lHCHnK2c9RzoGAj6H5T6w48XffpWOFuL9ufr7v35Nc7ODb40lQha/nUjHr4BZp8LVU0ghcUio5amOpUI8EDU3bc31X4lPeV0I3zHtiPu9a6g/jjNGhEl3FXybe3ixQCabwEWx+eivkG8Hv7kcUMCf+G0W57p/EvefeyTQucPy0QP0C/BMyZNXh7LnPOWEFg7nYFm0bG+o2Wz8LFTE3gCOh+mKo/rc3qCef7Gdlmdu2tEuIOFjH4djwIntJhzzogLpNgzhpmhcnmcki0+pS5mU01zPXNghP/MmHH+fhe9O9QkQ== 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=QUl9U73AJwHEryC8rgDppbT6afUudD0s2LX+KwpTMrGZjdDfwo+uHz+CIl6FjW5Ev+56efVWhIN2n9FIKxAWf+Dix4kFTyG2NuoVhqQdXJemkLq3Eiyz6wNwNCtWfBJKXmptiS1b/LvjlX5kEtPG7xQuyMQ9RuoT7toem/R+ijMf7RUVmNZl8SH1u9nWBLXqJAUCB/EV3hjTdvmdaMc2jVRCWuHaR4BKA+TtT3pCVZiDytVhplyACyqRcp/fyJfBvlE5jyBJZxaA/ynMTmT+MoySTTnEQwog6LyGGKgS7W5c+WKW2NHQrTQpWwAu8vM1mu557T9m5uZRHRTP7IdNJA== 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=Casx9A7og4bHBeg70StAf+tn9S/wAs75FgYFR8kAaU+MIbXEKloAhHoM8Fc243GhIkyQi4Pi4X8AcBpzORE0kr7SaJofDUX9+XmUCMWRA8m/biPCuAKLCX1YWfDdt8ZrzZU8Z2L1V9bPikMApOznUXIjXKzsY5acvK+VBbYvhntxG7mGNheWrtIi+jX0mcaOF7zi8bFK8dyfZ66jqfcsjABOST+1AUCMgcHLxYnXntAbK4iizM+910yzr3Kzt5v5RhqdV9sXyVt3Nl1IIi/Jf1Wwg9ReDuvxxCCc7LdJi1nwjpHlDPMIaF5GOX11NE1O7mr/ZVgh4KVqx0XuSshaDQ== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:30:36 +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:30:35 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Dillon Varone , Hersen Wu , 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:29:27 +0800 Message-Id: <20240822062947.1318340-2-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: c1205b15-e8e4-4c88-a444-08dcc273edfb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: xSdz/GEfs0DaUfGocYcR8GPvZTEXEZhDmrvloha36wc/q01YEuF6X9+9fh+zObkWPJ6OM6X/mOY22WY0fxY00iGjaVV4nB+VwKtocHWcSCx2QUIcsnWajJEy4IYL0SaMXBA2vPh1wos9QIRHfoYxBH0XbG4V1tPdfCy0gTdAUBeednscXqWuQizpZ0gqG5uU+MPxbidWsZXS0x/G2FagBZx6X3g5H2YjBJOpXqsiQjrBpm8q1lW2a1NjV6BWI58FZef9xyQzPrjr7qLZqOucU49Ra6ky+KE/cq8Gjur0CzfokqX72XiJMGh2XFZdJA1x6yIYqArF0M0aV8rw3TpnILPNZXLzaH5pq/whlgUScG6mZnKFRn4s/j3jqZ2PdkpunA/+L0tSHeJ/f/LSQPbiE8PHDoMnayjWWnZnTpCfvi8BtNOAtH3+HytOrputbwWbTWJhPYBqquSWV6F4MI+YsvohD62+b40Eo/pJCwBypc7nQmyfibQc9dqW0u/sPkzNltd7IkyNK67f6zCa+1co+HvrksKJhGlnJRb2I0cPQQohz1GFUFpMqDK/T5yq+mP1zSGIsdwqVoc2p7N6ZEAd9qC8SDM3kTMGVNZ0m5KlFw4wnA19CJTO9xcD9mRqcQHZOLb5bO+597i8NDzEehWw7YH0t21dp1gc4YrI6U3p9k/4bDmz3lUeoMc2zHKlDTg3FEZCh/xKJGkygQJLmNqBzFksgBXVl4JJPGcIPSp6rbz+gr4rxUGY9aTIyEpSQRAmt0gjSsRBpWF5P1+sc2QTp/YxIGsQR02zVkkMKLtRYPYvWF1fs4+nykbksOMbbVe9cGxBQ9esk3FIw+3FaYeO7Ufkykds8hlPqM4rguMw80zyMdpy+tZ9nxBcwCRj0DkyaLLFIwwFc5AgSXFy5xxUc8UFHr2EoRFQa/nMNCnZTw1bWCSpUf9hfv6yvMKc0vXdzHD2iVNEUDt3t7KhoH8yHUyTWrrQ3gMbjRs/Dunm03JT4otHbIfCtCC+FY5eXEk7FQZlgbUaAFPtAMA2WdIm8ULdW2tVWLa+/+nPVL4G04UybZ6e2anNa5jON5XIPwWdV1Sz13hOTc+/iPDRPe1cgDPYsxZHW5xWy9ESWOdAEpIWJ5nBpx+V3ClaMr06fD/MF/+THFSHLSMDDvETUyb0CadLEgCXm+VUvrXLtqt46h8QpBIMr2fOCQB/JM93+/NKdDX7qvG7ewihcjtrfDXHPgEi5bVxyePcA0JJB3vIRo3NeLg0auRewObvpaFgxS/qjWeDP14lcAQaeTY6KZc2KLkiNi7eOMBwfmJuQ8g9SqPTHhmzC21j1TcWbhiYLsdceh8KY9sEzEviJvt/3rlMIqGvnARv4TPkYYq7+JINs+eMUcZUF1Dx8PnbLGEb9jBP0CFeXu3pEMi4b23clSL134z7OuB2JU/j7YnjVpIXPCM= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HpajFXXu7wxnbLRfKLSi6fNinUaJBI2nqmT0Ko0dMO78njzL8Pk4DWA9sFcUPFz4Rsbd2i5l5E6Tqk1zdcshHNNF7ESSD1cAoNdtbLsGAe7mZhDkKSlFASEZShHKdvpFZy6Sd+rWfoB7t52VDEyt+G5BL6+5PaJO7mHoqeoaSFPLtlcUZ4UmDtx1bZoqsl+ykhZSXd9G0nI7cQFWT+KGAtdRF1lo7tUNG1bx58DRpoRLDKfP01j2iz27qH/Wfm7vz+l4IS89tUVKQEFO408Bpqnc0Be3p5YLY0StMzK/iZsIJCV/R46/uVUnhE9p/0cO6JhfrlEaLagKmf5oqqCd5YK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CLp4r3LJjxPgR+VchGP6MWYYTxkxytBBcBoiTbv7qvu8EC7Ffhi01UPtktdmq5ouTfjmaLLBLETt4m2XIIdFQ614ES0qjCroZnBoGlvWvqYyhUqO/O6MlrCr20ENKhvL+IaREnLuAm+pvwKipGuqQF15hK+66dx5WXZl3Uh2+yEZowyn9J4ONLqcJ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1205b15-e8e4-4c88-a444-08dcc273edfb 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:30:35.1624 (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: 4L3WWfoW06rsKNiCKcah2LKPNhktKn4/zyUPM3MbxVMeevzX0h0rZTu6PgBKbu0vau6ppiRMDzgI0Z+rQZRNxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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:29:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772698 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 4BEA2C531DF for ; Thu, 22 Aug 2024 06:30:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CC5710E746; Thu, 22 Aug 2024 06:30:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="FXmo/3tS"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2056.outbound.protection.outlook.com [40.107.215.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9538610E746; Thu, 22 Aug 2024 06:30:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OCERfs96POD3M/O74g8SCTnbi84ZlVpq2yzYOF19SaBTlPGl+F9o3GuH828sMrXjzxLNzdSC1wPU+T3bsr5MU+nQHR7yUHbactsemdNo7zT9kXkmFg+0FPrtTpEmRsc8SfX2c45EXKH/piWbQXMEYDcjvtNz4Iozq0mK/uYfSTl7mNe8xiXhYCbRtRFqB1h/nsZK5YV0Sw1uExExc40p9srZ+akDN/U1BRqBTqYy6Ayj4EJ5v7Lf8An279gP8ntu5vdxis8l5upk0sDnfDf+yRcmDi/InKMBEFaSJY+ZXrDeLaczU0+rNI54EWYCPwKHvjnkH7qjjJymWHL+WLpxVQ== 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=R+awt0WgdWwZ111rDg2npsQzNFfFjE0b7st26weGaCzQZD5pRdOkxaXcosFyQ2n8ey/3WsUdKDeRGaOhgQBqwDfme/ibCeZAuU1lWmbHjtk8akX8v0zcsoHaog58RQP0+Sr816605Rf9xaE1IpmY9VIarjYeVOiyR3E6oRyAjgst3plRbt1tirSTlOgGGz1VyQCtwHWQGANpC5Qoqz7w2Y+MZFOsu8D2Psoku24zQwC4gfW+esY2poGbg8PAX0tTBDcEoOZOFUDAfLv3q69kn2jChC6lWpf6NV5MYAdy2PEzZEgKljf75p9jAtKr8MZP0VoMF2a+iZQYAc4po6JMNw== 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=FXmo/3tSEpJg5fUvlezlx7X6qdmwe83SKCSEPo8zcH9GO85fQ/ziXNH4mkR4mthVzYsOf4PA9BO5lL4Yy1esHCm9AgNiQNsjSxD+2T20Drcn+wJf9EzqSuq5NC53OsZyOw9yPTU7TyiMHlt/iZHA2ljmykzajYqs6ZmG4jyLrmBvqHt0ye2+UcdlBSG0QsdtjeZrpPixXKccrlToaUxNEqUycaBc6gkPfn9HEuczNEjWJ6MxZ/MydU4ozB6Z1qkWmxqAH8W0zCLGkx/u6Rv3RAp2FprEzCshI6IsUDirAoOLqKsbwSuHemIfsG/OWFijRGqgZjDP/sd/P9+WhiwWmA== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:30:43 +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:30:43 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Wayne Lin , Dillon Varone , Hersen Wu , Aurabindo Pillai , Samson Tam , Alvin Lee , Joshua Aberback , 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:29:28 +0800 Message-Id: <20240822062947.1318340-3-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 82a99653-18d1-4f26-1c7b-08dcc273f314 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: O1e7+QoSZI5tGaJo83rlmyp6IqisaxZ80nspoBss2Gxne4/xCXKzc/AmjeU9q2DizbssWzluUE0OiF9CNxogx9Fi+qv+sSgp272Q5wBAsW4xcdIGltPCnRCg5+Z/0q67dXFarASeOLqv1cPcdOHkbzxu4wHFcQwkHRyavOTo5y+6GJkzkvbRApNrw5ZKbKmSIf98LVef7Wf0EAk7XZPiXgS1lg85KMQSm4oGduxenjFQYgy4+eep2o9jfd69jOUDV/euwVcVyNNkVs+3biP36cEs2rPg+QKbUVf3I6kMAfLG+ohjou1LWfrAybc1GSB8r+hfQIrBlb3mNFFJXdhwR5aTxuK7NO/KzuMUu+OlIPPYU80nZDOqy+fQK6uaYiYPc7bsabK0nfhxav+6Z2pZUQhm6SUk+toFqtOTTyk+28S/NwEyp3dx5wynEiL8uxTtH+RHWbpg+biCP3BPMv7ANsTjWewyKv1kNLfn5kjYdj59e09d+dj6YdJ1h6/A12GhyBis9CFEG68Yc1tvDppTcIoKYOoNseZOnrFgryScF5NxVbyRkefLTY83gJjVs5BAojRgXsSQTX3Y+DHwKSDD7eGfzowvLEGKZnS3wQZ6oFXNm3xViv7/WtYqjZeUGy2PMgH6ZySNhFjJgShhgiHYXcPzPBRC3uwkYarOEp9JCR5AX1/WOTj1ZbnoelZm2IaMMCCw8gQTYrrH8Ej3qeg91+F33gBQZ3LSvzx8hvSAcPlBgetzpzlOEq+8WKi9AKyVGvqmtZubjBSk6eJgAG+B49/HCF1iNr9ks9oU5Y5NrV9/e5nCGLVWXXUibGFLIL3j/6sJT6e/YCeGHxovtrrm2KSrSbfeM60dizJAjNOoFYMBgVpxAxvzBFkXNNrLKopKjd6verwclMYoFH2lvQ0ud9btx7ZmmFIxvt49+q37SCp9d2/SF+kRLs6N4qqLWppZtdASnCiKqnyz14LaCu/plfVyCrzVqRFr2/cqmjHGHmfivHYPL5aayE8l2uh66AyjvrY2sYHnGXTRwuS3wGG/+FfmyAvReeNAER6OcfMkrq/Vcxuo1Mp/scxci0FKAozjTRtgDlHUvA7xOQ9Z5o3zIQHgVjncw+DQCsGe3K84w8/y+WK27yiNgu/G6nsgRdsuYJjgT8DKvXq7Tu+DRedR9wvAZTFFY3ANhRMz7E/BqHE/KJ2avF9gzTXmDWVnT238AJggzHzdD87xKuj4XcN4fDEVlpuAbHSgI0WT7eZhHnXa+NiloA61lS1gzlPnb3GC49FZSRppidGoTsQYYn1qBs5PmUTR+7sYvvXj4vNsHlActxjJWS6XGKs6IwXVhuMpniYto3/Iwz503PrC4WYs1750S+qYtE8ySaDAnUEmXR5d3nL+fKi1VjzSpN2595RpiuzIGhJ0a3oaljCvETOv37F6Ve8Epk2O/DN25Ln4Rsc= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z4p3ykxodpztXJfQqKckDuZ/4fZSmDeAGMdwPEfiZtfQGpJYDEV4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rwPM28FruGWaZMAZpJDMSDponyAiSIyDq8zknKRCkflTYpm16okBWzu13THIHytgbhz6qoi2NR9SStNDHIdcUhI1FAxXePUV7HAc1yZIiYwoDdLhV+6JMPAxnMr2nKpSpsD6xbvxuLd5tO1wdMm2LLYYvoNTqJuLa/CzaY+d/x+Xk+/AIEr14F4vKXI9qE+4E9XeqafrjJ9r5KE9CXoI/bWogxcCc8TUn6Bgkgs5AYWNA1UBK/N5hTOV5Dxyj8uhNMa6t9dE0g/qKmNj2kvak43rE90egOGI/1qYDpM/f+rLdytVMzDsGYzo/38Y/1riXfmQwzBbYuroFrHv6vtjN31920n4umtkZzQo3ucXVBPuEJ6VDVwy+Nlu6JcpIpJ/mf2qZlXLYKbOOR4VGVc9sRIl9Jjehp0YJv7rZxcNpK4Fc/YkuuomNRdQnPW+uQmZjJ+vEWffTjiOI1AjpSeCiIRqk X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a99653-18d1-4f26-1c7b-08dcc273f314 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:30:43.6768 (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: spBNy9p0cO1jIJrzj2eEPw5IjubmdGNFDCMV16+sjTPIrjcdf5orbGhP6paoHJOso3WitPycvU/mpb6F2KNehg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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:29:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772699 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 16864C3DA4A for ; Thu, 22 Aug 2024 06:31:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C56E10E749; Thu, 22 Aug 2024 06:31:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="YoPRiOYY"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2088.outbound.protection.outlook.com [40.107.215.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id C39D210E749; Thu, 22 Aug 2024 06:31:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vv/ttxtk2di8k0Ry+wHbOIvS5W+kPhdiD6aCPOWP+4C2KbiNyWzo7GpHOuZ7YEr0Pizzxvfi/l5RAHK1R12qd0XDRXOvu1ku7sfaWws9GyUadJCdvt3MhW1cbjBjPJV0jX6izcZgvZNtIPx/H9cetU0pbHt1dPbqR5vAxO40+k5gmO21m/uz+GeFb3U1G0PMSEr/nnFfAcCkd7LkQRT82SIr7SWgQBc/KqUEIOQBblWHqqlqRwRhJAHiT9PvavnLjptD2k2iyRFgD+19LdXKAIn4+FRfQdtfO5qban2HLkdVxG3VokU8Iq9WyjqcHer3YyBXEj139dx3Ui5IBsFdJQ== 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=u6D0vxGZ9HzkNFejbPwfM1VLXCItNLtXrek97h+eMoQadWEEgrYjpuJihHlYx1eIpq3OGN8NNSlskmdzHml2kfWNvyBD6GBCgZ/pe7wnNFSHqYfSgQAVPDd77WlRXgTs4nBSn/ahHiJ5RSLyr3wVKwbtSNHMpRkrzcxIA8TgGOS5lhWhH/Z7jaNR8PwZapN7WRhIfbTJ2eLh2QIiYASr8Ccyst4aERxwP07azvdWzYYpJ3nYBz17xNiiH3h0CnoMKiJ/AktUv/v9WBOQKLXh/JgKVeiC8ohDo2phUB9LAYNfcfgTwY889SAK+HkauaPbYwz9h1nbdzff9R84Pvhj3Q== 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=YoPRiOYYE3tnaYYrd6yRHqIiSOqV/rvzzqhGOEGKfOznqXL4mj4jzxCSThnTjPZzVlP/i/RqJSK/DKuBVLDCZcTKsn424x6Xu+MiuGxDpfmDpOVRRB23Oc51ZamQHkSaYHO0Z8urg5NfQ1lR0zWI25Zd/qP4AuZ3El1FNBbFuVCY5nErawFEfWQxOk0Orpo8MVEUySouvOmGfP/0qW+WaoPxh5NR5PbInht1s9T6WDbineBYUtaM4sF8CwQT7Smi6i2GSHsAv35cwUMswP3aRkw4MEscxVS8nSBVl8W9T7Xcp6Ot2rwLnZxKYow+xKUB3RZtM2sDeUSbE/NnHAcmDA== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:31:01 +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:31:00 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Alex Hung , Hamza Mahfooz , Hersen Wu , Dillon Varone , Wenjing Liu , Alvin Lee , George Shen , 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:29:29 +0800 Message-Id: <20240822062947.1318340-4-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 69a8ccc7-9cde-4a90-1426-08dcc273fd59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: AeXGn4tS0gACzgjnWtBzHiB7Kf1TYk07OhDkR/kTgM5FWSRewPlQupoBRXfTTbRrEvXIE8SNEIt/1W90UT+F7EC77B8TBGqwMpJxgakBASrC3Gut06x/O8yBRJBGGtwdued3lWxms1tws+vb87wjgjbbX9Ms8kt6zMtbzPSG37+zSHhgfZJqoUWzh3+aVtJmUQHUpMb2gv3n3kkQfktknfyxhJVA252/mZlzED8yGXKy0Z+wzx3c5Mw0m6YUJ7I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uPd889SaKeIOSOUIYg5xcRMnGjv3DczHEGQ/59jqzhjvTjYDV5JsvxuvOGtVnVeic6NZ6MO4IYdPRup316akmyhVFTxqhCdoIcnRqUwqAcx3fJa8h/ZXAqEHU= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w8PAf/KI2X2m6e8IF/syfTJroZUMVhDAY6bZYjdcVxfSpaO8XEopxVjxaZ+LiFhmlLF4KVoocIRFZvmveW1NZc86r4Tv+B+EMtaPnr0LK+cauHvW+mlQEHEdKZZ3z68vfamU/V+52b1D4K9gK0jz4MSW5m2O8WvDXcngEQu++ic1ohA4sNUbHOJgMjvR2HeBqeSZgX45BKkHICc9ij3iGi7PpZ9HnGwOYgm3YrnyNizovDTM6kI/mCTcMhFZJoZRmQHYk3CooiVhjn528oJlZMUqHlEMjEsKfCwtEmNFb782d5YKCwRoJtWsoUBJ2gja3cq5apcDw7+qDk3542j2wuIK6uPTAanE3ENPQoxiywKFxBEG9gIs3QS4J88T7u/t5ZwOTmoZbueZfDDZGGMEv//9KOQW4p+LvMZbawXIiVL7LOjKUrAHw28WPEwbgbPQsnnJjOzzD8hrqgHndRyBqBHiedzhWpugqJykqsMdCLz4ApqAWO9w8MVD5KDdTklErvSnce2Dke0TqZW2MIVDvlqj2WljwD5L8TGoPGpR+oSk1njgaR3Az5FWJ6GrKwNP4Sfz1F9X/xlo7/7Q+JgFPNydOicc+8jZXdkZ1PUZynHaaqddjdHDgkqBl1GlJDhnU7+lGlvPCh4oTPEH+xJRV7YRP/CqcNw9DPX7D5JTlyTCJNHXWfjQtW97kbVNsEOcWu2DdEQ9w0HVNEL5Vlz//DlvLffP0RU5oZjQ01HR0WVzrlY68mXzdQVjohsQbbduoTEFMgypyZ88BTK8E6XZ++ZtH3nBCCqmHXjoSG1oSPaMPXrgsgaeTXmBIWvepctxJAOk5eVqnxxSiCXbNkOUacGn9t1/bCFqvc4KoPW1ChXhrNnIJyQIA1xpuJHHNTH6HV7LOCg1sv25yGTIslJrmZ1LjzQpCU1uYfYb+RftUTNZaXFHCjtvm/OXyjLUZAPizZLytwawPzio9xFmfFbhIo313pQ8bERpCIQOImsb51VZz0a0/ugYB897/bsKa1P0Yi9upl9+kUPf/wJ+AMK5iciHVwDdkFMOXHMHDb9GKc8jLPSrDXMxC8lNQAdR8V4vShZqOXzv1hJ1f1mPSkHUEI/0uLQB0HDabF3Zy0WANSBMFuBoqtiR/KXfb8oYo4DXUKWGtcuCzFNIgvY6QK62o1s1gRAP404OHyGI6/EUK3jAj2TJaGiZLXTuRfBHPYuO699MYGobjwM89tNCin4AQmkctAUMRVrKksr1tS9NvMNWc7SQtUSVtIengQEBOy88GFuCYwrCqucNudcHQ5ypMtqs9qJ6LkXJke/42lrnGGIeHoZ56VwpFPoNAtEJdx4N1COEMjN5aWrWCtxwz7u+pTNZufloeZc439sIvst3i7H3HyIohlT3i64CafdwOPLeQtUhR/HKKZm1ISbEbutHzY4DQRVtzF03kTAS7Kyb/Qq7UspyTwY92J15rPKPk9yJcl9ZpFTt2Ksm5Hd04JHuHTUTz8LUpReIaFx6T+sMPJ+sQ7b9y0ShOO9WF2uTn34+Fbox1Lxn+uJJ/8EmJiqCzx0sT0zb6DBDM2qOaxLuqFOco4LWU/sPzux8zN0qfaku X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69a8ccc7-9cde-4a90-1426-08dcc273fd59 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:31:00.9032 (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: loXKKdR14urBzbqbEwGaMEAWVsGRI30OPya7keNca40ktnwH5l0lS9IKnZA/x4Z67rhti3erYxNfRzyCCMciAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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:29:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772700 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 09863C3DA4A for ; Thu, 22 Aug 2024 06:32:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FAB810E035; Thu, 22 Aug 2024 06:32:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="VoqjnAiW"; dkim-atps=neutral Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2056.outbound.protection.outlook.com [40.107.255.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 720B110E035; Thu, 22 Aug 2024 06:32:08 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NXtIpO/d550ydKBI6J9APSpMsCPI3CcUP15lt8O1uQ22Wc+a/lBEgAS77KWCo0LB7dVpyzZ8sJaY/dR/5ruhCCtiwNN5Z+C1wdv9bM/3Mzow8qkMilhDgVqsTvRTSVDgWb0I+bBBVwWIYQ4PW4ng4Y6q6PtOl2Go7lbJi0MJYJowIWX15x6gd1n3/kmPXpkcvD8qpyBpU8vM79FzgRQWu4sv4lGM62V7v4mnaEHz8gpl9jblTC/t0kfmP20oMryB8w+cuQzNqXKZIGOi/M94hz/YkRY9fddtQXqfVHUOYDXS0cOy6hodOijbsuQkDHDM0nuJ36KHKIRoiUyo1JcNIQ== 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=hcjvOBc5uUG4WiGxO8w0++9psOjt9MrpA4HPaI3EOJttxCBR6gVVnirgAk+oMoChPwL76wi9CZlK93mBIvTdfEySi5Xqp+sAIPbc52Rn9b76ZhnxOblh4/DWTjBUW0RW+iVFO/SudaG3B5c2jNN5UjIcHmZbpPqGGUErWnY+R8UApSBBoOgg7Si9YevY/QsJcWcZkNcdSvQJHaCiQqMYVRTypl+X3902PrgftQzoISlWHCQuO1fSdyamQRVLueWxeudxrc1bg/1jwHFsk2259nnLNKxNAnjldPaTPreCMXcKg6vYeirfsU6p57DYLKnSU6EgleRHnTPq7yi7jdVtRA== 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=VoqjnAiWk/n2rW702B2OD0/CkHDtz0/5bNBVz5qNxqEuso7vUumEC3Yb+KIAy5CZ2sMOn8m4Ind5PqKo0xFFbaCk5QcXP/LADbJovUtrTDuBUDt3NYkEsLKmSXEJ93Hb+91z2OjoginTy+iKX5TNIx6cg2Pb72JhUzRgtBIycjSAI9vZGgUnW/zb4NNf4kED/bXN5skElPT0zHSTNx2CjtduWZWwUTXWeUInq40KpVbFcAvIl2Gz/F4d1UVImHD7hM1CTISH6CiXyLQQNepHgJt4ppGYmzRwyTF8BpMeBV1NcDWnSYzOLpZwugbg4hLrDiMc00jDrvd83kHxT4VV0Q== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:32:04 +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:32:04 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Wayne Lin , Dillon Varone , Hersen Wu , Nicholas Kazlauskas , Duncan Ma , Alvin Lee , Srinivasan Shanmugam , Aurabindo Pillai , "JinZe.Xu" , Qingqing Zhuo , 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:29:30 +0800 Message-Id: <20240822062947.1318340-5-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dbc1ecf-2852-4624-a0ad-08dcc274236b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: sEQpezvNG+V42wvvOrLhsCqxeJ2C4IXAOez9CzSSAGeAFP5xuY2EzJkgAJOA6yPn2dhqksGPgpuBjiV9hHpTIcxj2iPfoleHF1kqMyQ8epSmlHJn1T3qHCkdJrIWokBTfiMDo6grRr0ZzCETZmpaPOdv3XfaFHnX21F9RrE64s35SW/iQPptdrR6ibh3pAoP2ei/W8Ba/VKVkiGkVFTTObgMZz+fPdii4/+00SUOp7fIFv8askR4Clz3KY8Czp8+O3d7rqiJD7yM++r4K7e4VC0PJ3TtSNedjlEpFJRfRFoLeFi5hIhObmOPBg9vp3khFwzkt73oP6MG+OnMIXllup3+sxtPxRudqMVnBYObFrIq1y6JT3C3W+Rkg9kVMLJNVtDSDxDr1NCsX9lf1XGmmZ8uDok8dWU9M5VUGxk0WJvicyjPaWF1BhNclJp27bPaKCCNuq/hDSBafFaN7UJ3MN0HRNwurcNizQ5BoMVZ+yNW8uhkR3v4mEIRVrbnY30sQz3q0fqPEQk0PfCS5NEYLRh5Ixq+KKZoQwFsMp3p+Rjs7ZTFuEMIHIIt9tpQgCVIGv6XKiAbW4bjfHOU36cVo9H4aLXyOCpZXNc8zP5/ukFv4nm8Nu7V22qZaN6ysjnHJIKNJlogXA1N6peJraUiRIm1pwMyvk71qF1VJDdSYGq4qlB8H1AUCXhxKhZOYw8j6r7yv2R1NAXwptYiDASojzBfhebh8cTR4hT4fQM2ZvOfrzh6eOuDg8RHEIscDTB4nyhz1SkkqZTsrwwiryHf04yd72fiXLDmHbm5FuRLusc5jj70+/iEt+/skv2A3lRl6ZdiCFxWaEADfEEI5SbV+/kyxtzBko790Jwj3cjM+ByMRTJRNb6eTPxuxpSFyASP0gtcNTzNI8k+uHEgwuecAhI3y/jCZ6fKiQaecQnB5QHT3qThRBNCpJ3OUyTV+gEwtf7x5R6asAm3uBVC7ahvoJ5dmsUOvsnDY5NxEgZlTpQq0mRmIfYJY1jYnLsB+QlzN0sJDK4AXfca7GggAKwXg4oOn5EG+TUeE4RSLxkfhiganyT5Usk7F3vimyKehSpwCu05eV6DWYPrULConNfPODKPb3jOiQfVxmsSSRcrfM89Wbxn4HekQzhJHoRxB1uNx5qhRtScdFR5on4jbvkaPb5Jvc4KmwsLZa7KIAu3wa8C5tSDo2OGeKmyiouNQKLWsZVi+km5Z7/ReUMlo8ctHD6JgyH6S+zyjOmlN3ZBDEbe51N+Tcji13MFifAws58l3SR1Ro7STlPTS67eTwblyeoFmhgmCJV4wupU+bwTYAw2Z6yZxGgMy6AyqCCXs+i0tqDaBf5wtXUxffl+XD6183XIZ2qWY+0jU90uUoGW27vjyofRccJTlgIMcer0BMZEHdmS/zIjI+rhjvRG4euMReROolDKJa0XJzEMP8WDDP4= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x6nDsXL4LoTy4H+pgeoSoGsffTyokPjFPucE9L+SSH0/t4rJfAOOUlfuJrBPlJuDdNoEFXmkQ+VBak5wdZ2DU6PqEFSZ71t+vTDMY/mFbYyprBZ5Z4RWDUzdNfFU1JTwmlQeNZjQs/xL8MVOrBDHoj/i5EY8hqPerMM3BFSyzsGEkVlspsQ0y4E93zXhKeJe3m9Eda4ELMhLxEvxwpzDtjXG4bTe2Dk2T9xEKoWtJ7QvdG5Pq6HhSKkohEiTM5/7ljf5nKdidoHeaS/e6NEV6MjfoV3OvxVPrItlQJNAKzSrTZtDLep6rBgrOErInbl10E8+zvPWoVwcDHFGqxTjqJnnQa8NVayyWlq1o7fzHroBR9pC7KOOoQLEeJfxIPy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jc4zTfoVd8kAPR0Rtca5UbKi/dkyy1Atey/e+k2pEJGDIKqMsRxblnfRvO3l5cRigsjHt2dZy7AoOP+7J17EoqpuZe/SrfeX4oZRkjCeCzwYEsM/KiL+XpyAFhSs46vKEJkSjRD31mB X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1dbc1ecf-2852-4624-a0ad-08dcc274236b 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:32:04.7786 (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: gNIfOZqtVb9Dsh988jBlM3ai6HkP9QV2GYp3mp+HJze7vpp65212O8Ly5bwkR2mXlB5qhoyf7PGEtS+sqoUZwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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:29:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772701 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 45E6EC3DA4A for ; Thu, 22 Aug 2024 06:32:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4FA510E748; Thu, 22 Aug 2024 06:32:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="gXOu0ClY"; dkim-atps=neutral Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2040.outbound.protection.outlook.com [40.107.255.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 674C210E748; Thu, 22 Aug 2024 06:32:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KZuNP9y13tuy7cVxm97MY6jzqEAmflPSFKTk0t8s0eDjVwPGr92BqndjQV2o2v/kAycm/GaBEzZeK7ejavUobbZpbtiMAbzkIfNx6rJ6p9O9sZTBngsV9IJj7WiCwdPS40L4K2DRBKfIuB3JJkX27R+q4V4GW5BfQgc5uPYVlKE+ubWIYqjpgGi8z5EQ5YzcV8pGrwydLpXWY6RWnVSi5Z4k2ybgo4Z9BkT3hgxMyfwmXf7CtSt3ELUZ9ZyDy+wZhoBBnwn13fJ80F0+uDR0rs75D+VmBveiWP9vN0hdPygoJvM3rUy4RHW80buRU0UuoYN+tqkxSHFznd3lirg/iw== 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=qWNaH8XxfCvlIZoe0I2FGHfumtFmC+n+N7JfLAySaM1DDMEWX9njgYupYqI2AtZZvTrPQEbTvt9JLCfn0MayjMWWhRS8cDX+FbIBy4N7k+KKBNBo4vvNSLYxY2d/Biv8PjvcfyeDrIc0qMDoFcHXLL6M/imiRzKN+A47dqgcHfMsq+dnZcWwdpDueXj1nKWE3YqK2HI/XEembgA2AOmTrj/ug/45cq6pcdmqwogXZcUSevj++Sl5PmhMfOU3/4KoZrW2NRqKXajQZmtxIwVjUJjiSfMv1acxS74HVSyYKENkZfQd5FwTCZJGzI9zxLokthj0Q4UPsduSC9IFIeBHqQ== 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=gXOu0ClY7j4MIa5idbiUl+aKuR/IbCc/gTnC2rMJFwyPhNw2dp9wY1tDH3ncK9g70RCyI/ZJh6aiC22hQ9d1kf60HS5Cmqzim804Vo9z9Utbo+qoLdhrbSikWqpk+0S8+i0ijpQ459/5C0ZrA1td6dzin/XnHjpg9rojZuhD27DE9PgiS8Ob3eQfvzQYpjHEkTmMb8mOvJ65RziktuJ8tWlg2rjNzO6WXbc050Pt488a6b+b3W4xlytt21R4N1z3N5yxLxPw4SlbjLFLsWtN3YQPI88UFTirLpESK+Li7f+FJFfd+MaellzJS0J/c19BRpQ9nYrUMr8bK2YD+CGQXA== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:32:41 +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:32:41 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , Alvin Lee , Dillon Varone , Hersen Wu , Samson Tam , Jerry Zuo , Wenjing Liu , Aurabindo Pillai , 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:29:31 +0800 Message-Id: <20240822062947.1318340-6-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 77a5c5b8-49bd-4c96-d2a2-08dcc274396f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: Z3lIDAgZd1kLUOil1pvbHA558VzVN13Euv+RtTRzaulPc8f1ymWeMTjJfnvh8d5friHdRuFGIBaVmPhvAMy8jCNAB+LximYdb9PjFkc544JY+2FWWyBZTJk+tigGjELd2kZbQVyd2NlP8uw+5vDALFb4YibNOjHxtOV/5wTE133m99vG0C/k1jZyLiRuIYfEsE8gRS/H1bcT6QPEPsgow/wTd7MzaWve/X5GKcimxs2FEPID5d7+AkxAMZsxfaAjxaKIFo+oOV9VxNnFJ9nE2PRNDbUaBY9Up4JlaUq1RJInUOpzD2bB8YeF35EC4opi+DOG4htpoqU3Ah7IMvM/1yerWyR8uHj2gAwVOMR0B5TdbFOVh9Rz0EWjVTVLAsqgz/C/urDJRILsBQMm3kZ2udBiNyhuDOL7l4VD4MbuQ9ClxPO7aNodjs+L2iyExEmx/AjPGbHvWK4eY5K67aYLAS/NUBg9LqdLmHBrD6mrNUuDl+zvVF/p2PVXVA8+EOdp8yd8nHt5XRw6dfsIipoWTMdZpOAQE6Ki6xh1IRZ2iS4FE7buPhOYMexHYSpTgNjmbRevfRKlpw2wfsKyCc6y8EVcsU5LWx9WI7XACLF13ickB3lj158ZKod6aKcaEHzV2Ok6tjiN5aisZm+9RgMdFmxZsel3gvgPSNA9jsJmhuSfMJI+d6jXQprkay/ZJslVMIaUyQ9YcyPH4hvyZYNe8pna45xrMOourDa2CSpG2Jl1kAslzUexeVupzDQW8jUkhD39TRIbBplt7F4ChIizoYZQj1wHQ82vF+lUolxybsQiFB6/h/HF6JoAwb1FoEUhKObqpRLA+NHAFSXnzeMEKlBezBrshe2EmXF0UyisbJqWWHfBHWHCxbfjkU4Rdg8FdzQMSHrE0UDvmtI+Fb6iNEi8xPDdGdZFwdZ5IRCccI5n4YEyN9QlhVDhCn/QVmV+hztZP+4yV02rOv7MwHDT1V7F63CO76Fct2Xi4IGLK7EGR5NVwVTblMlj9ESEQmY7uIFECUg3rE1VBv6g9/Iwdsr9if6Ln3J9Xk0BwoZY5Un+JS9tUWkdnvtQ6T4mJYI73MB9Fy28gTxpLoHR7sCWXE5bJ/CK7qZocS6wApwkDHoaBIQ7ivk+jHFoLsd/aZXEvN3hgbxCakx88OtFCnfAjBBLCOcC4dDDFjcqW1r7HG2wAiABOH/bqO+ByJtQYU67o+MlVtccRH8noO95IVf30wWTAutqi4VmfPvMVuSDUS/HVmhe9G20HAztE0LdN3ao24ryhrT0f8TnouP/iTlGHxDfyyA4yheTuU4q8igb7efsTKjXbyk10crlsD67kGc+QsytrE/Jv9/20rHG79uFnZYQAuZnYpjQb5y/UnDrPql44QiFKc09+FBi4IO2aerRIqGvtzmQRVMXGSTwCJTK2h+bPNv+l1waZt8ZqUZA0cY= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fl8Ibi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JNCMA7bE1pHO7i7h7p9EDlf9FDociqFVuJwp7pbjFk9O/SA6WZBf37KhzP+5VeCvkYEV6nl0sKNvVJwmKMlGanP+ZE+kn6/8vB8PvxKbvwLsOX/JsccnggcVx6VDBWDpoaepQxjaqkhJEhhc0ZghBYKIaXBnUX4ZiSsCd6TrlGOTFUCCXwTOS/knDksT1cOduRA8lKtIKkMCpvUczfGBz3aKvu3PApuEkm82R9PkbpvNe1UUvg2aPd3Ko/qnnKU5PWZ+BYsNyU4NtKB3ZAXJ7Lygr972FhX5xktAswzkMFBcIiBGoW0lSQUqVpWBhTFOzQxTqWoMZB1aLA9tFgzN+uwwUkzEOEWYNpjkA1HHB85EDe4efmB+SFoJAzryFTWYsmSadY0o3B6hQCdPXiXiQToARUTC+OGvzQHJzEP+yEQ8Z2DketLca24ah2av9B5BgRTHCWpefN0qZppO1hLeL2NGUnpY8hfAlpW0UdBTNWMhpbiiibCFZNQvai3K8WqySbNsO7QbzEcqsRrqDSTJy X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77a5c5b8-49bd-4c96-d2a2-08dcc274396f 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:32:41.7272 (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: 4L/NP5YwrkDg6AVwHM59fW/OhAum5Eg99e+vj6RGlYR65PZv6orbnZcQHzHNu6DWUuqHfXqC74Ng7oVcculExA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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:29:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772702 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 F41EDC3DA4A for ; Thu, 22 Aug 2024 06:33:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77E8210E751; Thu, 22 Aug 2024 06:33:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="PjEO3pv2"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2088.outbound.protection.outlook.com [40.107.215.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id B7C4910E75A; Thu, 22 Aug 2024 06:33:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mhydPUqTXtWKBKsHC48XTbizSwLETDEWuIIBu6k1/u1YecVvm1CzwSgBLt6UydgdVmnjHwkYhVNCwguiGWwoJ/pDqiKPsuHXTqCAU2VGy3TTHuS0LwX62Gnf0clCE3booNpwGKFHGld6zZYt0Ajyb8cs9RUol3JIaPj4/hmRJ7PAWKsDJiOHhm+tMSmQa4Gb4XqH1PU1qRGHznbm4Zj3bH9YZ8wfxs74dPI1uFpHXxbNpu8FwUy5J4VIsK3GjjIObFNHX7Z/bE0T1Uaz4P8JjpgafIzLROP4dhHX7iqd0vM/aCJ/MhizxVkhuzyiTcTrzuCLM2K8VWcH7XQ+DhssFA== 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=cH2f3YPlAeLukcXZzrKdXgNVccBi/NhBJtHTBrHoefF+mElLpStTF+bSZAb8JWv/5Vu7zOgs5RxX8BZQQ1LE1pimajW38g7MVpQFwBDPJMR9bLejEmHx/41fB2mya+bOxkb6T0pFLBEWamDjnStEsWuoguiRxJCjsUqpjOySLcEpehZLCbUYr/MDNTjc+Psmq7jQOBLHtDvmTUefHGxniHPl+ACVxnl/jWABl9XPeLOtKBrQ/awO7SQbs8u8EO8OpxQVKeWjZQb0LKlmQJtA73U5udjaikewPueoR39X4/2oSbfuYYOsJR2wzybm2SDn96w9mC/UeDHH1apx2ABQYA== 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=PjEO3pv2oR/S+PLWmRo0vScE1OWfK8PGa8AoKr6rgGNP7ij0F0GL+rMLW7OLTrwiSVXS3A4Oo8FkWptLxPggioFCOwKsNOJMJzA7TXC/JMFpPrbVj8NEhMJMteFDuPiiqBWfAuxtSRInm7qKJAVxSglaexmgujcOT2f5ERD36aL4N2iyrBfnxspfM0yx7L/Jb9PwY6eQ0rTDJga84QtEVcETaT+GlHZuOqk9ozXhHFcq3A6Kux7ePP3KGelPN2xkhG+mVRWlFx4P3H1YHFPzR90ZBDKV5MpzPyO7wT03F4BL73JoKuFxJ3XPBe7YQoloaQ60FS13Ay4Qqz+3RwreKQ== 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 JH0PR06MB6344.apcprd06.prod.outlook.com (2603:1096:990:17::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 06:33:37 +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:33:37 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Alex Hung , Hamza Mahfooz , Alvin Lee , Hersen Wu , Dillon Varone , Aurabindo Pillai , Krunoslav Kovac , Marcelo Mendes Spessoto Junior , Muhammad Ansari , 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:29:32 +0800 Message-Id: <20240822062947.1318340-7-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822062947.1318340-1-yujiaoliang@vivo.com> References: <20240822062947.1318340-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|JH0PR06MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 2af0cf4c-f12f-4cb6-962a-08dcc2745ae1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|1800799024|376014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: 4W16E6UpVblwdo9GArypANUqazeLf2MIOQ+68FB6QqE6VwOxw3s4kK0vRr5mpfVQ5I6oOCMLeVk7NsOQ84ALaLXjAlSxerQGUYuZzUaQ9nW6Z+bG11f/JdzXUCu+hOaDUtfMUmVdmkTn2k0yYV+i2OUsoMLvIZ4bVZM4XgnmkOFKMaZrC4BUWeCEGWeSb8I0CZINyuCaxWcaAapso22bMcTYT4hGNnsCSUpJKtDAP6sK6txDlDMubDQHRYmKR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0o+ArjZnbIiSeKL2cwGS4Aad9CL7+WMAK/Bo5OF4tkJJ8fdBye3yjxRtBnLbq48t7EMFgQuTAAUQs/OkY1RxkgNxcJiJNX5rghpggFuNqhaqUtpo8tICfA= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l+k5A/zjVJglLaikg/BaflaoCswhou4nWKEgZizY1LNncU2JAzeLnspUJdqxBw5JRqwtZeNejj3thQOZA3Ig5jE6CO/XCIUimyfz8Nm7bodAhyz7foymLaJSbwJJW9dPTyrQOD5vkiESLKGe6qER9LyoEjZftHnBeo5ZfS7C5H1l8ERDac69xRir/NFe/8oz09E/p7LHQOB+lKBWNK4k/UNPgBrvXQZeVZHNV4A3xtWyPLidCQHefdH9u9I87nH8SIhSICdxSr/Lkk+E8nQu+QWOWUGoxuowwc6JrYxdzk92rrz9Y6zlV4wgC9E6wHhTl/D9s1F2BBen7H0Xr7ZhURq9v7dTsRezJHyl8bI4ekAffHGENu5sNEbnkymJ2VXYx8Urchx5qNOIQyS03rEMEiEQ2JsQoZ/Wgr01m5l6k4IzsacH5SIgNuQw3gYrF3Px6B6smrjcHHf8a6M1/2LYO8GHqKX0K9/d5LEO7/GNSlEL9JOYH7J9aVMxAkjB2QcecupOKJXa1LncGjilOzmGCnTsI02Mu47wbGhZzZ15VOVo3HUx//RxFWRk9Rl/DrmQdQhSBkgRKv4/XqgW1VfYMLUzKFOksEu8PP+vbXHCrrYFVfz+28HXCj5IXZq8VO7+VCdz7I5MsNmK1PUjAd/b55VAyKxpWNhMtiTcZ8lnDzPKuplo9DqhsZ80rdTS/Fz79DjKkvA5rp4kVIMiD57t+rk2noqkltavP2VaimuTpHUILdpTbXHMtEi5HKW0psjdwGf4ckK3GDrbW8nKYzOqBGY36mSzYdGtujWT43NhmauNY/C8AyZubsAEHuCk+MivsN0iFqa70J2faep4RXX7UNHex29/MdUkFoIlKKvjnE91w/swzcxz27io1mwL3Ki1Vf5sfC331qIUXIsj7i18RQACQfK2bYOUVGLBjqPl17eRi4rFOKgqjBPnccCZbEkyKd0CVcyK/oNa1AB3t3b7Nb9sHSsYo5c5DAZb5k8jI6Bc8qOpPvWeP6Tiq/qkgU1TwQsWHTj/uLOc4dlslLlhIGOkAaUxrh/cvOgJLJioZ39NRHNLb4NYmQ/KN8yK2toHrhdtlLghZ8VOL9CUOg8jdoPNgfS3+4hoTl5rAwdDrHDS2+aIYlHOFO4rUVajuJ03MDU2QJgWFZ1yR+NJcIlMAQQDTZrG9bAnG1PnptVwY7SXFeseGQdHmk0rUxCheOv1S5h48Sjqhaz839cpO5aMCzH+wO1dpahQP8jZGGmZL5W4O6xNKyiCnbqZaDvj+rRvooGy4z8O2d2jFell+GKqgWrYU48PYiLI9jLZpXWLYcOXyHFJl2V1mmt1tKVtxc7khMTpI8ZKdvZfFihzZpKN2YtyYW7cloEucWg084332n4XgY8g/U64+P4DPJChx4zCOAFC961JwkR5+kEVwcPKTIKeaM41FAVJEGeQfMtP5cyDnxhiPSFHnLuwmvqoO7KLaBo0AHsdBuSHhlnaKUg/RkT7Lvk+DDRJWFZzEJfNYlsiW6kNhn2xIwoC3HtU1f8cvZlRaouI9ZGa8OiehzB4nkGzKr39wGz4rtoUoO7I0l4+pZI7nKXd/EzKQ15lYnb5 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2af0cf4c-f12f-4cb6-962a-08dcc2745ae1 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:33:37.8211 (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: 1cEE1oyLWatkKE2unKjnt4GuVjH5dYzsbbPpqxwRof8YikDLTaclD96KWD/UazaqbvqBp4bV1h0dEyaOhO4S2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6344 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 */