diff mbox

[03/11] drm/i915: Use fixed_16_16 wrapper for division operation

Message ID 20170508114902.18965-4-mahesh1.kumar@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kumar, Mahesh May 8, 2017, 11:48 a.m. UTC
Don't use fixed_16_16 structure members directly, instead use wrapper to
perform fixed_16_16 division operation.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Matt Roper May 12, 2017, 12:22 a.m. UTC | #1
On Mon, May 08, 2017 at 05:18:54PM +0530, Mahesh Kumar wrote:
> Don't use fixed_16_16 structure members directly, instead use wrapper to
> perform fixed_16_16 division operation.
> 
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 91f09dfdb618..66b542ba47ad 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3867,8 +3867,8 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
>  	}
>  
>  	res_blocks = fixed_16_16_to_u32_round_up(selected_result) + 1;
> -	res_lines = DIV_ROUND_UP(selected_result.val,
> -				 plane_blocks_per_line.val);
> +	res_lines = div_round_up_fixed_16_16(selected_result,
> +					     plane_blocks_per_line);
>  
>  	if (level >= 1 && level <= 7) {
>  		if (y_tiled) {
> -- 
> 2.11.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 91f09dfdb618..66b542ba47ad 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3867,8 +3867,8 @@  static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
 	}
 
 	res_blocks = fixed_16_16_to_u32_round_up(selected_result) + 1;
-	res_lines = DIV_ROUND_UP(selected_result.val,
-				 plane_blocks_per_line.val);
+	res_lines = div_round_up_fixed_16_16(selected_result,
+					     plane_blocks_per_line);
 
 	if (level >= 1 && level <= 7) {
 		if (y_tiled) {