Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / lib / drm_random.h
blob4a3e94dfa0c00161921f26f272825351cf5b95cc
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __DRM_RANDOM_H__
3 #define __DRM_RANDOM_H__
5 /* This is a temporary home for a couple of utility functions that should
6 * be transposed to lib/ at the earliest convenience.
7 */
9 #include <linux/random.h>
11 #define DRM_RND_STATE_INITIALIZER(seed__) ({ \
12 struct rnd_state state__; \
13 prandom_seed_state(&state__, (seed__)); \
14 state__; \
17 #define DRM_RND_STATE(name__, seed__) \
18 struct rnd_state name__ = DRM_RND_STATE_INITIALIZER(seed__)
20 unsigned int *drm_random_order(unsigned int count,
21 struct rnd_state *state);
22 void drm_random_reorder(unsigned int *order,
23 unsigned int count,
24 struct rnd_state *state);
26 #endif /* !__DRM_RANDOM_H__ */