Commit 7ba99b43 authored by Peikang Zhang's avatar Peikang Zhang Committed by Alex Deucher
Browse files

drm/amd/display: Toggle VSR button cause system crash



[Why]
in dcn10_apply_ctx_for_surface(), if we hit !top_pipe_to_program,
pipe_ctx->update_flags could not get cleared.

[How]
Moved clearing pipe_ctx->update_flags logic before if
(!top_pipe_to_program) to gurantee pipe_ctx->update_flags get cleared.

Signed-off-by: default avatarPeikang Zhang <peikang.zhang@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 94562810
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2540,6 +2540,12 @@ void dcn10_apply_ctx_for_surface(
			dcn10_find_top_pipe_for_stream(dc, context, stream);
	DC_LOGGER_INIT(dc->ctx->logger);

	// Clear pipe_ctx flag
	for (i = 0; i < dc->res_pool->pipe_count; i++) {
		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
		pipe_ctx->update_flags.raw = 0;
	}

	if (!top_pipe_to_program)
		return;

@@ -2570,8 +2576,6 @@ void dcn10_apply_ctx_for_surface(
		struct pipe_ctx *old_pipe_ctx =
				&dc->current_state->res_ctx.pipe_ctx[i];

		pipe_ctx->update_flags.raw = 0;

		if ((!pipe_ctx->plane_state ||
		     pipe_ctx->stream_res.tg != old_pipe_ctx->stream_res.tg) &&
		    old_pipe_ctx->plane_state &&