Shashank Sharma 7301757ea1 drm/amdgpu/OLAND: clip the ref divider max value
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:
4b21ce1b4b

V1:
Got acks from:
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>

V2:
- Restricting the changes only for OLAND, just to avoid any regression
  for other cards.
- Changed unsigned -> unsigned int to make checkpatch quiet.

V3: Apply the change on SI family (not only oland) (Christian)

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Eddy Qin <Eddy.Qin@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-08-24 15:35:25 -04:00
..
2021-07-30 14:52:00 +10:00
2021-07-30 14:52:00 +10:00
2021-07-30 14:52:00 +10:00
2021-07-21 11:58:28 +10:00
2021-07-26 09:27:59 +10:00
2021-07-21 11:58:28 +10:00
2021-07-30 14:52:00 +10:00
2021-07-30 14:52:00 +10:00
2021-07-21 11:58:28 +10:00
2021-07-27 21:15:24 +02:00
2021-07-23 11:32:43 +10:00
2021-07-21 11:58:28 +10:00
2021-07-30 14:52:00 +10:00
2021-07-26 09:27:59 +10:00
2021-07-30 14:52:00 +10:00
2021-06-11 12:30:39 -07:00
2021-01-04 12:59:33 +01:00
2021-07-29 09:12:01 +02:00
2021-01-07 13:40:20 +01:00
2021-05-17 21:19:48 +02:00
2021-03-18 14:22:50 +01:00
2021-07-05 08:54:44 +02:00