drivers/gpu/drm/nouveau/gv100_fence.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/gv100_fence.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/gv100_fence.c- Extension
.c- Size
- 2206 bytes
- Lines
- 99
- 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
nouveau_drv.hnouveau_dma.hnouveau_fence.hnv50_display.hnvif/push906f.hnvhw/class/clc36f.h
Detected Declarations
function Copyrightfunction gv100_fence_sync32function gv100_fence_context_newfunction gv100_fence_create
Annotated Snippet
#include "nouveau_drv.h"
#include "nouveau_dma.h"
#include "nouveau_fence.h"
#include "nv50_display.h"
#include <nvif/push906f.h>
#include <nvhw/class/clc36f.h>
static int
gv100_fence_emit32(struct nouveau_channel *chan, u64 virtual, u32 sequence)
{
struct nvif_push *push = &chan->chan.push;
int ret;
ret = PUSH_WAIT(push, 13);
if (ret)
return ret;
PUSH_MTHD(push, NVC36F, SEM_ADDR_LO, lower_32_bits(virtual),
SEM_ADDR_HI, upper_32_bits(virtual),
SEM_PAYLOAD_LO, sequence);
PUSH_MTHD(push, NVC36F, SEM_EXECUTE,
NVDEF(NVC36F, SEM_EXECUTE, OPERATION, RELEASE) |
NVDEF(NVC36F, SEM_EXECUTE, RELEASE_WFI, EN) |
NVDEF(NVC36F, SEM_EXECUTE, PAYLOAD_SIZE, 32BIT) |
NVDEF(NVC36F, SEM_EXECUTE, RELEASE_TIMESTAMP, DIS));
PUSH_MTHD(push, NVC36F, MEM_OP_A, 0,
MEM_OP_B, 0,
MEM_OP_C, NVDEF(NVC36F, MEM_OP_C, MEMBAR_TYPE, SYS_MEMBAR),
MEM_OP_D, NVDEF(NVC36F, MEM_OP_D, OPERATION, MEMBAR));
PUSH_MTHD(push, NVC36F, NON_STALL_INTERRUPT, 0);
PUSH_KICK(push);
return 0;
}
static int
gv100_fence_sync32(struct nouveau_channel *chan, u64 virtual, u32 sequence)
{
struct nvif_push *push = &chan->chan.push;
int ret;
ret = PUSH_WAIT(push, 6);
if (ret)
return ret;
PUSH_MTHD(push, NVC36F, SEM_ADDR_LO, lower_32_bits(virtual),
SEM_ADDR_HI, upper_32_bits(virtual),
SEM_PAYLOAD_LO, sequence);
PUSH_MTHD(push, NVC36F, SEM_EXECUTE,
NVDEF(NVC36F, SEM_EXECUTE, OPERATION, ACQ_CIRC_GEQ) |
NVDEF(NVC36F, SEM_EXECUTE, ACQUIRE_SWITCH_TSG, EN) |
NVDEF(NVC36F, SEM_EXECUTE, PAYLOAD_SIZE, 32BIT));
PUSH_KICK(push);
return 0;
}
static int
gv100_fence_context_new(struct nouveau_channel *chan)
{
struct nv84_fence_chan *fctx;
int ret;
ret = nv84_fence_context_new(chan);
if (ret)
return ret;
fctx = chan->fence;
fctx->base.emit32 = gv100_fence_emit32;
fctx->base.sync32 = gv100_fence_sync32;
return 0;
}
int
gv100_fence_create(struct nouveau_drm *drm)
{
struct nv84_fence_priv *priv;
int ret;
ret = nv84_fence_create(drm);
if (ret)
return ret;
Annotation
- Immediate include surface: `nouveau_drv.h`, `nouveau_dma.h`, `nouveau_fence.h`, `nv50_display.h`, `nvif/push906f.h`, `nvhw/class/clc36f.h`.
- Detected declarations: `function Copyright`, `function gv100_fence_sync32`, `function gv100_fence_context_new`, `function gv100_fence_create`.
- 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.