Commit 0b1f04d8 authored by Sung Lee's avatar Sung Lee Committed by Alex Deucher

drm/amd/display: Cast int to float before division

[Why]:
Some inputs to dml_ceil have it dividied by int which causes a
truncation. This loss of precision means the ceil function becomes
redundant and does not round up.

[How]:
Cast parameter to float before division.
Signed-off-by: default avatarSung Lee <sung.lee@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f2cd2e5d
...@@ -5944,7 +5944,7 @@ static void CalculateMetaAndPTETimes( ...@@ -5944,7 +5944,7 @@ static void CalculateMetaAndPTETimes(
* PixelPTEReqHeightY[k]; * PixelPTEReqHeightY[k];
} }
dpte_groups_per_row_luma_ub = dml_ceil( dpte_groups_per_row_luma_ub = dml_ceil(
dpte_row_width_luma_ub[k] / dpte_group_width_luma, (float) dpte_row_width_luma_ub[k] / dpte_group_width_luma,
1); 1);
time_per_pte_group_nom_luma[k] = DST_Y_PER_PTE_ROW_NOM_L[k] * HTotal[k] time_per_pte_group_nom_luma[k] = DST_Y_PER_PTE_ROW_NOM_L[k] * HTotal[k]
/ PixelClock[k] / dpte_groups_per_row_luma_ub; / PixelClock[k] / dpte_groups_per_row_luma_ub;
...@@ -5968,7 +5968,7 @@ static void CalculateMetaAndPTETimes( ...@@ -5968,7 +5968,7 @@ static void CalculateMetaAndPTETimes(
* PixelPTEReqHeightC[k]; * PixelPTEReqHeightC[k];
} }
dpte_groups_per_row_chroma_ub = dml_ceil( dpte_groups_per_row_chroma_ub = dml_ceil(
dpte_row_width_chroma_ub[k] (float) dpte_row_width_chroma_ub[k]
/ dpte_group_width_chroma, / dpte_group_width_chroma,
1); 1);
time_per_pte_group_nom_chroma[k] = DST_Y_PER_PTE_ROW_NOM_C[k] time_per_pte_group_nom_chroma[k] = DST_Y_PER_PTE_ROW_NOM_C[k]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment