Merge drm/drm-fixes into drm-misc-fixes
[linux-2.6-block.git] / drivers / gpu / drm / display / drm_dp_helper.c
index 266826eac4a75bc50fbbf3ba0830c599bf0c285f..f5d4be897866093a68c0d4f41380b3fdc20aaa85 100644 (file)
@@ -4111,6 +4111,13 @@ int drm_dp_bw_overhead(int lane_count, int hactive,
        u32 overhead = 1000000;
        int symbol_cycles;
 
+       if (lane_count == 0 || hactive == 0 || bpp_x16 == 0) {
+               DRM_DEBUG_KMS("Invalid BW overhead params: lane_count %d, hactive %d, bpp_x16 %d.%04d\n",
+                             lane_count, hactive,
+                             bpp_x16 >> 4, (bpp_x16 & 0xf) * 625);
+               return 0;
+       }
+
        /*
         * DP Standard v2.1 2.6.4.1
         * SSC downspread and ref clock variation margin: