]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence
authorGeorge Shen <george.shen@amd.com>
Mon, 9 Dec 2024 16:23:42 +0000 (11:23 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 6 Jan 2025 19:44:27 +0000 (14:44 -0500)
[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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/dc/dm_helpers.h
drivers/gpu/drm/amd/display/dc/link/link_dpms.c

index 6cbbb71d752beca0052c6e7db287df5a29c3e74e..fbd80d8545a8235d1accb5f151bde1a0c349e052 100644 (file)
@@ -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;
index 2e4a46f1b499d1dc990ef92a00fddf50287f3e05..5efddd48d5c507e31bf03d714a8498e4ce85ae0f 100644 (file)
@@ -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);
 
index 6f3e7e182145d317620267ce1d9a3490d0a64182..ae79dc2139011b2d7a1b4e0ce2a48de3a00babdc 100644 (file)
@@ -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);