[PATCH 052/120] drm/amd/display: safeguard compressor api
Harry Wentland
harry.wentland at amd.com
Wed Aug 9 15:01:38 UTC 2017
From: Roman Li <Roman.Li at amd.com>
Only call compressor api if it's available.
Change-Id: I15f0bfa54ca231f804a1d2f00885faaa7237face
Signed-off-by: Roman Li <Roman.Li at amd.com>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 15f6eeef343d..d45773087644 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -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
}
--
2.11.0
More information about the amd-gfx
mailing list