summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/arm/display/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/arm/display/include')
-rw-r--r--drivers/gpu/drm/arm/display/include/malidp_utils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/display/include/malidp_utils.h b/drivers/gpu/drm/arm/display/include/malidp_utils.h
index 9096e40facfa..8cfd91196e15 100644
--- a/drivers/gpu/drm/arm/display/include/malidp_utils.h
+++ b/drivers/gpu/drm/arm/display/include/malidp_utils.h
@@ -27,4 +27,21 @@
num_tries; \
})
+/* the restriction of range is [start, end] */
+struct malidp_range {
+ u32 start;
+ u32 end;
+};
+
+static inline void set_range(struct malidp_range *rg, u32 start, u32 end)
+{
+ rg->start = start;
+ rg->end = end;
+}
+
+static inline bool in_range(struct malidp_range *rg, u32 v)
+{
+ return (v >= rg->start) && (v <= rg->end);
+}
+
#endif /* _MALIDP_UTILS_ */