drm/amd/display: fix dml log2 function
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Fri, 1 May 2020 19:43:09 +0000 (15:43 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 May 2020 18:00:48 +0000 (14:00 -0400)
This change removes internal rounding in dml_log2 function.

Dml_log2 is expected to return a float output. In case an int is needed
dml will floor the output on it's own.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h

index 02e06c9..ab0870e 100644 (file)
@@ -86,9 +86,9 @@ static inline double dml_round(double a)
                return floor;
 }
 
-static inline int dml_log2(double x)
+static inline double dml_log2(double x)
 {
-       return dml_round((double)dcn_bw_log(x, 2));
+       return (double) dcn_bw_log(x, 2);
 }
 
 static inline double dml_pow(double a, int exp)