drm/amd/display: Fix null pointer issues found in emulation
authorCharlene Liu <Charlene.Liu@amd.com>
Fri, 21 Oct 2022 19:39:09 +0000 (15:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Nov 2022 15:48:18 +0000 (11:48 -0400)
[why]
fix null point issues found in emulation

Reviewed-by: Chris Park <Chris.Park@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c

index bdf101547484a1d543a33f8a7b1af8395657b439..165c920ca77669ec2cd94a2b1dddcbde440fcd35 100644 (file)
@@ -89,7 +89,8 @@ static void enable_memory_low_power(struct dc *dc)
                REG_UPDATE(MMHUBBUB_MEM_PWR_CNTL, VGA_MEM_PWR_FORCE, 1);
        }
 
-       if (dc->debug.enable_mem_low_power.bits.mpc)
+       if (dc->debug.enable_mem_low_power.bits.mpc &&
+               dc->res_pool->mpc->funcs->set_mpc_mem_lp_mode)
                dc->res_pool->mpc->funcs->set_mpc_mem_lp_mode(dc->res_pool->mpc);
 
 
@@ -141,7 +142,8 @@ void dcn31_init_hw(struct dc *dc)
 
        if (!dcb->funcs->is_accelerated_mode(dcb)) {
                hws->funcs.bios_golden_init(dc);
-               hws->funcs.disable_vga(dc->hwseq);
+               if (hws->funcs.disable_vga)
+                       hws->funcs.disable_vga(dc->hwseq);
        }
        // Initialize the dccg
        if (res_pool->dccg->funcs->dccg_init)