Commit 6b622181 authored by Julian Parkin's avatar Julian Parkin Committed by Alex Deucher

drm/amd/display: reprogram infoframe during apply_ctx_to_hw

To ensure the infoframe gets updated during an SDR/HDR switch
this change adds a new function to to check if the HDR static
metadata has changed and adds it to is_timing_changed and
pipe_need_reprogram checks
Signed-off-by: default avatarJulian Parkin <jparkin@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7ab3fdde
...@@ -1310,6 +1310,19 @@ bool dc_add_all_planes_for_stream( ...@@ -1310,6 +1310,19 @@ bool dc_add_all_planes_for_stream(
} }
static bool is_hdr_static_meta_changed(struct dc_stream_state *cur_stream,
struct dc_stream_state *new_stream)
{
if (cur_stream == NULL)
return true;
if (memcmp(&cur_stream->hdr_static_metadata,
&new_stream->hdr_static_metadata,
sizeof(struct dc_info_packet)) != 0)
return true;
return false;
}
static bool is_timing_changed(struct dc_stream_state *cur_stream, static bool is_timing_changed(struct dc_stream_state *cur_stream,
struct dc_stream_state *new_stream) struct dc_stream_state *new_stream)
...@@ -1345,6 +1358,9 @@ static bool are_stream_backends_same( ...@@ -1345,6 +1358,9 @@ static bool are_stream_backends_same(
if (is_timing_changed(stream_a, stream_b)) if (is_timing_changed(stream_a, stream_b))
return false; return false;
if (is_hdr_static_meta_changed(stream_a, stream_b))
return false;
return true; return true;
} }
...@@ -2548,6 +2564,8 @@ bool pipe_need_reprogram( ...@@ -2548,6 +2564,8 @@ bool pipe_need_reprogram(
if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream)) if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
return true; return true;
if (is_hdr_static_meta_changed(pipe_ctx_old->stream, pipe_ctx->stream))
return true;
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment