drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c- Extension
.c- Size
- 30512 bytes
- Lines
- 1225
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/delay.hlinux/dma-mapping.hlinux/dmaengine.hlinux/errno.hlinux/init.hlinux/interrupt.hlinux/list.hlinux/mm.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/sched.hlinux/seq_file.hlinux/slab.hlinux/time.hlinux/vmalloc.hlinux/wait.hdrm/drm_print.homap_dmm_tiler.homap_dmm_priv.h
Detected Declarations
function dmm_dma_copyfunction dmm_read_wafunction dmm_write_wafunction dmm_readfunction dmm_writefunction dmm_workaround_initfunction dmm_workaround_uninitfunction wait_statusfunction release_enginefunction omap_dmm_irq_handlerfunction clearedfunction dmm_txn_commitfunction fillfunction tcm_for_each_slicefunction tiler_pinfunction tiler_unpinfunction tiler_releasefunction tiler_get_addressfunction tiler_ssptrfunction tiler_tsptrfunction tiler_alignfunction tiler_stridefunction tiler_sizefunction tiler_vsizefunction tiler_get_cpu_cache_flagsfunction dmm_is_availablefunction omap_dmm_removefunction list_for_each_entry_safefunction omap_dmm_probefunction fill_mapfunction fill_map_ptfunction read_map_ptfunction map_widthfunction text_mapfunction map_1d_infofunction map_2d_infofunction tiler_map_showfunction list_for_each_entryfunction omap_dmm_resume
Annotated Snippet
if (err) {
dev_err(dmm->dev,
"%s: error (engine%d). PAT_STATUS: 0x%08x\n",
__func__, engine->id, r);
return -EFAULT;
}
if ((r & wait_mask) == wait_mask)
break;
if (--i == 0) {
dev_err(dmm->dev,
"%s: timeout (engine%d). PAT_STATUS: 0x%08x\n",
__func__, engine->id, r);
return -ETIMEDOUT;
}
udelay(1);
}
return 0;
}
static void release_engine(struct refill_engine *engine)
{
unsigned long flags;
spin_lock_irqsave(&list_lock, flags);
list_add(&engine->idle_node, &omap_dmm->idle_head);
spin_unlock_irqrestore(&list_lock, flags);
atomic_inc(&omap_dmm->engine_counter);
wake_up_interruptible(&omap_dmm->engine_queue);
}
static irqreturn_t omap_dmm_irq_handler(int irq, void *arg)
{
struct dmm *dmm = arg;
u32 status = dmm_read(dmm, DMM_PAT_IRQSTATUS);
int i;
/* ack IRQ */
dmm_write(dmm, status, DMM_PAT_IRQSTATUS);
for (i = 0; i < dmm->num_engines; i++) {
if (status & DMM_IRQSTAT_ERR_MASK)
dev_err(dmm->dev,
"irq error(engine%d): IRQSTAT 0x%02x\n",
i, status & 0xff);
if (status & DMM_IRQSTAT_LST) {
if (dmm->engines[i].async)
release_engine(&dmm->engines[i]);
complete(&dmm->engines[i].compl);
}
status >>= 8;
}
return IRQ_HANDLED;
}
/*
* Get a handle for a DMM transaction
*/
static struct dmm_txn *dmm_txn_init(struct dmm *dmm, struct tcm *tcm)
{
struct dmm_txn *txn = NULL;
struct refill_engine *engine = NULL;
int ret;
unsigned long flags;
/* wait until an engine is available */
ret = wait_event_interruptible(omap_dmm->engine_queue,
atomic_add_unless(&omap_dmm->engine_counter, -1, 0));
if (ret)
return ERR_PTR(ret);
/* grab an idle engine */
spin_lock_irqsave(&list_lock, flags);
if (!list_empty(&dmm->idle_head)) {
engine = list_entry(dmm->idle_head.next, struct refill_engine,
idle_node);
list_del(&engine->idle_node);
}
spin_unlock_irqrestore(&list_lock, flags);
BUG_ON(!engine);
Annotation
- Immediate include surface: `linux/completion.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/dmaengine.h`, `linux/errno.h`, `linux/init.h`, `linux/interrupt.h`, `linux/list.h`.
- Detected declarations: `function dmm_dma_copy`, `function dmm_read_wa`, `function dmm_write_wa`, `function dmm_read`, `function dmm_write`, `function dmm_workaround_init`, `function dmm_workaround_uninit`, `function wait_status`, `function release_engine`, `function omap_dmm_irq_handler`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.