Commit 1619d416 authored by George Shen's avatar George Shen Committed by Alex Deucher
Browse files

drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence



[Why]
Certain small HBlank timings may not have a large enough HBlank to
support audio when low bpp DSC is enabled. HBlank expansion by the
source can solve this problem, but requires the branch/sink to support
HBlank reduction.

[How]
Update DPMS sequence to call DM to perform DPCD write to enable HBlank
reduction on the branch/sink. Add stub in dm_helpers to be implemented
later.

Reviewed-by: default avatarMichael Strauss <michael.strauss@amd.com>
Reviewed-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarGeorge Shen <george.shen@amd.com>
Signed-off-by: default avatarRoman Li <roman.li@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 787e7be0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -885,6 +885,12 @@ bool dm_helpers_dp_write_dsc_enable(
	return ret;
}

bool dm_helpers_dp_write_hblank_reduction(struct dc_context *ctx, const struct dc_stream_state *stream)
{
	// TODO
	return false;
}

bool dm_helpers_is_dp_sink_present(struct dc_link *link)
{
	bool dp_sink_present;
+5 −0
Original line number Diff line number Diff line
@@ -158,6 +158,11 @@ bool dm_helpers_dp_write_dsc_enable(
		const struct dc_stream_state *stream,
		bool enable
);

bool dm_helpers_dp_write_hblank_reduction(
		struct dc_context *ctx,
		const struct dc_stream_state *stream);

bool dm_helpers_is_dp_sink_present(
		struct dc_link *link);

+17 −0
Original line number Diff line number Diff line
@@ -772,6 +772,20 @@ static bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable)
	return result;
}

static bool dp_set_hblank_reduction_on_rx(struct pipe_ctx *pipe_ctx)
{
	struct dc *dc = pipe_ctx->stream->ctx->dc;
	struct dc_stream_state *stream = pipe_ctx->stream;
	bool result = false;

	if (dc_is_virtual_signal(stream->signal))
		result = true;
	else
		result = dm_helpers_dp_write_hblank_reduction(dc->ctx, stream);
	return result;
}


/* The stream with these settings can be sent (unblanked) only after DSC was enabled on RX first,
 * i.e. after dp_enable_dsc_on_rx() had been called
 */
@@ -2599,6 +2613,9 @@ void link_set_dpms_on(
		}
	}

	if (dc_is_dp_signal(pipe_ctx->stream->signal))
		dp_set_hblank_reduction_on_rx(pipe_ctx);

	if (pipe_ctx->stream->link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
		allocate_usb4_bandwidth(pipe_ctx->stream);