drm/i915/skl: Prefer even dividers for SKL DPLLs
authorDamien Lespiau <damien.lespiau@intel.com>
Thu, 25 Jun 2015 15:19:24 +0000 (16:19 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 26 Jun 2015 17:39:31 +0000 (19:39 +0200)
Currently, if an odd divider improves the deviation (minimizes it), we
take that divider. The recommendation is to prefer even dividers.

v2: Move the check at the right place after having inverted the two for
    loops in the previous patch.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_ddi.c

index 6e964ef7dfdad7ffa5e511734eb6884fb5608bb7..f6b3ccc4ab66909c8dcf1c728d2bd1fc72664c11 100644 (file)
@@ -1317,6 +1317,13 @@ skl_ddi_calculate_wrpll(int clock /* in Hz */,
                                                      p);
                        }
                }
+
+               /*
+                * If a solution is found with an even divider, prefer
+                * this one.
+                */
+               if (d == 0 && ctx.p)
+                       break;
        }
 
        if (!ctx.p) {