From bd6f9e8aee0bb9ceba345b8c9434436dd82ac59f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 15 Apr 2025 12:25:39 +0200 Subject: [PATCH] radeonsi/vpe: Use float division to get scaling ratio Fixes: e85a6b6a63a ("radeonsi/vpe: check reduction ratio") Reviewed-by: Peyton Lee Part-of: --- src/gallium/drivers/radeonsi/si_vpe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_vpe.c b/src/gallium/drivers/radeonsi/si_vpe.c index e0f5442615d..8cce0244d34 100644 --- a/src/gallium/drivers/radeonsi/si_vpe.c +++ b/src/gallium/drivers/radeonsi/si_vpe.c @@ -1266,8 +1266,8 @@ si_vpe_processor_process_frame(struct pipe_video_codec *codec, dst_rect_width = process_properties->dst_region.x1 - process_properties->dst_region.x0; dst_rect_height = process_properties->dst_region.y1 - process_properties->dst_region.y0; - scaling_ratio[0] = src_rect_width / dst_rect_width; - scaling_ratio[1] = src_rect_height / dst_rect_height; + scaling_ratio[0] = (float)src_rect_width / dst_rect_width; + scaling_ratio[1] = (float)src_rect_height / dst_rect_height; /* Perform general processing */ if ((scaling_ratio[0] <= VPE_MAX_GEOMETRIC_DOWNSCALE) && (scaling_ratio[1] <= VPE_MAX_GEOMETRIC_DOWNSCALE))