drm: Add a simple generator of random permutations
authorChris Wilson <[email protected]>
Thu, 22 Dec 2016 08:36:08 +0000 (08:36 +0000)
committerDaniel Vetter <[email protected]>
Tue, 27 Dec 2016 11:34:00 +0000 (12:34 +0100)
commita33d42dd03352d2e9d3d2c00bfa435c7a5ebab25
treea2d74a1f6f6e31bdf0788d24c66feee224056003
parentcf4a7207b1cb4a3c3fe3aa11a83c9d673722a7f5
drm: Add a simple generator of random permutations

When testing, we want a random but yet reproducible order in which to
process elements. Here we create an array which is a random (using the
Tausworthe PRNG) permutation of the order in which to execute.

Note these are simple helpers intended to be merged upstream in lib/

v2: Tidier code by David Herrmann
v3: Add reminder that this code is intended to be temporary, with at
least the bulk of the prandom changes going to lib/

Signed-off-by: Chris Wilson <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: David Herrmann <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile
drivers/gpu/drm/lib/drm_random.c [new file with mode: 0644]
drivers/gpu/drm/lib/drm_random.h [new file with mode: 0644]