NACK/Cmnt: [PATCH][SRU][HWE-5.8/HWE-5.11] Make AMD gpus choose YCbCr420 encoding automatically when required for 4k 60Hz output

Werner Sembach wse at tuxedocomputers.com
Wed Apr 28 08:04:08 UTC 2021


> On 27.04.21 18:45, Werner Sembach wrote:
>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1922754
>>
>> SRU Justification:
>>
>> Impact:
>> 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, causing the check to fail and discarding 4k60Hz from the list of
>> possible display modes.
>>
>> Fix:
>> This patch fixes the problem by retrying to find a display mode with YCbCr420
>> enforced and using it, if it is valid.
>>
>> Testcase:
>> Tested on an Clevo NL50RU. General: Find a PC with a current AMD Radeon GPU, but
>> only a hdmi 1.4 output (e.g. current Clevo laptops with AMD APU's). Connect a
>> 4k at 60Hz display supporting YCbCr420 encoding to the hdmi port. Without the patch
>> the maximum that can be set via xrandr is 3840 × 2160 30Hz. With the Patch
>> 3840 × 2160 60Hz can be selected which will use YCbCr420 automatically.
>>
>> Patch already got accepted upstream for linux-next:
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=14e4a095b29fd290a9b80f6e553adcfcf01672d1
>> and applies without modifications to ubuntu-focal/hwe-5.8 and hwe-5.11
>>
>> Commit-hash: 14e4a095b29fd290a9b80f6e553adcfcf01672d1
>>
>> Signed-off-by: Werner Sembach <wse at tuxedocomputers.com>
>> ---
>
> For formal reasons mentioned in other replies. Oh, and also note that the targets would be hirsute:linux and groovy:linux or just short [SRU G/H]. The hwe kernels are based on those and any change the hwe kernels get usually must go into the parent kernels, too.
>
> -Stefan

Send again with hopefully the right format. Thanks for the clarification.

(Actually send 2 times, because the first time I messed up the subject line)

>
>> Resend because git send-mail cut off BugLink for some reason
>>
>>  From 87afe9a830b44bbf42c3a2a7330bc76275bbca32 Mon Sep 17 00:00:00 2001
>> From: Werner Sembach <wse at tuxedocomputers.com>
>> Date: Tue, 27 Apr 2021 18:29:53 +0200
>> Subject: [PATCH] Retry forcing YCbCr420 color on failed encoder validation
>>
>> ---
>>   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 ad4afbc37d51..efa12ad4da72 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -5738,6 +5738,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;
>>   }
>>  
>
>



More information about the kernel-team mailing list