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/FEbmkstt4kRNQsWxkmWU8EvtIAi5/D5qZ75Sd8TCVi9t2QxoqJ0bncDEdTuZfdVBBaZixDfS/riyrrhS/jXt0TpwGlYj1g3YarpRVivceqa6M1v86uGMZPad7tMmJwrNpkwdxAN2EdRzWrE+nwkQ0favH2VOoBvP8dRmQGcAcHc0M+4vfuJayzM0+YAFuPXD0HZOINr4bwwJnXoInqIMUCYANWlhobKgy9YhV7N0TAHhnzRUkKz392STpOMe9Qy0Qp0BlXC914hMYZHyI8h/4ghqMsUK8sj6jOD6KyKd04Ws62Zffn4z7saKxtbhsZdogw3ZAqGupZjyblcCZrLXaixDzLuM+qrU9P9Sop+pKkcj2zOxtzz/41OQO/9MMT+cnJqlKFbjRy2KHduLSsFhhylOiGZ48bcJsyOCzPmS/2EQR5TYUH6DeSeVontJ8hB9mkLRosi7+wgJck71gNRSg5Bl5h6ngPvQ0cneD86Uodtb3WDiOc+b7NQ4DxVNBn3Jk7FMHYrfOvWIFoGPXbtERtyfofZG5sDVYEwJe4fxs0K1m+lFCyUl97tzhcszHSssj7jaKyNhiKDDOu5BqUwmhwyWBz4lg97KHmX6BMWxmjE9Z9rWTXRrbJ8oV2Etj9lAcdWZup1qWXEqt7iJqVKfx/W7f3nwwxsMnlEj4XJOnboWc+DH9NDcAL6Teeb4qnuTTu8kVxg95bW3dv2h+qSMXrpeWkW2M4UZmLG5HE9ddFfhbys3adRebPgfTWcYz4vgq0bKTl0oM5g5lNCeKf0Q3mua8Aw29BNHEog+dA6fLgpUTJc1WzR56tu4C7Vd8n1IJyAgbPdMJDlP24vIuRVwJ0am+xxE69tOKWl0xAecGFyG3t3HbqHN/ROhnXS6nB7l5+uvWLXlu/HcYrct4KppOUGGrSooR8enZU8gnbIBW8xStTMp+Vwr7gS9ezD6k3Cirmb8VZJN2d6v6uCFUKb6e0zdsDHaDcwdMqGaKBp5SfpOUErBb5HbbAaC3wascxdeCVZXvsRbMoAFTsFugoHGDS6l5/UIoPGo9Oogk2/erUu1elCZ/U3kuRsXI5jMgAB3NDCeDKNj/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/LWdNgcj2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L45rWGzZU3LWcShjWVZZoteQke1xN2rxGW2j+BapFrcXidbhG+wkcNsBAfUhm5nuXg4Adea2SZOIW7ZzsNomcGMixd6LDMLbSvM0fiYdK6yv0P/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 */