Fix the parent clock search for the display
controller. It addresses the corner case when
the divider difference is just smaller than the
chosen precision and wrongly assumed zero.
An explicit ceiling function is applied for
corretness.
Bug
1580265
Bug
1552739
Change-Id: I47312116c19813260941abcae42e4067a57f3d2c
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: http://git-master/r/714972
GVS: Gerrit_Virtual_Submit
Reviewed-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
for (n = 4; (ref / 2 * n) <= pmax; n++) {
if ((ref / 2 * n) < pmin) /* too low */
continue;
- m = (ref / 2 * n) / (pclk / 1000);
+ m = DIV_ROUND_UP((ref / 2 * n), (pclk / 1000));
if (m <= 1700) /* for 2 <= m */
continue;
f = m % 1000; /* fractional parts */