drivers/gpu/drm/i915/selftests/i915_random.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/selftests/i915_random.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/selftests/i915_random.h- Extension
.h- Size
- 2341 bytes
- Lines
- 66
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/math64.hlinux/prandom.h../i915_selftest.h
Detected Declarations
function i915_prandom_u32_max_state
Annotated Snippet
#ifndef __I915_SELFTESTS_RANDOM_H__
#define __I915_SELFTESTS_RANDOM_H__
#include <linux/math64.h>
#include <linux/prandom.h>
#include "../i915_selftest.h"
#define I915_RND_STATE_INITIALIZER(x) ({ \
struct rnd_state state__; \
prandom_seed_state(&state__, (x)); \
state__; \
})
#define I915_RND_STATE(name__) \
struct rnd_state name__ = I915_RND_STATE_INITIALIZER(i915_selftest.random_seed)
#define I915_RND_SUBSTATE(name__, parent__) \
struct rnd_state name__ = I915_RND_STATE_INITIALIZER(prandom_u32_state(&(parent__)))
u64 i915_prandom_u64_state(struct rnd_state *rnd);
static inline u32 i915_prandom_u32_max_state(u32 ep_ro, struct rnd_state *state)
{
return upper_32_bits(mul_u32_u32(prandom_u32_state(state), ep_ro));
}
unsigned int *i915_random_order(unsigned int count,
struct rnd_state *state);
void i915_random_reorder(unsigned int *order,
unsigned int count,
struct rnd_state *state);
void i915_prandom_shuffle(void *arr, size_t elsz, size_t count,
struct rnd_state *state);
u64 igt_random_offset(struct rnd_state *state,
u64 start, u64 end,
u64 len, u64 align);
#endif /* !__I915_SELFTESTS_RANDOM_H__ */
Annotation
- Immediate include surface: `linux/math64.h`, `linux/prandom.h`, `../i915_selftest.h`.
- Detected declarations: `function i915_prandom_u32_max_state`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.