1 #ifndef __DRM_RANDOM_H__
2 #define __DRM_RANDOM_H__
4 /* This is a temporary home for a couple of utility functions that should
5 * be transposed to lib/ at the earliest convenience.
8 #include <linux/random.h>
10 #define DRM_RND_STATE_INITIALIZER(seed__) ({ \
11 struct rnd_state state__; \
12 prandom_seed_state(&state__, (seed__)); \
16 #define DRM_RND_STATE(name__, seed__) \
17 struct rnd_state name__ = DRM_RND_STATE_INITIALIZER(seed__)
19 unsigned int *drm_random_order(unsigned int count,
20 struct rnd_state *state);
21 void drm_random_reorder(unsigned int *order,
23 struct rnd_state *state);
25 #endif /* !__DRM_RANDOM_H__ */