drivers/gpu/drm/lima/lima_bcast.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/lima/lima_bcast.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/lima/lima_bcast.c- Extension
.c- Size
- 1531 bytes
- Lines
- 75
- 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_bcast.hlima_regs.h
Detected Declarations
function lima_bcast_enablefunction lima_bcast_hw_initfunction lima_bcast_resumefunction lima_bcast_suspendfunction lima_bcast_resetfunction lima_bcast_initfunction lima_bcast_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_bcast.h"
#include "lima_regs.h"
#define bcast_write(reg, data) writel(data, ip->iomem + reg)
#define bcast_read(reg) readl(ip->iomem + reg)
void lima_bcast_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_bcast;
int i, mask = bcast_read(LIMA_BCAST_BROADCAST_MASK) & 0xffff0000;
for (i = 0; i < num_pp; i++) {
struct lima_ip *pp = pipe->processor[i];
mask |= 1 << (pp->id - lima_ip_pp0);
}
bcast_write(LIMA_BCAST_BROADCAST_MASK, mask);
}
static int lima_bcast_hw_init(struct lima_ip *ip)
{
bcast_write(LIMA_BCAST_BROADCAST_MASK, ip->data.mask << 16);
bcast_write(LIMA_BCAST_INTERRUPT_MASK, ip->data.mask);
return 0;
}
int lima_bcast_resume(struct lima_ip *ip)
{
return lima_bcast_hw_init(ip);
}
void lima_bcast_suspend(struct lima_ip *ip)
{
}
int lima_bcast_mask_irq(struct lima_ip *ip)
{
bcast_write(LIMA_BCAST_BROADCAST_MASK, 0);
bcast_write(LIMA_BCAST_INTERRUPT_MASK, 0);
return 0;
}
int lima_bcast_reset(struct lima_ip *ip)
{
return lima_bcast_hw_init(ip);
}
int lima_bcast_init(struct lima_ip *ip)
{
int i;
for (i = lima_ip_pp0; i <= lima_ip_pp7; i++) {
if (ip->dev->ip[i].present)
ip->data.mask |= 1 << (i - lima_ip_pp0);
}
return lima_bcast_hw_init(ip);
}
void lima_bcast_fini(struct lima_ip *ip)
{
}
Annotation
- Immediate include surface: `linux/io.h`, `linux/device.h`, `lima_device.h`, `lima_bcast.h`, `lima_regs.h`.
- Detected declarations: `function lima_bcast_enable`, `function lima_bcast_hw_init`, `function lima_bcast_resume`, `function lima_bcast_suspend`, `function lima_bcast_reset`, `function lima_bcast_init`, `function lima_bcast_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.