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>
This commit is contained in:
Dave Airlie
2017-10-03 13:49:42 +10:00
committed by Alex Deucher
parent 4ee67c71b8
commit 23d433fabe
2 changed files with 4 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -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