diff options
author | Arunpravin <Arunpravin.PaneerSelvam@amd.com> | 2022-02-22 18:48:41 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2022-02-23 10:44:43 +0100 |
commit | 92937f170d3f49f41d7acb86243ee691a98eb2be (patch) | |
tree | a3705c67a108d61b397be2328c6b6085c67606cb /drivers/gpu/drm/lib | |
parent | drm/selftests: add drm buddy alloc limit testcase (diff) | |
download | linux-92937f170d3f49f41d7acb86243ee691a98eb2be.tar.xz linux-92937f170d3f49f41d7acb86243ee691a98eb2be.zip |
drm/selftests: add drm buddy alloc range testcase
- add a test to check the range allocation
- export get_buddy() function in drm_buddy.c
- export drm_prandom_u32_max_state() in lib/drm_random.c
- include helper functions
- include prime number header file
v2:
- add drm_get_buddy() function description (Matthew Auld)
- removed unnecessary test succeeded print
Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220222174845.2175-3-Arunpravin.PaneerSelvam@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/lib')
-rw-r--r-- | drivers/gpu/drm/lib/drm_random.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/lib/drm_random.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/lib/drm_random.c b/drivers/gpu/drm/lib/drm_random.c index eeb155826d27..31b5a3e21911 100644 --- a/drivers/gpu/drm/lib/drm_random.c +++ b/drivers/gpu/drm/lib/drm_random.c @@ -7,10 +7,11 @@ #include "drm_random.h" -static inline u32 drm_prandom_u32_max_state(u32 ep_ro, struct rnd_state *state) +u32 drm_prandom_u32_max_state(u32 ep_ro, struct rnd_state *state) { return upper_32_bits((u64)prandom_u32_state(state) * ep_ro); } +EXPORT_SYMBOL(drm_prandom_u32_max_state); void drm_random_reorder(unsigned int *order, unsigned int count, struct rnd_state *state) diff --git a/drivers/gpu/drm/lib/drm_random.h b/drivers/gpu/drm/lib/drm_random.h index 4a3e94dfa0c0..5543bf0474bc 100644 --- a/drivers/gpu/drm/lib/drm_random.h +++ b/drivers/gpu/drm/lib/drm_random.h @@ -22,5 +22,7 @@ unsigned int *drm_random_order(unsigned int count, void drm_random_reorder(unsigned int *order, unsigned int count, struct rnd_state *state); +u32 drm_prandom_u32_max_state(u32 ep_ro, + struct rnd_state *state); #endif /* !__DRM_RANDOM_H__ */ |