drivers/gpu/drm/nouveau/dispnv50/crc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/dispnv50/crc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/dispnv50/crc.c- Extension
.c- Size
- 19117 bytes
- Lines
- 751
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/string.hdrm/drm_crtc.hdrm/drm_atomic_helper.hdrm/drm_vblank.hdrm/drm_vblank_work.hnvif/class.hnvif/cl0002.hnvif/timer.hnvhw/class/cl907d.hnouveau_drv.hcore.hhead.hhandles.hcrc.h
Detected Declarations
function nv50_crc_parse_sourcefunction nv50_crc_verify_sourcefunction nv50_crc_program_ctxfunction nv50_crc_ctx_flip_workfunction nv50_crc_reset_ctxfunction nv50_crc_get_entriesfunction nv50_crc_handle_vblankfunction nv50_crc_wait_ctx_finishedfunction nv50_crc_atomic_stop_reportingfunction for_each_new_crtc_in_statefunction nv50_crc_atomic_init_notifier_contextsfunction for_each_new_crtc_in_statefunction nv50_crc_atomic_release_notifier_contextsfunction for_each_new_crtc_in_statefunction nv50_crc_atomic_start_reportingfunction for_each_new_crtc_in_statefunction nv50_crc_atomic_check_headfunction nv50_crc_atomic_check_outpfunction for_each_oldnew_crtc_in_statefunction list_for_each_entryfunction nv50_crc_source_typefunction nv50_crc_atomic_setfunction nv50_crc_atomic_clrfunction nv50_crc_raster_typefunction nv50_crc_ctx_initfunction NV50_DISP_HANDLE_CRC_CTXfunction nv50_crc_ctx_finifunction nv50_crc_set_sourcefunction nv50_crc_debugfs_flip_threshold_getfunction nv50_crc_debugfs_flip_threshold_openfunction nv50_crc_debugfs_flip_threshold_setfunction nv50_head_crc_late_registerfunction nv50_crc_init_headfunction nv50_crc_init
Annotated Snippet
static const struct file_operations nv50_crc_flip_threshold_fops = {
.owner = THIS_MODULE,
.open = nv50_crc_debugfs_flip_threshold_open,
.read = seq_read,
.write = nv50_crc_debugfs_flip_threshold_set,
.release = single_release,
};
int nv50_head_crc_late_register(struct nv50_head *head)
{
struct drm_crtc *crtc = &head->base.base;
const struct nv50_crc_func *func =
nv50_disp(crtc->dev)->core->func->crc;
struct dentry *root;
if (!func || !crtc->debugfs_entry)
return 0;
root = debugfs_create_dir("nv_crc", crtc->debugfs_entry);
debugfs_create_file("flip_threshold", 0644, root, head,
&nv50_crc_flip_threshold_fops);
return 0;
}
static inline void
nv50_crc_init_head(struct nv50_disp *disp, const struct nv50_crc_func *func,
struct nv50_head *head)
{
struct nv50_crc *crc = &head->crc;
crc->flip_threshold = func->flip_threshold;
spin_lock_init(&crc->lock);
drm_vblank_work_init(&crc->flip_work, &head->base.base,
nv50_crc_ctx_flip_work);
}
void nv50_crc_init(struct drm_device *dev)
{
struct nv50_disp *disp = nv50_disp(dev);
struct drm_crtc *crtc;
const struct nv50_crc_func *func = disp->core->func->crc;
if (!func)
return;
drm_for_each_crtc(crtc, dev)
nv50_crc_init_head(disp, func, nv50_head(crtc));
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/string.h`, `drm/drm_crtc.h`, `drm/drm_atomic_helper.h`, `drm/drm_vblank.h`, `drm/drm_vblank_work.h`, `nvif/class.h`, `nvif/cl0002.h`.
- Detected declarations: `function nv50_crc_parse_source`, `function nv50_crc_verify_source`, `function nv50_crc_program_ctx`, `function nv50_crc_ctx_flip_work`, `function nv50_crc_reset_ctx`, `function nv50_crc_get_entries`, `function nv50_crc_handle_vblank`, `function nv50_crc_wait_ctx_finished`, `function nv50_crc_atomic_stop_reporting`, `function for_each_new_crtc_in_state`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.