drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c- Extension
.c- Size
- 4028 bytes
- Lines
- 148
- 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.
- 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
priv.hcore/memory.h
Detected Declarations
function filesfunction nvkm_ltc_zbc_color_getfunction nvkm_ltc_zbc_depth_getfunction nvkm_ltc_zbc_stencil_getfunction nvkm_ltc_invalidatefunction nvkm_ltc_flushfunction nvkm_ltc_intrfunction nvkm_ltc_oneinitfunction nvkm_ltc_initfunction nvkm_ltc_dtorfunction nvkm_ltc_new_
Annotated Snippet
#include "priv.h"
#include <core/memory.h>
void
nvkm_ltc_tags_clear(struct nvkm_device *device, u32 first, u32 count)
{
struct nvkm_ltc *ltc = device->ltc;
const u32 limit = first + count - 1;
BUG_ON((first > limit) || (limit >= ltc->num_tags));
mutex_lock(<c->mutex);
ltc->func->cbc_clear(ltc, first, limit);
ltc->func->cbc_wait(ltc);
mutex_unlock(<c->mutex);
}
int
nvkm_ltc_zbc_color_get(struct nvkm_ltc *ltc, int index, const u32 color[4])
{
memcpy(ltc->zbc_color[index], color, sizeof(ltc->zbc_color[index]));
ltc->func->zbc_clear_color(ltc, index, color);
return index;
}
int
nvkm_ltc_zbc_depth_get(struct nvkm_ltc *ltc, int index, const u32 depth)
{
ltc->zbc_depth[index] = depth;
ltc->func->zbc_clear_depth(ltc, index, depth);
return index;
}
int
nvkm_ltc_zbc_stencil_get(struct nvkm_ltc *ltc, int index, const u32 stencil)
{
ltc->zbc_stencil[index] = stencil;
ltc->func->zbc_clear_stencil(ltc, index, stencil);
return index;
}
void
nvkm_ltc_invalidate(struct nvkm_ltc *ltc)
{
if (ltc->func->invalidate)
ltc->func->invalidate(ltc);
}
void
nvkm_ltc_flush(struct nvkm_ltc *ltc)
{
if (ltc->func->flush)
ltc->func->flush(ltc);
}
static void
nvkm_ltc_intr(struct nvkm_subdev *subdev)
{
struct nvkm_ltc *ltc = nvkm_ltc(subdev);
ltc->func->intr(ltc);
}
static int
nvkm_ltc_oneinit(struct nvkm_subdev *subdev)
{
struct nvkm_ltc *ltc = nvkm_ltc(subdev);
return ltc->func->oneinit(ltc);
}
static int
nvkm_ltc_init(struct nvkm_subdev *subdev)
{
struct nvkm_ltc *ltc = nvkm_ltc(subdev);
int i;
for (i = ltc->zbc_color_min; i <= ltc->zbc_color_max; i++)
ltc->func->zbc_clear_color(ltc, i, ltc->zbc_color[i]);
for (i = ltc->zbc_depth_min; i <= ltc->zbc_depth_max; i++) {
ltc->func->zbc_clear_depth(ltc, i, ltc->zbc_depth[i]);
if (ltc->func->zbc_clear_stencil)
ltc->func->zbc_clear_stencil(ltc, i, ltc->zbc_stencil[i]);
}
ltc->func->init(ltc);
return 0;
}
static void *
Annotation
- Immediate include surface: `priv.h`, `core/memory.h`.
- Detected declarations: `function files`, `function nvkm_ltc_zbc_color_get`, `function nvkm_ltc_zbc_depth_get`, `function nvkm_ltc_zbc_stencil_get`, `function nvkm_ltc_invalidate`, `function nvkm_ltc_flush`, `function nvkm_ltc_intr`, `function nvkm_ltc_oneinit`, `function nvkm_ltc_init`, `function nvkm_ltc_dtor`.
- 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.
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.