drivers/gpu/drm/lima/lima_dlbu.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/lima/lima_dlbu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/lima/lima_dlbu.c- Extension
.c- Size
- 1559 bytes
- Lines
- 74
- 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/io.hlinux/device.hlima_device.hlima_dlbu.hlima_vm.hlima_regs.h
Detected Declarations
function lima_dlbu_enablefunction lima_dlbu_disablefunction lima_dlbu_set_regfunction lima_dlbu_hw_initfunction lima_dlbu_resumefunction lima_dlbu_suspendfunction lima_dlbu_fini
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0 OR MIT
/* Copyright 2018-2019 Qiang Yu <yuq825@gmail.com> */
#include <linux/io.h>
#include <linux/device.h>
#include "lima_device.h"
#include "lima_dlbu.h"
#include "lima_vm.h"
#include "lima_regs.h"
#define dlbu_write(reg, data) writel(data, ip->iomem + reg)
#define dlbu_read(reg) readl(ip->iomem + reg)
void lima_dlbu_enable(struct lima_device *dev, int num_pp)
{
struct lima_sched_pipe *pipe = dev->pipe + lima_pipe_pp;
struct lima_ip *ip = dev->ip + lima_ip_dlbu;
int i, mask = 0;
for (i = 0; i < num_pp; i++) {
struct lima_ip *pp = pipe->processor[i];
mask |= 1 << (pp->id - lima_ip_pp0);
}
dlbu_write(LIMA_DLBU_PP_ENABLE_MASK, mask);
}
void lima_dlbu_disable(struct lima_device *dev)
{
struct lima_ip *ip = dev->ip + lima_ip_dlbu;
dlbu_write(LIMA_DLBU_PP_ENABLE_MASK, 0);
}
void lima_dlbu_set_reg(struct lima_ip *ip, u32 *reg)
{
dlbu_write(LIMA_DLBU_TLLIST_VBASEADDR, reg[0]);
dlbu_write(LIMA_DLBU_FB_DIM, reg[1]);
dlbu_write(LIMA_DLBU_TLLIST_CONF, reg[2]);
dlbu_write(LIMA_DLBU_START_TILE_POS, reg[3]);
}
static int lima_dlbu_hw_init(struct lima_ip *ip)
{
struct lima_device *dev = ip->dev;
dlbu_write(LIMA_DLBU_MASTER_TLLIST_PHYS_ADDR, dev->dlbu_dma | 1);
dlbu_write(LIMA_DLBU_MASTER_TLLIST_VADDR, LIMA_VA_RESERVE_DLBU);
return 0;
}
int lima_dlbu_resume(struct lima_ip *ip)
{
return lima_dlbu_hw_init(ip);
}
void lima_dlbu_suspend(struct lima_ip *ip)
{
}
int lima_dlbu_init(struct lima_ip *ip)
{
return lima_dlbu_hw_init(ip);
}
void lima_dlbu_fini(struct lima_ip *ip)
{
}
Annotation
- Immediate include surface: `linux/io.h`, `linux/device.h`, `lima_device.h`, `lima_dlbu.h`, `lima_vm.h`, `lima_regs.h`.
- Detected declarations: `function lima_dlbu_enable`, `function lima_dlbu_disable`, `function lima_dlbu_set_reg`, `function lima_dlbu_hw_init`, `function lima_dlbu_resume`, `function lima_dlbu_suspend`, `function lima_dlbu_fini`.
- 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.