[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf308060-3098-4200-8e02-1ee725ae5ff8@vivo.com>
Date: Thu, 22 Aug 2024 17:42:20 +0800
From: Yang Ruibin <11162571@...o.com>
To: Kenneth Feng <kenneth.feng@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Xinhui Pan <Xinhui.Pan@....com>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Stephen Rothwell <sfr@...b.auug.org.au>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: Re: [PATCH v1] drivers:smumgr:Use min macro
Sorry, please ignore this patch.
Because the corresponding header file is not included, there may be
compilation errors.
在 2024/8/22 14:57, Yang Ruibin 写道:
> Instead of using the min() implementation of
> the ternary operator, use real macros.
>
> Signed-off-by: Yang Ruibin <11162571@...o.com>
> ---
> drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c | 5 +----
> drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 7 ++-----
> drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c | 5 +----
> 3 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> index 5e43ad2b2..8bf80f65f 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> @@ -1067,10 +1067,7 @@ static int fiji_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
> (1 << (lowest_pcie_level_enabled + 1 + count))) == 0))
> count++;
>
> - mid_pcie_level_enabled = (lowest_pcie_level_enabled + 1 + count) <
> - hightest_pcie_level_enabled ?
> - (lowest_pcie_level_enabled + 1 + count) :
> - hightest_pcie_level_enabled;
> + mid_pcie_level_enabled = min(lowest_pcie_level_enabled + 1 + count,
> + hightest_pcie_level_enabled);
>
> /* set pcieDpmLevel to hightest_pcie_level_enabled */
> for (i = 2; i < dpm_table->sclk_table.count; i++)
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> index ff6b563ec..62d9156ef 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> @@ -1127,11 +1127,8 @@ static int polaris10_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
> (1 << (lowest_pcie_level_enabled + 1 + count))) == 0))
> count++;
>
> - mid_pcie_level_enabled = (lowest_pcie_level_enabled + 1 + count) <
> - hightest_pcie_level_enabled ?
> - (lowest_pcie_level_enabled + 1 + count) :
> - hightest_pcie_level_enabled;
> -
> + mid_pcie_level_enabled = min(lowest_pcie_level_enabled + 1 + count,
> + hightest_pcie_level_enabled);
>
> /* set pcieDpmLevel to hightest_pcie_level_enabled */
> for (i = 2; i < dpm_table->sclk_table.count; i++)
> levels[i].pcieDpmLevel = hightest_pcie_level_enabled;
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> index 34c9f59b8..4616c3261 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> @@ -938,10 +938,7 @@ static int vegam_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
> (1 << (lowest_pcie_level_enabled + 1 + count))) == 0))
> count++;
>
> - mid_pcie_level_enabled = (lowest_pcie_level_enabled + 1 + count) <
> - hightest_pcie_level_enabled ?
> - (lowest_pcie_level_enabled + 1 + count) :
> - hightest_pcie_level_enabled;
> + mid_pcie_level_enabled = min(lowest_pcie_level_enabled + 1 + count,
> + hightest_pcie_level_enabled);
>
> /* set pcieDpmLevel to hightest_pcie_level_enabled */
> for (i = 2; i < dpm_table->sclk_table.count; i++)
Powered by blists - more mailing lists