Commit 3924f200 authored by Sung Lee's avatar Sung Lee Committed by Alex Deucher
Browse files

drm/amd/display: Clean up triple buffer enablement code



[WHY]
Triple buffer enablement currently does not work properly

[HOW]
Allow triple buffer enablement to happen properly on
fast updates

Reviewed-by: default avatarAric Cyr <aric.cyr@amd.com>
Signed-off-by: default avatarSung Lee <sunglee@amd.com>
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4641169a
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -3677,8 +3677,9 @@ static void commit_planes_for_stream_fast(struct dc *dc,

			if (!pipe_ctx->plane_state)
				continue;
			if (should_update_pipe_for_plane(context, pipe_ctx, plane_state))
			if (!should_update_pipe_for_plane(context, pipe_ctx, plane_state))
				continue;

			pipe_ctx->plane_state->triplebuffer_flips = false;
			if (update_type == UPDATE_TYPE_FAST &&
					dc->hwss.program_triplebuffer != NULL &&
@@ -3920,7 +3921,7 @@ static void commit_planes_for_stream(struct dc *dc,
			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
			if (!pipe_ctx->plane_state)
				continue;
			if (should_update_pipe_for_plane(context, pipe_ctx, plane_state))
			if (!should_update_pipe_for_plane(context, pipe_ctx, plane_state))
				continue;
			pipe_ctx->plane_state->triplebuffer_flips = false;
			if (update_type == UPDATE_TYPE_FAST &&
@@ -3933,6 +3934,7 @@ static void commit_planes_for_stream(struct dc *dc,
		if (update_type == UPDATE_TYPE_FULL) {
			/* force vsync flip when reconfiguring pipes to prevent underflow */
			plane_state->flip_immediate = false;
			plane_state->triplebuffer_flips = false;
		}
	}

@@ -3953,7 +3955,6 @@ static void commit_planes_for_stream(struct dc *dc,
				continue;

			ASSERT(!pipe_ctx->plane_state->triplebuffer_flips);

			if (dc->hwss.program_triplebuffer != NULL && dc->debug.enable_tri_buf) {
				/*turn off triple buffer for full update*/
				dc->hwss.program_triplebuffer(