ACK/Cmnt: [PATCH 1/1][SRU G/H] drm/amd/display: Try YCbCr420 color when YCbCr444 fails

Stefan Bader stefan.bader at canonical.com
Wed Apr 28 08:25:09 UTC 2021


On 28.04.21 10:00, Werner Sembach wrote:
> BugLink: https://bugs.launchpad.net/bugs/1922754
> 
> When encoder validation of a display mode fails, retry with less bandwidth
> heavy YCbCr420 color mode, if available. This enables some HDMI 1.4 setups
> to support 4k60Hz output, which previously failed silently.
> 
> On some setups, while the monitor and the gpu support display modes with
> pixel clocks of up to 600MHz, the link encoder might not. This prevents
> YCbCr444 and RGB encoding for 4k60Hz, but YCbCr420 encoding might still be
> possible. However, which color mode is used is decided before the link
> encoder capabilities are checked. This patch fixes the problem by retrying
> to find a display mode with YCbCr420 enforced and using it, if it is
> valid.
> 
> Reviewed-by: Harry Wentland <harry.wentland at amd.com>
> Signed-off-by: Werner Sembach <wse at tuxedocomputers.com>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

(cherry picked from commit 68eb3ae3c63708f823aeeb63bb15197c727bd9bf linux-next)
Signed-off-by: Werner Sembach <wse at tuxedocomputers.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---

Above would be the additional markup we were talking about. That should be added 
once this gets applied (but we would do it then, so no need to send 
yet-another-version). Note that the SHA1 was not stable and seems to have 
changed since when you checked. That is one reason we normally prefer to wait 
until patches landed in Linus tree. It makes finding follow-up fixes more reliable.
The patch in question looks at least straight forward enough, hopefully does not 
cause grieve.

-Stefan

>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 10efd5382511..aeeebce60ba4 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6161,6 +6161,15 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>   
>   	} while (stream == NULL && requested_bpc >= 6);
>   
> +	if (dc_result == DC_FAIL_ENC_VALIDATE && !aconnector->force_yuv420_output) {
> +		DRM_DEBUG_KMS("Retry forcing YCbCr420 encoding\n");
> +
> +		aconnector->force_yuv420_output = true;
> +		stream = create_validate_stream_for_sink(aconnector, drm_mode,
> +						dm_state, old_stream);
> +		aconnector->force_yuv420_output = false;
> +	}
> +
>   	return stream;
>   }
>   
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20210428/a4924c07/attachment.sig>


More information about the kernel-team mailing list