drivers/gpu/drm/nouveau/dispnv50/crc.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/dispnv50/crc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/dispnv50/crc.h- Extension
.h- Size
- 3977 bytes
- Lines
- 133
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.hdrm/drm_crtc.hdrm/drm_vblank_work.hnvif/mem.hnvkm/subdev/bios.hnouveau_encoder.h
Detected Declarations
struct nv50_atomstruct nv50_dispstruct nv50_headstruct nv50_crc_notifier_ctxstruct nv50_crc_atomstruct nv50_crc_funcstruct nv50_crcstruct nv50_crcstruct nv50_crc_funcstruct nv50_crc_atomenum nv50_crc_sourceenum nv50_crc_source_typefunction nv50_crc_initfunction nv50_crc_handle_vblankfunction nv50_crc_atomic_check_outp
Annotated Snippet
struct nv50_crc_notifier_ctx {
struct nvif_mem mem;
struct nvif_object ntfy;
};
struct nv50_crc_atom {
enum nv50_crc_source src;
};
struct nv50_crc_func {
int (*set_src)(struct nv50_head *, int or, enum nv50_crc_source_type type,
struct nv50_crc_notifier_ctx *ctx);
int (*set_ctx)(struct nv50_head *, struct nv50_crc_notifier_ctx *);
u32 (*get_entry)(struct nv50_head *, struct nv50_crc_notifier_ctx *,
enum nv50_crc_source, int idx);
bool (*ctx_finished)(struct nv50_head *,
struct nv50_crc_notifier_ctx *);
short flip_threshold;
short num_entries;
size_t notifier_len;
};
struct nv50_crc {
spinlock_t lock;
struct nv50_crc_notifier_ctx ctx[2];
struct drm_vblank_work flip_work;
enum nv50_crc_source src;
u64 frame;
short entry_idx;
short flip_threshold;
u8 ctx_idx : 1;
bool ctx_changed : 1;
};
void nv50_crc_init(struct drm_device *dev);
int nv50_head_crc_late_register(struct nv50_head *);
void nv50_crc_handle_vblank(struct nv50_head *head);
int nv50_crc_verify_source(struct drm_crtc *, const char *, size_t *);
const char *const *nv50_crc_get_sources(struct drm_crtc *, size_t *);
int nv50_crc_set_source(struct drm_crtc *, const char *);
int nv50_crc_atomic_check_head(struct nv50_head *, struct nv50_head_atom *,
struct nv50_head_atom *);
void nv50_crc_atomic_check_outp(struct nv50_atom *atom);
void nv50_crc_atomic_stop_reporting(struct drm_atomic_commit *);
void nv50_crc_atomic_init_notifier_contexts(struct drm_atomic_commit *);
void nv50_crc_atomic_release_notifier_contexts(struct drm_atomic_commit *);
void nv50_crc_atomic_start_reporting(struct drm_atomic_commit *);
void nv50_crc_atomic_set(struct nv50_head *, struct nv50_head_atom *);
void nv50_crc_atomic_clr(struct nv50_head *);
extern const struct nv50_crc_func crc907d;
extern const struct nv50_crc_func crcc37d;
extern const struct nv50_crc_func crcc57d;
extern const struct nv50_crc_func crcca7d;
#else /* IS_ENABLED(CONFIG_DEBUG_FS) */
struct nv50_crc {};
struct nv50_crc_func {};
struct nv50_crc_atom {};
#define nv50_crc_verify_source NULL
#define nv50_crc_get_sources NULL
#define nv50_crc_set_source NULL
static inline void nv50_crc_init(struct drm_device *dev) {}
static inline int
nv50_head_crc_late_register(struct nv50_head *head) { return 0; }
static inline void nv50_crc_handle_vblank(struct nv50_head *head) {}
static inline int
nv50_crc_atomic_check_head(struct nv50_head *head,
struct nv50_head_atom *asyh,
struct nv50_head_atom *armh) { return 0; }
static inline void nv50_crc_atomic_check_outp(struct nv50_atom *atom) {}
static inline void
nv50_crc_atomic_stop_reporting(struct drm_atomic_commit *state) {}
static inline void
nv50_crc_atomic_init_notifier_contexts(struct drm_atomic_commit *state) {}
static inline void
nv50_crc_atomic_release_notifier_contexts(struct drm_atomic_commit *state) {}
static inline void
nv50_crc_atomic_start_reporting(struct drm_atomic_commit *state) {}
static inline void
nv50_crc_atomic_set(struct nv50_head *head, struct nv50_head_atom *state) {}
static inline void
nv50_crc_atomic_clr(struct nv50_head *head) {}
Annotation
- Immediate include surface: `linux/mutex.h`, `drm/drm_crtc.h`, `drm/drm_vblank_work.h`, `nvif/mem.h`, `nvkm/subdev/bios.h`, `nouveau_encoder.h`.
- Detected declarations: `struct nv50_atom`, `struct nv50_disp`, `struct nv50_head`, `struct nv50_crc_notifier_ctx`, `struct nv50_crc_atom`, `struct nv50_crc_func`, `struct nv50_crc`, `struct nv50_crc`, `struct nv50_crc_func`, `struct nv50_crc_atom`.
- 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.