diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-03 06:49:42 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-06 20:00:27 +0300 |
commit | 23d433fabef852e82053186b60710d138f727284 (patch) | |
tree | 0d42278c97594efbdca7a669e992f776c02c2c12 /drivers/gpu/drm/amd/display/dc/basics | |
parent | 4ee67c71b89948289eb5c55f1a19281be61178e5 (diff) | |
download | linux-23d433fabef852e82053186b60710d138f727284.tar.xz |
amdgpu/dc: use kernel ilog2 for log_2.
This should produce the same result.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/basics')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/basics/conversion.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/basics/conversion.h | 5 |
2 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/basics/conversion.c b/drivers/gpu/drm/amd/display/dc/basics/conversion.c index a2e22ae12adb..23c9a0ec0181 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/conversion.c +++ b/drivers/gpu/drm/amd/display/dc/basics/conversion.c @@ -102,13 +102,3 @@ void convert_float_matrix( matrix[i] = (uint16_t)reg_value; } } - -unsigned int log_2(unsigned int num) -{ - unsigned int result = 0; - - while ((num >>= 1) != 0) - result++; - - return result; -} diff --git a/drivers/gpu/drm/amd/display/dc/basics/conversion.h b/drivers/gpu/drm/amd/display/dc/basics/conversion.h index 189325f68cfd..ade785c4fdc7 100644 --- a/drivers/gpu/drm/amd/display/dc/basics/conversion.h +++ b/drivers/gpu/drm/amd/display/dc/basics/conversion.h @@ -38,6 +38,9 @@ void convert_float_matrix( struct fixed31_32 *flt, uint32_t buffer_size); -unsigned int log_2(unsigned int num); +static inline unsigned int log_2(unsigned int num) +{ + return ilog2(num); +} #endif |