Message ID | 20240822062947.1318340-6-yujiaoliang@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> 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 <dri-devel@archiver.kernel.org>; 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 <yujiaoliang@vivo.com> To: Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Alex Deucher <alexander.deucher@amd.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Xinhui Pan <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Hamza Mahfooz <hamza.mahfooz@amd.com>, Alex Hung <alex.hung@amd.com>, Alvin Lee <alvin.lee2@amd.com>, Dillon Varone <dillon.varone@amd.com>, Hersen Wu <hersenxs.wu@amd.com>, Samson Tam <Samson.Tam@amd.com>, Jerry Zuo <jerry.zuo@amd.com>, Wenjing Liu <wenjing.liu@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: fl8IbiRPxQ5aEl3zeUT6XsmlQp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lf9FDociqFVuJwp7pbjFk9O/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 <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
drm/amd/display: Use max/min macro
|
expand
|
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 */
Use the macro instead of ternary operator. Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com> --- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)