From patchwork Thu Aug 22 06:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13772773 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 DE321C531DF for ; Thu, 22 Aug 2024 06:58:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61BCF10E78F; Thu, 22 Aug 2024 06:58:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="DW5N+Feb"; dkim-atps=neutral Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2082.outbound.protection.outlook.com [40.107.117.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90CDF10E78F; Thu, 22 Aug 2024 06:58:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iLJyoqLDrSibftHT7VQRUSQCAJZxyQgboVzFPKgNv7a0+zvjx9Z6K2rwdOxief9njCfrBv3QTjEcGGq5fxI7hs0736g/S02+6udXEFPygEsAp5HJKAKvY9C6CcdzyPdSJ9UtAlgl2QmXE7g4JvYkL0Tf1GuRihuFBETWAg1qmiwla7dwZsDPlkvCC4EgxZdXI9jqvtVsFP5S+jr0x6Trg8yGRFNx/j2StFMZ34rrWYs6DMgiDMhGKcKc6/tZZa99JWdWnZQumVIuzCZqLIHPI3qXtx7g5HMGOaMRgC5GorXFSZrA8RBt+QBaB6KJl1VgttGAfEWVXHv2xxlo6CHOTQ== 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=TvWjZ3+zy6cSOWTV/0byJfG7h4lVsOl3XsGWDF68XSvVwQh1ZWPuiwR+/QKLiJzs0JCFV2iaYAqnoYKL5SADQ/+3wGuweIti6qPd1iiS2F7xt6zb36q3ouUm/PP0L2DPZVlpZLLAzCbIRAwyHfprQn3J+MtouwjCHFzadL+zjxsCHW+99L+PSQCiIG/5M57J3ruOof1L+MC6FADfDiq6uY6jDyXZGFC2SYTrsTaPA6/gOrexxcWVqIIIr/2gzcEeZ37Fp0fn5GIKH5mchEiPn07WR47VAFt3fcY06Q9IfTkso5ZcIJD9FpGpO4ngiC//ZyJrtw9l/hCi7C2x1PSBpw== 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=DW5N+FebxvD4JsQJdMJ4EaQNWBSYZRSzpLRVpSAu3PV5illTOmU8EGmHtlOAW4yy5ilk8g5cTGIxF4YXtwKeSiUygR+gL9QpeOVjakcfUoEx9CKqU9xsbCTQrQc12vhVwyaWw6oecwvMoz7qgG+/sy9gkVO7xyYbUeGQozpofJghdynT1aJ2+c0789BIz9ZjO82yxERnzVmse0PAQIvC2piQyzjqjOG4htPKjwN41e2q20/YQTEHCEch7k/8HcTkDebkeN3NmRlkRq3/r1dEQetayq53NVWLhGxe/z9e7VR67FC9/GNKPZqJ5svue6g+zUcJmJ9z5DF16itb8/NMgw== 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 TYZPR06MB5417.apcprd06.prod.outlook.com (2603:1096:400:203::11) 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:58:13 +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:58:13 +0000 From: Yu Jiaoliang To: Harry Wentland , Leo Li , Rodrigo Siqueira , Xinhui Pan , David Airlie , Daniel Vetter , Hamza Mahfooz , Alex Hung , 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:57:22 +0800 Message-Id: <20240822065723.1336181-6-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822065723.1336181-1-yujiaoliang@vivo.com> References: <20240822065723.1336181-1-yujiaoliang@vivo.com> X-ClientProxiedBy: SI1PR02CA0049.apcprd02.prod.outlook.com (2603:1096:4:1f5::18) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|TYZPR06MB5417:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c285e52-da3d-43a6-1966-08dcc277ca5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft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+Hn2d9u1MnLFFzm2ubLRu9s+KFyplRuqq2w9aQbi2WaCeXSc7WwL7WaGejEvIcdn0kQv/mDfYqISI3wJmw539xeqgGwEPpeEOnENfWKx2aqTjfgpiEj0/ghyPtl2MaNu6xJzFTYkCSjjuM8zkaK30AKbiS/qIACNflNUujn+uZwl+HihlcU+4dfSKhp1D1cMLNDGJ35J3e4mDFtSNNbZOHDQv/WKZvNkFttcaqtmYRj0fdjOQLP/OMA+/nloHQNtD/FWU3m2x7W2/BBp8KYPiAWJTr3TGFUS6wPaG3O/ZtLr9vaMtI/LB4iwMweISSzxJQTci7ehrnUy01FLyGtMT7Vj4f03PCIbMwhBsVCVCIZb1LzGh2+Pw+6tzfyHSJ9n9LSWCUz55ciKEazPlZSVUMOEZFVhqTtKFUQw1LCHTPEXVlNlja/sXEcn/5qk49LIXwk5zUg= 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)(376014)(7416014)(1800799024)(366016)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gKady4EtXqZKUKCoyUypSpOLrXiKqkAA8THgSrGYZOHDZ5MLJbzlXDC/LNzgOtf1VNcP/6C10VKg24VkqCzyP/Ez4mp4NjYUoHJ6UYCBDq0JaQMmLwNleKbDx8rQONq1Xgw2SL+4rnO4KbzoMpYY+FrvtVEhH1ZNnmU/+3ItJPgweCEpVJ+MejX640GqTAYOsO0unJ++xy9qeP3yhU8L/55QUKhOLdrhuhyZjzV70AwbM4zSZnLj0uu1iySPLTPu6AXWDIhQ+zJmjiEkz/D+7niY6dKBKyX2zhB/8wjWISmVNFNHlfRJqUvyphjfu/VwziPh7ADY2JRjNb78ZmaaZcwb0L/jAJ3PWKQC1JwB2k4tTYbzlCDDQNP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keKTcaN3KpJPZm6HqjfTIj/OXFWhg91HqpejllyaLiqtyV4So/Cpo+RAC57qn1v73wfWO7pZm32Ea4Vu2boqow9q20Z8pDXCXOcz7uc5fKFUKHOUVBgzM9ZA4WekvjB1RiT3gwwOf0UfzsNRxTXGHJJdm9ChG/ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c285e52-da3d-43a6-1966-08dcc277ca5a 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:58:13.3388 (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: 7m7ID7/bJNvxNMc1Xk+VraJ0AdBHyztZvGFnaAF+wHPyqRkvgT1xQ48oWs7QK0NnBevZZcBb2CymovF8MIZhlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5417 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 */