Skip to contentSkip to conversation

drm/amdgpu/display: check if ppfuncs exists before using it

PATCH In review Alex Deucher 2 participants 2 messages May 30, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/display: check if ppfuncs exists before using it

Fixes a crash on asics without powerplay yet (e.g., vega20).

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +1 -1
index d5e6b45fd6e6..5a3346124a01 100644
@@ -343,7 +343,7 @@ bool dm_pp_get_clock_levels_by_type_with_latency(
 	struct pp_clock_levels_with_latency pp_clks = { 0 };
 	const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
 
-	if (!pp_funcs->get_clock_by_type_with_latency)
+	if (!pp_funcs || !pp_funcs->get_clock_by_type_with_latency)
 		return false;
 
 	if (pp_funcs->get_clock_by_type_with_latency(pp_handle,
Signature · 6 lines
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180530143712.32269-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#2 lore raw

Best Regards

Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Alex Deucher <[email protected]>
Sent: Wednesday, May 30, 2018 10:37 PM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH] drm/amdgpu/display: check if ppfuncs exists before using it

Fixes a crash on asics without powerplay yet (e.g., vega20).

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +1 -1
index d5e6b45fd6e6..5a3346124a01 100644
@@ -343,7 +343,7 @@ bool dm_pp_get_clock_levels_by_type_with_latency(
         struct pp_clock_levels_with_latency pp_clks = { 0 };
         const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
 
-       if (!pp_funcs->get_clock_by_type_with_latency)
+       if (!pp_funcs || !pp_funcs->get_clock_by_type_with_latency)
                 return false;
 
         if (pp_funcs->get_clock_by_type_with_latency(pp_handle,

--
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx