Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,MIME_HTML_MOSTLY,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 698CFC2D0A3 for ; Wed, 4 Nov 2020 14:42:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F09982074B for ; Wed, 4 Nov 2020 14:42:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ImNXkg+A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F09982074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8439B6E069; Wed, 4 Nov 2020 14:42:00 +0000 (UTC) Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 661C76E069 for ; Wed, 4 Nov 2020 14:41:59 +0000 (UTC) Received: by mail-ej1-x641.google.com with SMTP id cw8so16546807ejb.8 for ; Wed, 04 Nov 2020 06:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=by7kD3GnxrNialM9sO5mButuPsX+XdX3Nzxu47MGo2Q=; b=ImNXkg+Ah+tzHE6OgmBE10WQSzV9IWtexCm+Glk8OLAMdD1BHWaOiE0cq0F7oCu5pX wKakSOeaYOuvKsJ743GUTgH3YGwVF+UzVQMPYaVFKnoiZChL5L5wercZa/BxJnxMlQyy LWDpHwE6HsPAJywpm89XJlPDrzFOkSniJ5XZ5c2kb/oMAcSR7PSzNUtodc696KNaqxEd 8xv8/0a5i/EF+cG6ZPLPpIBvT/63dp+OTLWOThaUcFtNdg+bn/JLLkESt1Q9z3o0kFJq yB1+/XUFy/qB8270QHPPozFX8MPh3tTtzbwPwBWv8C4OnRihCBgcS7f0Xnf3wuQgmzXn RbBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=by7kD3GnxrNialM9sO5mButuPsX+XdX3Nzxu47MGo2Q=; b=i4AAEgGuBlnAe9OB30AzxHahHfHSh6qrfCXm2vndtH1QeAVmIl/HcjXR42YDqmZRgY TB5GZK90qp6zy+rnC2n4BeWwtMn3akvOmmGrMW3IP/v57tVLwQMxFEyUFPt82x8jF5C4 TLE3tNYx0h6T0PCqLdyxQrLGkgQL5kwX8hCdmABXX6qK06ku9WKTJogY3b+2JLnjKUFq rztwmBa3bB5RmmJFrD6XT+VTdFKNbAOw3qhHJ6fmmGsly9N/D42Zi/6t7PSTv7OdbwTI uqrzRMKNFyQGspYdU1UXTONYk3suyk+uwBBuo2vPruQufvvm6fNzyJYFOeGKH0cWxsx1 pn+A== X-Gm-Message-State: AOAM532Os9dG77URck/qDU8nI9iYyNhaDYtNw4hYYsLGIDeNf1ynmsQH 3iqn7FU3rJfyJG1kTDeLtdE= X-Google-Smtp-Source: ABdhPJx4Ht8OWuNyRkAGv2O9c4+pXkS6mvljKCVrzdZawXEV49rTDTNBNdavYlqI1kTOZiQMUpRGcQ== X-Received: by 2002:a17:906:13d6:: with SMTP id g22mr17197635ejc.240.1604500917999; Wed, 04 Nov 2020 06:41:57 -0800 (PST) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id o1sm1108282ejc.81.2020.11.04.06.41.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Nov 2020 06:41:57 -0800 (PST) Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 To: "Deucher, Alexander" , "Koenig, Christian" , "Sharma, Shashank" , "amd-gfx@lists.freedesktop.org" References: <20201103171340.2978395-1-shashank.sharma@amd.com> <7f9cc1a0-ad6b-ee9b-ac7b-4a49d08de1f9@amd.com> <211bb89a-4433-3fb8-7849-6323cafe20fb@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <3c18d0c2-ceab-d5ac-e44e-29d62f789259@gmail.com> Date: Wed, 4 Nov 2020 15:41:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: christian.koenig@amd.com Cc: "Qin, Eddy" Content-Type: multipart/mixed; boundary="===============0331977621==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" This is a multi-part message in MIME format. --===============0331977621== Content-Type: multipart/alternative; boundary="------------461998D46E6F4292AE18B514" Content-Language: en-US This is a multi-part message in MIME format. --------------461998D46E6F4292AE18B514 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Then feel free to stick an Acked-by: Christian König to the code and get it committed. Ideally somebody should have it on the TODO list to get rid of that code. Christian. Am 04.11.20 um 15:33 schrieb Deucher, Alexander: > yeah, ideally.  Just need to get support for analog encoders. > > Alex > > ------------------------------------------------------------------------ > *From:* Koenig, Christian > *Sent:* Wednesday, November 4, 2020 9:31 AM > *To:* Deucher, Alexander ; Sharma, Shashank > ; amd-gfx@lists.freedesktop.org > > *Cc:* Qin, Eddy > *Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 > In the long term we probably want to nuke this code anyway and switch > to the DC code, don't we? > > Christian. > > Am 04.11.20 um 15:23 schrieb Deucher, Alexander: >> You might want to talk to the DAL team, they may have some advice.  >> In general, I would say test it as well as you can.  It's probably >> safe as radeon is still the default driver for SI parts and generally >> seems to be working well there. >> >> Alex >> >> ------------------------------------------------------------------------ >> *From:* Sharma, Shashank >> >> *Sent:* Wednesday, November 4, 2020 9:11 AM >> *To:* Deucher, Alexander >> ; Koenig, Christian >> ; >> amd-gfx@lists.freedesktop.org >> >> *Cc:* Qin, Eddy >> *Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 >> >> Thanks Alex, Same question here, >> >> Should we go through some extensive test routine due to change in PLL >> values, or is it OK to go ahead based on our experience from Radeon >> values ? >> >> >> Regards >> >> Shashank >> >> >> On 04/11/20 7:36 pm, Deucher, Alexander wrote: >>> Acked-by: Alex Deucher >>> >>> ------------------------------------------------------------------------ >>> *From:* Koenig, Christian >>> >>> *Sent:* Wednesday, November 4, 2020 6:54 AM >>> *To:* Sharma, Shashank >>> ; amd-gfx@lists.freedesktop.org >>> >>> >>> *Cc:* Deucher, Alexander >>> ; Qin, Eddy >>> >>> *Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at >>> 100 >>> Am 04.11.20 um 11:40 schrieb Sharma, Shashank: >>> > [AMD Public Use] >>> > >>> > Hello Christian, >>> > Yes, that 100 is hardcoded in Radeon, and git blame says it was >>> one of your patches which made it 100 from 128 😊. >>> > Would you mind having a look at commit id: >>> 4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 ? >>> >>> Ah, yes that one :) >>> >>> Yeah the background is that this was just an educated guess because I >>> couldn't find anybody which could tell me what the real limits of the >>> PLL is. >>> >>> Looks like we just forgot to apply that patch to amdgpu. >>> >>> Regards, >>> Christian. >>> >>> > >>> > Regards >>> > Shashank >>> > -----Original Message----- >>> > From: Koenig, Christian >>> >>> > Sent: Wednesday, November 4, 2020 3:35 PM >>> > To: Sharma, Shashank >>> ; amd-gfx@lists.freedesktop.org >>> >>> > Cc: Deucher, Alexander >>> ; Qin, Eddy >>> >>> > Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 >>> > >>> > Am 03.11.20 um 18:13 schrieb Shashank Sharma: >>> >> This patch limits the ref_div_max value to 100, during the >>> calculation >>> >> of PLL feedback reference divider. With current value (128), the >>> >> produced fb_ref_div value generates unstable output at particular >>> >> frequencies. Radeon driver limits this value at 100. >>> > Mhm, is that 100 hard coded in radeon? I have no idea where that >>> is coming from. >>> > >>> > Best would probably to grab a hardware engineer and try to figure >>> out what the real maximums for the PLL is to still produce a stable >>> signal. >>> > >>> > Christian. >>> > >>> >> On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I >>> >> know), it demands a clock of 221270 Khz. It's been observed that the >>> >> PLL calculations using values 128 and 100 are vastly different, and >>> >> look like this: >>> >> >>> >> +------------------------------------------+ >>> >> |Parameter    |AMDGPU |Radeon       | >>> >> |             | |             | >>> >> +-------------+----------------------------+ >>> >> |Clock feedback |             | >>> >> |divider max  |  128         | 100       | >>> >> |cap value    | |             | >>> >> |             | |             | >>> >> |             | |             | >>> >> +------------------------------------------+ >>> >> |ref_div_max  | |             | >>> >> |             |  42          | 20         | >>> >> |             | |             | >>> >> |             | |             | >>> >> +------------------------------------------+ >>> >> |ref_div      |  42          | 20         | >>> >> |             | |             | >>> >> +------------------------------------------+ >>> >> |fb_div       |  10326       | 8195       | >>> >> +------------------------------------------+ >>> >> |fb_div       |  1024        | 163        | >>> >> +------------------------------------------+ >>> >> |fb_dev_p     |  4           | 9          | >>> >> |frac fb_de^_p| |             | >>> >> +----------------------------+-------------+ >>> >> >>> >> With ref_div_max value clipped at 100, AMDGPU driver can also drive >>> >> videmode 2048x1280@60 (221Mhz) and produce proper output without any >>> >> blanking and distortion on the screen. >>> >> >>> >> PS: This value was changed from 128 to 100 in Radeon driver also, >>> here: >>> >> >>> https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8 >>> >> ececc891fc3cb806 >>> >> >>> >> Cc: Alex Deucher >>> >>> >> Cc: Christian König >>> >>> >> Cc: Eddy Qin >>> >> >>> >> Signed-off-by: Shashank Sharma >>> >>> >> --- >>> >> drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- >>> >>    1 file changed, 1 insertion(+), 1 deletion(-) >>> >> >>> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >>> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >>> >> index 1f2305b7bd13..23a2e1ebf78a 100644 >>> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >>> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >>> >> @@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsigned >>> nom, unsigned den, unsigned post_ >>> >> unsigned *fb_div, unsigned *ref_div) >>> >>    { >>> >>       /* limit reference * post divider to a maximum */ >>> >> -    ref_div_max = min(128 / post_div, ref_div_max); >>> >> +    ref_div_max = min(100 / post_div, ref_div_max); >>> >> >>> >>       /* get matching reference and feedback divider */ >>> >>       *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), >>> >> ref_div_max); >>> > > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --------------461998D46E6F4292AE18B514 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Then feel free to stick an Acked-by: Christian König <christian.koenig@amd.com> to the code and get it committed.

Ideally somebody should have it on the TODO list to get rid of that code.

Christian.

Am 04.11.20 um 15:33 schrieb Deucher, Alexander:
yeah, ideally.  Just need to get support for analog encoders.

Alex


From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Wednesday, November 4, 2020 9:31 AM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Sharma, Shashank <Shashank.Sharma@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Qin, Eddy <Eddy.Qin@amd.com>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
 
In the long term we probably want to nuke this code anyway and switch to the DC code, don't we?

Christian.

Am 04.11.20 um 15:23 schrieb Deucher, Alexander:
You might want to talk to the DAL team, they may have some advice.  In general, I would say test it as well as you can.  It's probably safe as radeon is still the default driver for SI parts and generally seems to be working well there.

Alex


From: Sharma, Shashank <Shashank.Sharma@amd.com>
Sent: Wednesday, November 4, 2020 9:11 AM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Qin, Eddy <Eddy.Qin@amd.com>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
 

Thanks Alex, Same question here,

Should we go through some extensive test routine due to change in PLL values, or is it OK to go ahead based on our experience from Radeon values ?


Regards

Shashank


On 04/11/20 7:36 pm, Deucher, Alexander wrote:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Wednesday, November 4, 2020 6:54 AM
To: Sharma, Shashank <Shashank.Sharma@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Qin, Eddy <Eddy.Qin@amd.com>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
 
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
> [AMD Public Use]
>
> Hello Christian,
> Yes, that 100 is hardcoded in Radeon, and git blame says it was one of your patches which made it 100 from 128 😊.
> Would you mind having a look at commit id: 4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 ?

Ah, yes that one :)

Yeah the background is that this was just an educated guess because I
couldn't find anybody which could tell me what the real limits of the
PLL is.

Looks like we just forgot to apply that patch to amdgpu.

Regards,
Christian.

>
> Regards
> Shashank
> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig@amd.com>
> Sent: Wednesday, November 4, 2020 3:35 PM
> To: Sharma, Shashank <Shashank.Sharma@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Qin, Eddy <Eddy.Qin@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
>
> Am 03.11.20 um 18:13 schrieb Shashank Sharma:
>> This patch limits the ref_div_max value to 100, during the calculation
>> of PLL feedback reference divider. With current value (128), the
>> produced fb_ref_div value generates unstable output at particular
>> frequencies. Radeon driver limits this value at 100.
> Mhm, is that 100 hard coded in radeon? I have no idea where that is coming from.
>
> Best would probably to grab a hardware engineer and try to figure out what the real maximums for the PLL is to still produce a stable signal.
>
> Christian.
>
>> On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I
>> know), it demands a clock of 221270 Khz. It's been observed that the
>> PLL calculations using values 128 and 100 are vastly different, and
>> look like this:
>>
>> +------------------------------------------+
>> |Parameter    |AMDGPU        |Radeon       |
>> |             |              |             |
>> +-------------+----------------------------+
>> |Clock feedback              |             |
>> |divider max  |  128         |   100       |
>> |cap value    |              |             |
>> |             |              |             |
>> |             |              |             |
>> +------------------------------------------+
>> |ref_div_max  |              |             |
>> |             |  42          |  20         |
>> |             |              |             |
>> |             |              |             |
>> +------------------------------------------+
>> |ref_div      |  42          |  20         |
>> |             |              |             |
>> +------------------------------------------+
>> |fb_div       |  10326       |  8195       |
>> +------------------------------------------+
>> |fb_div       |  1024        |  163        |
>> +------------------------------------------+
>> |fb_dev_p     |  4           |  9          |
>> |frac fb_de^_p|              |             |
>> +----------------------------+-------------+
>>
>> With ref_div_max value clipped at 100, AMDGPU driver can also drive
>> videmode 2048x1280@60 (221Mhz) and produce proper output without any
>> blanking and distortion on the screen.
>>
>> PS: This value was changed from 128 to 100 in Radeon driver also, here:
>> https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8
>> ececc891fc3cb806
>>
>> Cc: Alex Deucher <Alexander.Deucher@amd.com>
>> Cc: Christian König <christian.koenig@amd.com>
>> Cc: Eddy Qin <Eddy.Qin@amd.com>
>>
>> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +-
>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c
>> index 1f2305b7bd13..23a2e1ebf78a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c
>> @@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_
>>                                     unsigned *fb_div, unsigned *ref_div)
>>    {
>>       /* limit reference * post divider to a maximum */
>> -    ref_div_max = min(128 / post_div, ref_div_max);
>> +    ref_div_max = min(100 / post_div, ref_div_max);
>>   
>>       /* get matching reference and feedback divider */
>>       *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
>> ref_div_max);



_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

--------------461998D46E6F4292AE18B514-- --===============0331977621== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============0331977621==--