Skip to content

Commit

Permalink
drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence
Browse files Browse the repository at this point in the history
[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: Michael Strauss <michael.strauss@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
George Shen authored and Alex Deucher committed Jan 6, 2025
1 parent 787e7be commit 1619d41
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dm_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
17 changes: 17 additions & 0 deletions drivers/gpu/drm/amd/display/dc/link/link_dpms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 1619d41

Please sign in to comment.