OSDN Git Service

Merge "mdss: display-port: fix link rate calculation"
authorLinux Build Service Account <lnxbuild@localhost>
Tue, 15 Nov 2016 05:53:59 +0000 (21:53 -0800)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 15 Nov 2016 05:53:58 +0000 (21:53 -0800)
1  2 
drivers/video/fbdev/msm/mdss_dp_aux.c

@@@ -527,13 -527,19 +527,19 @@@ char mdss_dp_gen_link_clk(struct mdss_p
         * Any changes in the section of code should
         * consider this limitation.
         */
 -      min_link_rate = pinfo->clk_rate
 -                      / (lane_cnt * encoding_factx10);
 +      min_link_rate = (u32)div_u64(pinfo->clk_rate,
 +                              (lane_cnt * encoding_factx10));
        min_link_rate /= ln_to_link_ratio;
        min_link_rate = (min_link_rate * pinfo->bpp);
-       min_link_rate = (u32)div_u64(min_link_rate * 10,
-                                       DP_LINK_RATE_MULTIPLIER);
+       min_link_rate = (u32)div_u64_rem(min_link_rate * 10,
+                               DP_LINK_RATE_MULTIPLIER, &reminder);
  
+       /*
+        * To avoid any fractional values,
+        * increment the min_link_rate
+        */
+       if (reminder)
+               min_link_rate += 1;
        pr_debug("min_link_rate = %d\n", min_link_rate);
  
        if (min_link_rate <= DP_LINK_RATE_162)