amdgpu/dc: use kernel ilog2 for log_2.
Subsystems (3)
PATCH 1/1 amdgpu/dc: use kernel ilog2 for log_2.
From: Dave Airlie <[email protected]>
This should produce the same result.
Signed-off-by Dave Airlie <[email protected]>
--- drivers/gpu/drm/amd/display/dc/basics/conversion.c | 10 ---------- drivers/gpu/drm/amd/display/dc/basics/conversion.h | 5 ++++- 2 files changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/conversion.c +0 -10
@@ -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; -}
drivers/gpu/drm/amd/display/dc/basics/conversion.h +4 -1
@@ -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
Signature · 6 lines
2.9.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20171003031436.20269-1-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Harry Wentland
Reviewed-byQuoted 5 lines · Dave Airlie
From: Dave Airlie <[email protected]>
This should produce the same result.
Signed-off-by Dave Airlie <[email protected]>
Reviewed-by Harry Wentland <[email protected]>
Harry
Quoted 29 lines
--- drivers/gpu/drm/amd/display/dc/basics/conversion.c | 10 ---------- drivers/gpu/drm/amd/display/dc/basics/conversion.h | 5 ++++- 2 files changed, 4 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/display/dc/basics/conversion.c +0
-10@@ -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; -}drivers/gpu/drm/amd/display/dc/basics/conversion.h +0
-0
drivers/gpu/drm/amd/display/dc/basics/conversion.h void convert_float_matrix( · line 46
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/basics/conversion.h +4
-1@@ -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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx