Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sung Lee <sung.lee@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sung Lee and committed by
Alex Deucher
0b1f04d8 f2cd2e5d

+2 -2
+2 -2
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
··· 5944 5944 * PixelPTEReqHeightY[k]; 5945 5945 } 5946 5946 dpte_groups_per_row_luma_ub = dml_ceil( 5947 - dpte_row_width_luma_ub[k] / dpte_group_width_luma, 5947 + (float) dpte_row_width_luma_ub[k] / dpte_group_width_luma, 5948 5948 1); 5949 5949 time_per_pte_group_nom_luma[k] = DST_Y_PER_PTE_ROW_NOM_L[k] * HTotal[k] 5950 5950 / PixelClock[k] / dpte_groups_per_row_luma_ub; ··· 5968 5968 * PixelPTEReqHeightC[k]; 5969 5969 } 5970 5970 dpte_groups_per_row_chroma_ub = dml_ceil( 5971 - dpte_row_width_chroma_ub[k] 5971 + (float) dpte_row_width_chroma_ub[k] 5972 5972 / dpte_group_width_chroma, 5973 5973 1); 5974 5974 time_per_pte_group_nom_chroma[k] = DST_Y_PER_PTE_ROW_NOM_C[k]