summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2019-02-19 20:14:19 +0300
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 23:04:03 +0300
commita08ac5a62c0f8b29d110004d05b1554a8b8fd5f5 (patch)
treef18673410046bf95d71bd7cbc1f4279eddbe0104 /drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
parent69226e9c7d4e721c683bac7fef4c613a71a3508d (diff)
downloadlinux-a08ac5a62c0f8b29d110004d05b1554a8b8fd5f5.tar.xz
drm/amd/display: Add pp_smu null pointer check
res_pool->pp_smu may be NULL. Check before use Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
index 2a807b9f77f7..8ee182be394a 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
@@ -1391,12 +1391,14 @@ void dcn_bw_update_from_pplib(struct dc *dc)
void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)
{
- struct pp_smu_funcs_rv *pp = &dc->res_pool->pp_smu->rv_funcs;
+ struct pp_smu_funcs_rv *pp = NULL;
struct pp_smu_wm_range_sets ranges = {0};
int min_fclk_khz, min_dcfclk_khz, socclk_khz;
const int overdrive = 5000000; /* 5 GHz to cover Overdrive */
- if (!pp->set_wm_ranges)
+ if (dc->res_pool->pp_smu)
+ pp = &dc->res_pool->pp_smu->rv_funcs;
+ if (!pp || !pp->set_wm_ranges)
return;
kernel_fpu_begin();