]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amd/display: disable sharpness if HDR Multiplier is too large
authorSamson Tam <Samson.Tam@amd.com>
Thu, 22 Aug 2024 00:17:23 +0000 (20:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 2 Sep 2024 15:35:32 +0000 (11:35 -0400)
[Why]
Certain profiles have higher HDR multiplier than SDR boost max which
is not currently supported

[How]
Disable sharpness for these profiles

Fixes: 1b0ce903fe74 ("drm/amd/display: add improvements for text display and HDR DWM and MPO")
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_spl_translate.c

index 75d00c6a38f4d15433c4d59d43b71425bee076a6..328499a778849a2bf119e7659462e3ce9804e012 100644 (file)
@@ -180,9 +180,13 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl
        spl_in->is_fullscreen = dm_helpers_is_fullscreen(pipe_ctx->stream->ctx, pipe_ctx->stream);
        spl_in->is_hdr_on = dm_helpers_is_hdr_on(pipe_ctx->stream->ctx, pipe_ctx->stream);
        spl_in->hdr_multx100 = 0;
-       if (spl_in->is_hdr_on)
+       if (spl_in->is_hdr_on) {
                spl_in->hdr_multx100 = (uint32_t)dc_fixpt_floor(dc_fixpt_mul(plane_state->hdr_mult,
                        dc_fixpt_from_int(100)));
+               /* Disable sharpness for HDR Mult > 6.0 */
+               if (spl_in->hdr_multx100 > 600)
+                       spl_in->adaptive_sharpness.enable = false;
+       }
 }
 
 /// @brief Translate SPL output parameters to pipe context