summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/isl/isl_priv.h')
-rw-r--r--src/intel/isl/isl_priv.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h
index 3a7af1ae35f..9867e22a8ee 100644
--- a/src/intel/isl/isl_priv.h
+++ b/src/intel/isl/isl_priv.h
@@ -99,6 +99,15 @@ isl_log2u(uint32_t n)
}
static inline uint32_t
+isl_round_up_to_power_of_two(uint32_t value)
+{
+ if (value <= 1)
+ return value;
+
+ return 1 << (32 - __builtin_clz(value - 1));
+}
+
+static inline uint32_t
isl_minify(uint32_t n, uint32_t levels)
{
if (unlikely(n == 0))