drivers/gpu/drm/xe/xe_sleep.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_sleep.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_sleep.h- Extension
.h- Size
- 1311 bytes
- Lines
- 58
- 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.
Dependency Surface
linux/delay.hlinux/math64.h
Detected Declarations
function xe_sleep_relaxed_msfunction xe_sleep_exponential_ms
Annotated Snippet
#ifndef _XE_SLEEP_H_
#define _XE_SLEEP_H_
#include <linux/delay.h>
#include <linux/math64.h>
/**
* xe_sleep_relaxed_ms() - Sleep for an approximate time.
* @delay_ms: time in msec to sleep
*
* For smaller timeouts, sleep with 0.5ms accuracy.
*/
static inline void xe_sleep_relaxed_ms(unsigned int delay_ms)
{
unsigned long min_us, max_us;
if (!delay_ms)
return;
if (delay_ms > 20) {
msleep(delay_ms);
return;
}
min_us = mul_u32_u32(delay_ms, 1000);
max_us = min_us + 500;
usleep_range(min_us, max_us);
}
/**
* xe_sleep_exponential_ms() - Sleep for a exponentially increased time.
* @sleep_period_ms: current time in msec to sleep
* @max_sleep_ms: maximum time in msec to sleep
*
* Sleep for the @sleep_period_ms and exponentially increase this time for the
* next loop, unless reaching the @max_sleep_ms limit.
*
* Return: approximate time in msec the task was delayed.
*/
static inline unsigned int xe_sleep_exponential_ms(unsigned int *sleep_period_ms,
unsigned int max_sleep_ms)
{
unsigned int delay_ms = *sleep_period_ms;
unsigned int next_delay_ms = 2 * delay_ms;
xe_sleep_relaxed_ms(delay_ms);
*sleep_period_ms = min(next_delay_ms, max_sleep_ms);
return delay_ms;
}
#endif
Annotation
- Immediate include surface: `linux/delay.h`, `linux/math64.h`.
- Detected declarations: `function xe_sleep_relaxed_ms`, `function xe_sleep_exponential_ms`.
- 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.