#if defined(CONFIG_DRM_AMD_DC_DSC_SUPPORT)
if (stream_update->dsc_config && dc->hwss.pipe_control_lock_global) {
- bool enable_dsc = (stream_update->dsc_config->num_slices_h && stream_update->dsc_config->num_slices_v);
-
dc->hwss.pipe_control_lock_global(dc, pipe_ctx, true);
- dp_set_dsc_enable(pipe_ctx, enable_dsc);
+ dp_update_dsc_config(pipe_ctx);
dc->hwss.pipe_control_lock_global(dc, pipe_ctx, false);
-
- if (!stream->is_dsc_enabled)
- dc->res_pool->funcs->remove_dsc_from_stream_resource(dc, context, stream);
}
#endif
/* Full fe update*/
disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal);
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
- if (pipe_ctx->stream->is_dsc_enabled &&
+ if (pipe_ctx->stream->timing.flags.DSC &&
dc_is_dp_signal(pipe_ctx->stream->signal)) {
dp_set_dsc_enable(pipe_ctx, false);
}
bool dp_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable)
{
- struct dc_stream_state *stream = pipe_ctx->stream;
struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
bool result = false;
+ if (!pipe_ctx->stream->timing.flags.DSC)
+ goto out;
if (!dsc)
goto out;
- if (enable && stream->is_dsc_enabled) {
- /* update dsc stream */
- dp_set_dsc_on_stream(pipe_ctx, true);
- stream->is_dsc_enabled = true;
- result = true;
- } else if (enable && !stream->is_dsc_enabled) {
- /* enable dsc on non dsc stream */
+ if (enable) {
if (dp_set_dsc_on_rx(pipe_ctx, true)) {
dp_set_dsc_on_stream(pipe_ctx, true);
- stream->is_dsc_enabled = true;
result = true;
- } else {
- stream->is_dsc_enabled = false;
- result = false;
}
- } else if (!enable && stream->is_dsc_enabled) {
- /* disable dsc on dsc stream */
+ } else {
dp_set_dsc_on_rx(pipe_ctx, false);
dp_set_dsc_on_stream(pipe_ctx, false);
- stream->is_dsc_enabled = false;
- result = true;
- } else {
- /* disable dsc on non dsc stream */
result = true;
}
out:
return result;
}
+bool dp_update_dsc_config(struct pipe_ctx *pipe_ctx)
+{
+ struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
+
+ if (!pipe_ctx->stream->timing.flags.DSC)
+ return false;
+ if (!dsc)
+ return false;
+
+ dp_set_dsc_on_stream(pipe_ctx, true);
+ return true;
+}
+
#endif
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
-enum dc_status dcn20_add_dsc_to_stream_resource(struct dc *dc,
+static enum dc_status add_dsc_to_stream_resource(struct dc *dc,
struct dc_state *dc_ctx,
struct dc_stream_state *dc_stream)
{
}
-enum dc_status dcn20_remove_dsc_from_stream_resource(struct dc *dc,
+static enum dc_status remove_dsc_from_stream_resource(struct dc *dc,
struct dc_state *new_ctx,
struct dc_stream_state *dc_stream)
{
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
/* Get a DSC if required and available */
if (result == DC_OK && dc_stream->timing.flags.DSC)
- result = dcn20_add_dsc_to_stream_resource(dc, new_ctx, dc_stream);
+ result = add_dsc_to_stream_resource(dc, new_ctx, dc_stream);
#endif
if (result == DC_OK)
enum dc_status result = DC_OK;
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
- result = dcn20_remove_dsc_from_stream_resource(dc, new_ctx, dc_stream);
+ result = remove_dsc_from_stream_resource(dc, new_ctx, dc_stream);
#endif
return result;
.populate_dml_writeback_from_context = dcn20_populate_dml_writeback_from_context,
.get_default_swizzle_mode = dcn20_get_default_swizzle_mode,
.set_mcif_arb_params = dcn20_set_mcif_arb_params,
-#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
- .add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
- .remove_dsc_from_stream_resource = dcn20_remove_dsc_from_stream_resource,
-#endif
.find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link
};
enum dc_status dcn20_add_stream_to_ctx(struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *dc_stream);
enum dc_status dcn20_remove_stream_from_ctx(struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *dc_stream);
enum dc_status dcn20_get_default_swizzle_mode(struct dc_plane_state *plane_state);
-enum dc_status dcn20_add_dsc_to_stream_resource(struct dc *dc, struct dc_state *dc_ctx, struct dc_stream_state *dc_stream);
-enum dc_status dcn20_remove_dsc_from_stream_resource(struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *dc_stream);
void dcn20_patch_bounding_box(
struct dc *dc,
int pipe_cnt);
#endif
-#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
-enum dc_status (*add_dsc_to_stream_resource)(struct dc *dc,
- struct dc_state *dc_ctx,
- struct dc_stream_state *dc_stream);
-
-enum dc_status (*remove_dsc_from_stream_resource)(struct dc *dc,
- struct dc_state *new_ctx,
- struct dc_stream_state *dc_stream);
-#endif
};
struct audio_support{
void dp_set_fec_ready(struct dc_link *link, bool ready);
void dp_set_fec_enable(struct dc_link *link, bool enable);
bool dp_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable);
+bool dp_update_dsc_config(struct pipe_ctx *pipe_ctx);
#endif
#endif /* __DC_LINK_DP_H__ */