Skip to contentSkip to conversation

drm/amd/display: Disable 10-bit truncation and dithering on DCE 6.x

PATCH Applied Timur Kristóf 2 participants 2 messages Apr 20 – Apr 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Disable 10-bit truncation and dithering on DCE 6.x

DCE 6.x doesn't support 10-bit truncation and 10-bit dithering because the following fields are 1-bit only:
FMT_TEMPORAL_DITHER_DEPTH
FMT_SPATIAL_DITHER_DEPTH
FMT_TRUNCATE_DEPTH
Programming these fields to "2" will program them as if the dithering option was 6-bit, resulting in sub-par picture quality and an ugly "color banding" effect.

Note that a recent commit changed the default 10-bit dithering option to DITHER_OPTION_SPATIAL10 which improves the picture quality because it happens to look better, but is still not actually supported by DCE 6.x versions.

When the color depth is 10-bit or more, just disable any kind of dithering options on DCE 6.x.

Fixes 529cad0f945c ("drm/amd/display: Add function to set dither option")
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -0
index 19526a278b2a5..1ab76c2d0f723 100644
@@ -5069,6 +5069,12 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
 		}
 	}
 
+	if (stream->ctx->dce_version < DCE_VERSION_8_0 &&
+	    stream->timing.display_color_depth >= COLOR_DEPTH_101010) {
+		/* DCE 6.x doesn't support 10-bit truncation or dither options. */
+		option = DITHER_OPTION_DISABLE;
+	}
+
 	if (option == DITHER_OPTION_DISABLE)
 		return;
 
Signature · 1 line
2.53.0
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 45 lines · Timur Kristóf

DCE 6.x doesn't support 10-bit truncation and 10-bit dithering because the following fields are 1-bit only:
FMT_TEMPORAL_DITHER_DEPTH
FMT_SPATIAL_DITHER_DEPTH
FMT_TRUNCATE_DEPTH
Programming these fields to "2" will program them as if the dithering option was 6-bit, resulting in sub-par picture quality and an ugly "color banding" effect.

Note that a recent commit changed the default 10-bit dithering option to DITHER_OPTION_SPATIAL10 which improves the picture quality because it happens to look better, but is still not actually supported by DCE 6.x versions.

When the color depth is 10-bit or more, just disable any kind of dithering options on DCE 6.x.

Fixes 529cad0f945c ("drm/amd/display: Add function to set dither option")
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -1
index 19526a278b2a5..1ab76c2d0f723 100644
@@ -5069,6 +5069,12 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
                }
        }
 
+       if (stream->ctx->dce_version < DCE_VERSION_8_0 &&
+           stream->timing.display_color_depth >= COLOR_DEPTH_101010) {
+               /* DCE 6.x doesn't support 10-bit truncation or dither options. */
+               option = DITHER_OPTION_DISABLE;
+       }
+
        if (option == DITHER_OPTION_DISABLE)
                return;
 
--

2.53.0