Commit 2f3bfb27 authored by Roman Li's avatar Roman Li Committed by Alex Deucher

drm/amd/display: safeguard compressor api

Only call compressor api if it's available.
Signed-off-by: default avatarRoman Li <Roman.Li@amd.com>
Reviewed-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4d6356b0
......@@ -1185,7 +1185,8 @@ static void power_down_all_hw_blocks(struct core_dc *dc)
power_down_clock_sources(dc);
#ifdef ENABLE_FBC
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
#endif
}
......@@ -1658,7 +1659,8 @@ enum dc_status dce110_apply_ctx_to_hw(
set_safe_displaymarks(&context->res_ctx, dc->res_pool);
#ifdef ENABLE_FBC
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
#endif
/*TODO: when pplib works*/
apply_min_clocks(dc, context, &clocks_state, true);
......@@ -2246,7 +2248,8 @@ static void init_hw(struct core_dc *dc)
abm->funcs->abm_init(abm);
}
#ifdef ENABLE_FBC
dc->fbc_compressor->funcs->power_up_fbc(dc->fbc_compressor);
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->power_up_fbc(dc->fbc_compressor);
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment