summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc.c
diff options
context:
space:
mode:
authorNikola Cornij <nikola.cornij@amd.com>2019-04-02 12:40:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-22 09:34:10 -0500
commitc9ae6e1691cd1dcd5f7f76050b5eca16bc82445e (patch)
tree0da915b62075e91af7ec0cb94c3d4626fd81c4e1 /drivers/gpu/drm/amd/display/dc/core/dc.c
parent0d7bd17c6e7146df6de8c37b3fbc91dbaa138014 (diff)
drm/amd/display: Acquire DSC HW resource only if required by stream
[why] There are ASICs that have fewer DSC engines than pipes, which makes DSC a resource that should be used only if required. [how] Acquire DSC HW resource if required by stream and release when not required anymore. Signed-off-by: Nikola Cornij <nikola.cornij@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 68eddcc0fbcc..6abf22aaf571 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1736,19 +1736,14 @@ static void commit_planes_do_stream_update(struct dc *dc,
#if defined(CONFIG_DRM_AMD_DC_DSC_SUPPORT)
if (stream_update->dsc_config && dc->hwss.pipe_control_lock_global) {
- if (stream_update->dsc_config->num_slices_h &&
- stream_update->dsc_config->num_slices_v) {
- /* dsc enable */
- dc->hwss.pipe_control_lock_global(dc, pipe_ctx, true);
- dp_set_dsc_enable(pipe_ctx, true);
- dc->hwss.pipe_control_lock_global(dc, pipe_ctx, false);
- } else {
- /* dsc disable */
- dc->hwss.pipe_control_lock_global(dc, pipe_ctx, true);
- dp_set_dsc_enable(pipe_ctx, false);
- dc->hwss.pipe_control_lock_global(dc, pipe_ctx, false);
- }
+ 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);
+ 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*/