diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-01-22 21:58:27 +0100 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-01-22 22:28:46 +0100 |
| commit | 98129fa2ff2c095d13cb0f60499c2de129d36d6c (patch) | |
| tree | 6b68522462e456ba6876197fb66a618f1c332817 /lib | |
| parent | fbfe374b280be9542f7ddb59c41c6096f4d773fa (diff) | |
tests: add gem_tiled_swapping
Also add a drmtest_exchange_int helper, might come handy at other
places.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/drmtest.c | 10 | ||||
| -rw-r--r-- | lib/drmtest.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index cc946411..b2ac7621 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -333,6 +333,16 @@ void drmtest_stop_signal_helper(void) } /* other helpers */ +void drmtest_exchange_int(void *array, unsigned i, unsigned j) +{ + int *int_arr, tmp; + int_arr = array; + + tmp = int_arr[i]; + int_arr[i] = int_arr[j]; + int_arr[j] = tmp; +} + void drmtest_permute_array(void *array, unsigned size, void (*exchange_func)(void *array, unsigned i, diff --git a/lib/drmtest.h b/lib/drmtest.h index 23d6f089..90d81e7f 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -55,6 +55,7 @@ uint64_t gem_mappable_aperture_size(void); /* generally useful helpers */ void drmtest_fork_signal_helper(void); void drmtest_stop_signal_helper(void); +void drmtest_exchange_int(void *array, unsigned i, unsigned j); void drmtest_permute_array(void *array, unsigned size, void (*exchange_func)(void *array, unsigned i, |
