drm/amd/display: add pipe lock during stream update
authorWenjing Liu <Wenjing.Liu@amd.com>
Wed, 20 Feb 2019 19:00:55 +0000 (14:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:52 +0000 (06:43 -0700)
[ Upstream commit e6bddf6c67f9a3abf6f1ef75e52bc1cd228dfe4d ]

[why]
Stream update will adjust both info packets and stream params,
need to make sure all things are applied togather.

[how]
add pipe lock during stream update

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc.c

index c1a308c1dcbea06978181d4d08020556039cbd99..88fe4fb43bfd51548b223d8ee16be09506e9e2eb 100644 (file)
@@ -1677,6 +1677,7 @@ static void commit_planes_do_stream_update(struct dc *dc,
                                continue;
 
                        if (stream_update->dpms_off) {
+                               dc->hwss.pipe_control_lock(dc, pipe_ctx, true);
                                if (*stream_update->dpms_off) {
                                        core_link_disable_stream(pipe_ctx, KEEP_ACQUIRED_RESOURCE);
                                        dc->hwss.optimize_bandwidth(dc, dc->current_state);
@@ -1684,6 +1685,7 @@ static void commit_planes_do_stream_update(struct dc *dc,
                                        dc->hwss.prepare_bandwidth(dc, dc->current_state);
                                        core_link_enable_stream(dc->current_state, pipe_ctx);
                                }
+                               dc->hwss.pipe_control_lock(dc, pipe_ctx, false);
                        }
 
                        if (stream_update->abm_level && pipe_ctx->stream_res.abm) {