drm/amdgpu: Fix logic to fetch supported NPS modes
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix logic to fetch supported NPS modes
Correct the logic to find supported NPS modes from firmware.
Signed-off-by Lijo Lazar <[email protected]>
Reported-by Ava Zhang <[email protected]>
Fixes cdb41537812f ("drm/amdgpu: Use firmware supported NPS modes")
--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -3
@@ -1607,9 +1607,8 @@ static void gmc_v9_0_init_nps_details(struct amdgpu_device *adev)/* Mode detected by hardware and supported modes available */ if ((mode !=UNKNOWN_MEMORY_PARTITION_MODE ) && supp_modes) { -for (i =AMDGPU_NPS1_PARTITION_MODE ; - supp_modes && i <=AMDGPU_NPS8_PARTITION_MODE ; i++) { -if (supp_modes &BIT (i -1 )) +while (i =ffs (supp_modes)) { +if (AMDGPU_ALL_NPS_MASK &BIT (i)) adev->gmc.supported_nps_modes |=BIT (i); supp_modes &= supp_modes -1 ; }
Signature · 1 line
2.25.1
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Tuesday, February 25, 2025 19:03
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Lin, Amber <[email protected]>; Zhang, Ava <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix logic to fetch supported NPS modes
Correct the logic to find supported NPS modes from firmware.
Signed-off-by Lijo Lazar <[email protected]>
Reported-by Ava Zhang <[email protected]>
Fixes cdb41537812f ("drm/amdgpu: Use firmware supported NPS modes")
--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -3
@@ -1607,9 +1607,8 @@ static void gmc_v9_0_init_nps_details(struct amdgpu_device *adev)/* Mode detected by hardware and supported modes available */ if ((mode !=UNKNOWN_MEMORY_PARTITION_MODE ) && supp_modes) { -for (i =AMDGPU_NPS1_PARTITION_MODE ; - supp_modes && i <=AMDGPU_NPS8_PARTITION_MODE ; i++) { -if (supp_modes &BIT (i -1 )) +while (i =ffs (supp_modes)) { +if (AMDGPU_ALL_NPS_MASK &BIT (i)) adev->gmc.supported_nps_modes |=BIT (i); supp_modes &= supp_modes -1 ; }
--
2.25.1