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/Qo3Kc7pWXzEJrYhSPM3tt6kOo37GSkDez9VB7OtC/zqTdPxZtLSC3OUdDcsK/aVuN+LaXG75DpVOxd23OsLP+DlSYpFvPUMvvM/XJafviFIwbMp29ylnu+wHODcH/WvrgkCZlyk31deMnbJJdjaTXHoXZc2D+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JRwEw+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 */