]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd/display: Make assert in DCE's program_bit_depth_reduction more lenient.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Fri, 19 Mar 2021 21:03:16 +0000 (22:03 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 19:00:47 +0000 (15:00 -0400)
This is needed to avoid warnings with linebuffer depth 36 bpp.
Testing on a Polaris11, DCE-11.2 on a 10 bit HDR-10 monitor
showed no obvious problems, and this 12 bpc limit is consistent
with what other function in the DCE bit depth reduction path use.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c

index 92b53a30d95447f63151d799f98e86e72a67b1f2..d9fd4ec60588f876f4226a0d15c289ca29211391 100644 (file)
@@ -794,7 +794,7 @@ static void program_bit_depth_reduction(
        enum dcp_out_trunc_round_mode trunc_mode;
        bool spatial_dither_enable;
 
-       ASSERT(depth < COLOR_DEPTH_121212); /* Invalid clamp bit depth */
+       ASSERT(depth <= COLOR_DEPTH_121212); /* Invalid clamp bit depth */
 
        spatial_dither_enable = bit_depth_params->flags.SPATIAL_DITHER_ENABLED;
        /* Default to 12 bit truncation without rounding */
@@ -854,7 +854,7 @@ static void dce60_program_bit_depth_reduction(
        enum dcp_out_trunc_round_mode trunc_mode;
        bool spatial_dither_enable;
 
-       ASSERT(depth < COLOR_DEPTH_121212); /* Invalid clamp bit depth */
+       ASSERT(depth <= COLOR_DEPTH_121212); /* Invalid clamp bit depth */
 
        spatial_dither_enable = bit_depth_params->flags.SPATIAL_DITHER_ENABLED;
        /* Default to 12 bit truncation without rounding */