drm/i915/skl+: change WM calc to fixed point 16.16
authorMahesh Kumar <mahesh1.kumar@intel.com>
Thu, 1 Dec 2016 15:49:37 +0000 (21:19 +0530)
committerPaulo Zanoni <paulo.r.zanoni@intel.com>
Wed, 7 Dec 2016 18:30:34 +0000 (16:30 -0200)
commitb95320bdf2d891011da9c5ec85dcb114483856a6
tree2578f72c9c83314a2fc9fc4fdcb319dfcfef82fe
parent4b7b2331885a1ab348178f3faf9dc6a4dccae01a
drm/i915/skl+: change WM calc to fixed point 16.16

This patch changes Watermak calculation to fixed point calculation.
Problem with current calculation is during plane_blocks_per_line
calculation we divide intermediate blocks with min_scanlines and
takes floor of the result because of integer operation.
hence we end-up assigning less blocks than required. Which leads to
flickers.

Changes since V1:
 - Add fixed point data type as per Paulo's review
Changes since V2:
 - use fixed_point instead of fp_16_16
Changes since V3:
 - rebase
Changes since V4 (from Paulo):
 - My original renaming suggestion was misunderstood, so implement it
 - Simplify fixed_16_16_to_u32 implementation
 - Fix indentation

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161201154940.24446-6-mahesh1.kumar@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_pm.c