From: Alvin Lee <[email protected]>

[Description]
HDR visual confirm should be programmed based on per-pipe info, not
top pipe info. There exists scenarios where an HDR app has a desktop
plane still active (due to SW cursor) which is ARGB8888. Taking the top
pipe info will give the wrong visual confirm color.

Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Ivan Lipski <[email protected]>
---
 .../drm/amd/display/dc/core/dc_hw_sequencer.c    | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index f881a3be6f0a..d6177463c0a0 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -450,18 +450,12 @@ void get_hdr_visual_confirm_color(
        uint32_t color_value = MAX_TG_COLOR_VALUE;
        bool is_sdr = false;
 
-       /* Determine the overscan color based on the top-most (desktop) plane's 
context */
-       struct pipe_ctx *top_pipe_ctx  = pipe_ctx;
-
-       while (top_pipe_ctx->top_pipe != NULL)
-               top_pipe_ctx = top_pipe_ctx->top_pipe;
-
-       switch (top_pipe_ctx->plane_res.scl_data.format) {
+       switch (pipe_ctx->plane_res.scl_data.format) {
        case PIXEL_FORMAT_ARGB2101010:
-               if (top_pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_PQ) {
+               if (pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_PQ) {
                        /* HDR10, ARGB2101010 - set border color to red */
                        color->color_r_cr = (uint16_t)color_value;
-               } else if (top_pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_GAMMA22) {
+               } else if (pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_GAMMA22) {
                        /* FreeSync 2 ARGB2101010 - set border color to pink */
                        color->color_r_cr = (uint16_t)color_value;
                        color->color_b_cb = (uint16_t)color_value;
@@ -469,10 +463,10 @@ void get_hdr_visual_confirm_color(
                        is_sdr = true;
                break;
        case PIXEL_FORMAT_FP16:
-               if (top_pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_PQ) {
+               if (pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_PQ) {
                        /* HDR10, FP16 - set border color to blue */
                        color->color_b_cb = (uint16_t)color_value;
-               } else if (top_pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_GAMMA22) {
+               } else if (pipe_ctx->stream->out_transfer_func.tf == 
TRANSFER_FUNCTION_GAMMA22) {
                        /* FreeSync 2 HDR - set border color to green */
                        color->color_g_y = (uint16_t)color_value;
                } else
-- 
2.43.0

Reply via email to