From 1382e56627031315e4edb9e856848853b7d8079d Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Tue, 17 Jul 2018 19:16:39 +0300 Subject: lib: Add DIV_ROUND_UP() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add DIV_ROUND_UP() and replace some hand rolled versions with it. v2: Drop the duplicate from gem_render_copy() (Paulo) Signed-off-by: Ville Syrjälä Reviewed-by: Paulo Zanoni --- lib/igt_aux.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_aux.h') diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 192c3ad8..fb02c026 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -293,4 +293,6 @@ void igt_lsof(const char *dpath); #define roundup_power_of_two(x) ((x) != 0 ? 1 << igt_fls((x) - 1) : 0) +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + #endif /* IGT_AUX_H */ -- cgit v1.2.3