drivers/gpu/drm/lima/lima_device.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/lima/lima_device.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/lima/lima_device.h- Extension
.h- Size
- 2608 bytes
- Lines
- 147
- 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
drm/drm_device.hlinux/delay.hlinux/list.hlinux/mutex.hlima_sched.hlima_dump.hlima_devfreq.h
Detected Declarations
struct lima_devicestruct lima_ipstruct lima_deviceenum lima_gpu_idenum lima_ip_idenum lima_pipe_idfunction to_lima_devfunction lima_poll_timeout
Annotated Snippet
struct lima_ip {
struct lima_device *dev;
enum lima_ip_id id;
bool present;
void __iomem *iomem;
int irq;
union {
/* gp/pp */
bool async_reset;
/* l2 cache */
spinlock_t lock;
/* pmu/bcast */
u32 mask;
} data;
};
enum lima_pipe_id {
lima_pipe_gp,
lima_pipe_pp,
lima_pipe_num,
};
struct lima_device {
struct device *dev;
struct drm_device *ddev;
enum lima_gpu_id id;
u32 gp_version;
u32 pp_version;
int num_pp;
void __iomem *iomem;
struct clk *clk_bus;
struct clk *clk_gpu;
struct reset_control *reset;
struct regulator *regulator;
struct lima_ip ip[lima_ip_num];
struct lima_sched_pipe pipe[lima_pipe_num];
struct lima_vm *empty_vm;
uint64_t va_start;
uint64_t va_end;
u32 *dlbu_cpu;
dma_addr_t dlbu_dma;
struct lima_devfreq devfreq;
/* debug info */
struct lima_dump_head dump;
struct list_head error_task_list;
struct mutex error_task_list_lock;
};
static inline struct lima_device *
to_lima_dev(struct drm_device *dev)
{
return dev->dev_private;
}
int lima_device_init(struct lima_device *ldev);
void lima_device_fini(struct lima_device *ldev);
const char *lima_ip_name(struct lima_ip *ip);
typedef int (*lima_poll_func_t)(struct lima_ip *);
static inline int lima_poll_timeout(struct lima_ip *ip, lima_poll_func_t func,
int sleep_us, int timeout_us)
{
ktime_t timeout = ktime_add_us(ktime_get(), timeout_us);
might_sleep_if(sleep_us);
while (1) {
if (func(ip))
return 0;
if (timeout_us && ktime_compare(ktime_get(), timeout) > 0)
return -ETIMEDOUT;
if (sleep_us)
usleep_range((sleep_us >> 2) + 1, sleep_us);
}
return 0;
}
int lima_device_suspend(struct device *dev);
Annotation
- Immediate include surface: `drm/drm_device.h`, `linux/delay.h`, `linux/list.h`, `linux/mutex.h`, `lima_sched.h`, `lima_dump.h`, `lima_devfreq.h`.
- Detected declarations: `struct lima_device`, `struct lima_ip`, `struct lima_device`, `enum lima_gpu_id`, `enum lima_ip_id`, `enum lima_pipe_id`, `function to_lima_dev`, `function lima_poll_timeout`.
- 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.