aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-05-30 10:34:23 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-30 13:38:05 -0400
commit9dac0c3fb41056ae48b93e679c2a796c4dcfa8ed (patch)
tree321253fa025c709fe20e6c808eb77482924e5b1d /drivers/gpu
parent762f52e9e4d237d8d378b5bb495f64073a9ba481 (diff)
drm/amdgpu/display: check if ppfuncs exists before using it
Fixes a crash on asics without powerplay yet (e.g., vega20). Reviewed-by: Rex Zhu<rezhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
index d5e6b45fd6e6..5a3346124a01 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
@@ -343,7 +343,7 @@ bool dm_pp_get_clock_levels_by_type_with_latency(
343 struct pp_clock_levels_with_latency pp_clks = { 0 }; 343 struct pp_clock_levels_with_latency pp_clks = { 0 };
344 const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; 344 const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
345 345
346 if (!pp_funcs->get_clock_by_type_with_latency) 346 if (!pp_funcs || !pp_funcs->get_clock_by_type_with_latency)
347 return false; 347 return false;
348 348
349 if (pp_funcs->get_clock_by_type_with_latency(pp_handle, 349 if (pp_funcs->get_clock_by_type_with_latency(pp_handle,