drm/amdgpu: clip the ref divider max value at 100
Subsystems (2)
PATCH 1/1 drm/amdgpu: clip the ref divider max value at 100
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.
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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1 -1
@@ -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);
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerAm 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 5 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 53 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c static void amdgpu_pll_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_ · line 91
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[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 ?
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 63 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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),
Quoted 1 line
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerAm 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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.
Quoted 81 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
________________________________
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 6:54 AM
To: Sharma, Shashank <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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.
Quoted 81 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
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
Quoted 95 lines · Alexander
Acked-by Alex Deucher <[email protected]>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Koenig, Christian <[email protected]>
*Sent:* Wednesday, November 4, 2020 6:54 AM
*To:* Sharma, Shashank <[email protected]>; [email protected] <[email protected]> *Cc:* Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:Quoted 5 lines
[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.Quoted 69 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 48 lines
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_maxvalue 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 <https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8>ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0@@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_ unsigned *fb_div, unsigned *ref_div)Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1{ /* 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
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 <[email protected]>
Sent: Wednesday, November 4, 2020 9:11 AM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected] <[email protected]>
Cc: Qin, Eddy <[email protected]>
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:
________________________________
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 6:54 AM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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.
Quoted 81 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]><mailto:[email protected]>Cc Christian König <[email protected]><mailto:[email protected]>Cc Eddy Qin <[email protected]><mailto:[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerIn 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:
Quoted 16 lines
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 <[email protected]>
*Sent:* Wednesday, November 4, 2020 9:11 AM
*To:* Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected] <[email protected]> *Cc:* Qin, Eddy <[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Thanks 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 ?
Quoted 129 lines
Regards
Shashank
Quoted 123 lines · Alexander
------------------------------------------------------------------------
*From:* Koenig, Christian <[email protected]> <mailto:[email protected]>
*Sent:* Wednesday, November 4, 2020 6:54 AM
*To:* Sharma, Shashank <[email protected]> <mailto:[email protected]>; [email protected] <mailto:[email protected]> <[email protected]> <mailto:[email protected]> *Cc:* Deucher, Alexander <[email protected]> <mailto:[email protected]>; Qin, Eddy <[email protected]> <mailto:[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:Quoted 4 lines
[AMD Public Use]
Hello Christian,
Yes, that 100 is hardcoded in Radeon, and git blame says it was oneof your patches which made it 100 from 128 😊.
Quoted 1 line
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.Quoted 5 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Quoted 2 lines
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected] <mailto:[email protected]>
Quoted 1 line
Cc Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]> <mailto:[email protected]>
Quoted 8 lines
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 2 lines
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.
Quoted 39 lines
Christian.
Quoted 36 lines
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_maxvalue 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:
Quoted 4 lines
Quoted 4 lines
https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8
ececc891fc3cb806Cc Alex Deucher <[email protected]><mailto:[email protected]>
Quoted 1 line
Quoted 1 line
Cc Christian König <[email protected]><mailto:[email protected]>
Quoted 3 lines
Quoted 3 lines
Cc Eddy Qin <[email protected]> <mailto:[email protected]>Signed-off-by Shashank Sharma <[email protected]><mailto:[email protected]>
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c static void amdgpu_pll_get_fb_ref_div(unsigned
Quoted 10 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0@@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsignednom, unsigned den, unsigned
post_Quoted 1 line
Quoted 1 line
unsigned
*fb_div, unsigned
*ref_div)Quoted 8 lines
Quoted 8 lines
{
/* 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
yeah, ideally. Just need to get support for analog encoders.
Alex
________________________________
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 9:31 AM
To: Deucher, Alexander <[email protected]>; Sharma, Shashank <[email protected]>; [email protected] <[email protected]>
Cc: Qin, Eddy <[email protected]>
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 <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 9:11 AM
To: Deucher, Alexander <[email protected]><mailto:[email protected]>; Koenig, Christian <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>
Cc: Qin, Eddy <[email protected]><mailto:[email protected]>
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:
________________________________
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 6:54 AM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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.
Quoted 81 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]><mailto:[email protected]>Cc Christian König <[email protected]><mailto:[email protected]>Cc Eddy Qin <[email protected]><mailto:[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Then feel free to stick an Acked-by: Christian König <[email protected]> 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:
Quoted 163 lines
yeah, ideally. Just need to get support for analog encoders.
Alex
------------------------------------------------------------------------
*From:* Koenig, Christian <[email protected]>
*Sent:* Wednesday, November 4, 2020 9:31 AM
*To:* Deucher, Alexander <[email protected]>; Sharma, Shashank <[email protected]>; [email protected] <[email protected]> *Cc:* Qin, Eddy <[email protected]>
*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:
Quoted 16 lines
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 <[email protected]> <mailto:[email protected]>
*Sent:* Wednesday, November 4, 2020 9:11 AM
*To:* Deucher, Alexander <[email protected]> <mailto:[email protected]>; Koenig, Christian <[email protected]> <mailto:[email protected]>; [email protected] <mailto:[email protected]> <[email protected]> <mailto:[email protected]> *Cc:* Qin, Eddy <[email protected]> <mailto:[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Thanks 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 ?
Quoted 130 lines
Regards
Shashank
Quoted 124 lines · Alexander
------------------------------------------------------------------------
*From:* Koenig, Christian <[email protected]> <mailto:[email protected]>
*Sent:* Wednesday, November 4, 2020 6:54 AM
*To:* Sharma, Shashank <[email protected]> <mailto:[email protected]>; [email protected] <mailto:[email protected]> <[email protected]> <mailto:[email protected]> *Cc:* Deucher, Alexander <[email protected]> <mailto:[email protected]>; Qin, Eddy <[email protected]> <mailto:[email protected]>
*Subject:* Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:Quoted 4 lines
[AMD Public Use]
Hello Christian,
Yes, that 100 is hardcoded in Radeon, and git blame says it wasone of your patches which made it 100 from 128 😊.
Quoted 1 line
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.Quoted 5 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Quoted 2 lines
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected] <mailto:[email protected]>
Quoted 1 line
Cc Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]> <mailto:[email protected]>
Quoted 4 lines
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 1 line
This patch limits the
ref_div_maxvalue to 100, during thecalculation
Quoted 4 lines
Quoted 3 lines
of PLL feedback reference divider. With current value (128), the produced
fb_ref_divvalue 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.
Quoted 2 lines
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.
Quoted 39 lines
Christian.
Quoted 36 lines
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_maxvalue 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:
Quoted 1 line
Quoted 1 line
https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8
Quoted 3 lines
Quoted 3 lines
ececc891fc3cb806Cc Alex Deucher <[email protected]><mailto:[email protected]>
Quoted 1 line
Quoted 1 line
Cc Christian König <[email protected]><mailto:[email protected]>
Quoted 3 lines
Quoted 3 lines
Cc Eddy Qin <[email protected]> <mailto:[email protected]>Signed-off-by Shashank Sharma <[email protected]><mailto:[email protected]>
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c static void amdgpu_pll_get_fb_ref_div(unsigned
Quoted 10 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0@@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsignednom, unsigned den, unsigned
post_Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1unsigned *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);
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sharma, Shashank
Acked-by Alex Deucher[AMD Public Use]
Thanks Alex, Christian,
Let me quickly run this patch through someone in DAL team, and see how it looks.
Regards
Shashank
From: Deucher, Alexander <[email protected]>
Sent: Wednesday, November 4, 2020 8:03 PM
To: Koenig, Christian <[email protected]>; Sharma, Shashank <[email protected]>; [email protected]
Cc: Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
yeah, ideally. Just need to get support for analog encoders.
Alex
________________________________
From: Koenig, Christian <[email protected]<mailto:[email protected]>>
Sent: Wednesday, November 4, 2020 9:31 AM
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Sharma, Shashank <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Qin, Eddy <[email protected]<mailto:[email protected]>>
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 <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 9:11 AM
To: Deucher, Alexander <[email protected]><mailto:[email protected]>; Koenig, Christian <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>
Cc: Qin, Eddy <[email protected]><mailto:[email protected]>
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:
________________________________
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 6:54 AM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]> <[email protected]><mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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.
Quoted 81 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]><mailto:[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]><mailto:[email protected]>; Qin, Eddy <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]><mailto:[email protected]>Cc Christian König <[email protected]><mailto:[email protected]>Cc Eddy Qin <[email protected]><mailto:[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 8 lines · Christian König
Am 04.11.20 um 11:40 schrieb Sharma, Shashank:
Quoted 5 lines
[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 :)
Quoted 8 lines
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.
Cool, I was wondering if we should let this patch go through some elaborated Pixel clock testing on different resolution, or is it ok to go ahead with this patch based on the experience from Radeon driver change ?
Regards
Shashank
Quoted 80 lines
Quoted 80 lines
Regards
Shashank
-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, November 4, 2020 3:35 PM
To: Sharma, Shashank <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Qin, Eddy <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100Am 03.11.20 um 18:13 schrieb Shashank Sharma:
Quoted 4 lines
This patch limits the
ref_div_maxvalue to 100, during the calculation of PLL feedback reference divider. With current value (128), the producedfb_ref_divvalue 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.
Quoted 60 lines
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_maxvalue 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/4b21ce1b4b5d262e7d4656b8ececc891fc3cb806Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Cc Eddy Qin <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1
-1@@ -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);
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +0
-0/* get matching reference and feedback divider */ *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u),
ref_div_max);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx