summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-05-30 08:18:57 -0700
committerJason Ekstrand <[email protected]>2017-06-01 15:33:39 -0700
commit1547d133ac93292a9f57641aea5c7a7672a4a308 (patch)
tree2259ee14c2add3b4b7fabe428820ef49898d9438 /src
parent58051ad22046253d4ed9644407d5c2ee8a22aa31 (diff)
intel/isl: Add an isl_assert_div helper
This is a fairly common operation and it's nice to be able to just call the one little function. Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/isl/isl_priv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h
index 3c4cc1ed95b..186e84db46d 100644
--- a/src/intel/isl/isl_priv.h
+++ b/src/intel/isl/isl_priv.h
@@ -80,6 +80,13 @@ isl_align_npot(uintmax_t n, uintmax_t a)
return ((n + a - 1) / a) * a;
}
+static inline uintmax_t
+isl_assert_div(uintmax_t n, uintmax_t a)
+{
+ assert(n % a == 0);
+ return n / a;
+}
+
/**
* Alignment must be a power of 2.
*/