Skip to content

Commit add61d3

Browse files
kleinermalexdeucher
authored andcommitted
drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines.
Various DCE versions had trouble with 36 bpp lb depth, requiring fixes, last time in commit 353ca0f ("drm/amd/display: Fix 10bit 4K display on CIK GPUs") for DCE-8. So far >= DCE-11.2 was considered ok, but now I found out that on DCE-11.2 it causes dithering when there shouldn't be any, so identity pixel passthrough with identity gamma LUTs doesn't work when it should. This breaks various important neuroscience applications, as reported to me by scientific users of Polaris cards under Ubuntu 22.04 with Linux 5.15, and confirmed by testing it myself on DCE-11.2. Lets only use depth 36 for DCN engines, where my testing showed that it is both necessary for high color precision output, e.g., RGBA16 fb's, and not harmful, as far as more than one year in real-world use showed. DCE engines seem to work fine for high precision output at 30 bpp, so this ("famous last words") depth 30 should hopefully fix all known problems without introducing new ones. Successfully retested on DCE-11.2 Polaris and DCN-1.0 Raven Ridge on top of Linux 5.19.0-rc2 + drm-next. Fixes: 353ca0f ("drm/amd/display: Fix 10bit 4K display on CIK GPUs") Signed-off-by: Mario Kleiner <[email protected]> Tested-by: Mario Kleiner <[email protected]> Cc: [email protected] # 5.14.0 Cc: Alex Deucher <[email protected]> Cc: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c004486 commit add61d3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,12 +1117,13 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
11171117
* on certain displays, such as the Sharp 4k. 36bpp is needed
11181118
* to support SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 and
11191119
* SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616 with actual > 10 bpc
1120-
* precision on at least DCN display engines. However, at least
1121-
* Carrizo with DCE_VERSION_11_0 does not like 36 bpp lb depth,
1122-
* so use only 30 bpp on DCE_VERSION_11_0. Testing with DCE 11.2 and 8.3
1123-
* did not show such problems, so this seems to be the exception.
1120+
* precision on DCN display engines, but apparently not for DCE, as
1121+
* far as testing on DCE-11.2 and DCE-8 showed. Various DCE parts have
1122+
* problems: Carrizo with DCE_VERSION_11_0 does not like 36 bpp lb depth,
1123+
* neither do DCE-8 at 4k resolution, or DCE-11.2 (broken identify pixel
1124+
* passthrough). Therefore only use 36 bpp on DCN where it is actually needed.
11241125
*/
1125-
if (plane_state->ctx->dce_version > DCE_VERSION_11_0)
1126+
if (plane_state->ctx->dce_version > DCE_VERSION_MAX)
11261127
pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_36BPP;
11271128
else
11281129
pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;

0 commit comments

Comments
 (0)