drivers/gpu/drm/i915/display/intel_global_state.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_global_state.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_global_state.c- Extension
.c- Size
- 10249 bytes
- Lines
- 418
- 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
linux/pci.hlinux/string.hdrm/drm_print.hintel_atomic.hintel_display_core.hintel_display_types.hintel_global_state.h
Detected Declarations
struct intel_global_objs_statestruct intel_global_commitfunction __commit_freefunction commit_putfunction __intel_atomic_global_state_freefunction intel_atomic_global_state_putfunction intel_atomic_global_state_getfunction intel_atomic_global_obj_initfunction intel_atomic_global_obj_cleanupfunction list_for_each_entry_safefunction assert_global_state_write_lockedfunction modeset_lock_is_heldfunction list_for_each_entryfunction assert_global_state_read_lockedfunction for_each_intel_crtcfunction intel_atomic_get_global_obj_statefunction intel_atomic_get_old_global_obj_statefunction intel_atomic_get_new_global_obj_statefunction intel_atomic_swap_global_statefunction for_each_oldnew_global_obj_in_statefunction intel_atomic_clear_global_statefunction intel_atomic_lock_global_statefunction for_each_intel_crtcfunction intel_atomic_serialize_global_statefunction intel_atomic_global_state_is_serializedfunction intel_atomic_global_state_setup_commitfunction for_each_oldnew_global_obj_in_statefunction intel_atomic_global_state_wait_for_dependenciesfunction for_each_old_global_obj_in_statefunction intel_atomic_global_state_commit_donefunction for_each_new_global_obj_in_state
Annotated Snippet
struct intel_global_objs_state {
struct intel_global_obj *ptr;
struct intel_global_state *state, *old_state, *new_state;
};
struct intel_global_commit {
struct kref ref;
struct completion done;
};
static struct intel_global_commit *commit_new(void)
{
struct intel_global_commit *commit;
commit = kzalloc_obj(*commit);
if (!commit)
return NULL;
init_completion(&commit->done);
kref_init(&commit->ref);
return commit;
}
static void __commit_free(struct kref *kref)
{
struct intel_global_commit *commit =
container_of(kref, typeof(*commit), ref);
kfree(commit);
}
static struct intel_global_commit *commit_get(struct intel_global_commit *commit)
{
if (commit)
kref_get(&commit->ref);
return commit;
}
static void commit_put(struct intel_global_commit *commit)
{
if (commit)
kref_put(&commit->ref, __commit_free);
}
static void __intel_atomic_global_state_free(struct kref *kref)
{
struct intel_global_state *obj_state =
container_of(kref, struct intel_global_state, ref);
struct intel_global_obj *obj = obj_state->obj;
commit_put(obj_state->commit);
obj->funcs->atomic_destroy_state(obj, obj_state);
}
static void intel_atomic_global_state_put(struct intel_global_state *obj_state)
{
kref_put(&obj_state->ref, __intel_atomic_global_state_free);
}
static struct intel_global_state *
intel_atomic_global_state_get(struct intel_global_state *obj_state)
{
kref_get(&obj_state->ref);
return obj_state;
}
void intel_atomic_global_obj_init(struct intel_display *display,
struct intel_global_obj *obj,
struct intel_global_state *state,
const struct intel_global_state_funcs *funcs)
{
memset(obj, 0, sizeof(*obj));
state->obj = obj;
kref_init(&state->ref);
obj->state = state;
obj->funcs = funcs;
list_add_tail(&obj->head, &display->global.obj_list);
}
void intel_atomic_global_obj_cleanup(struct intel_display *display)
{
struct intel_global_obj *obj, *next;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/string.h`, `drm/drm_print.h`, `intel_atomic.h`, `intel_display_core.h`, `intel_display_types.h`, `intel_global_state.h`.
- Detected declarations: `struct intel_global_objs_state`, `struct intel_global_commit`, `function __commit_free`, `function commit_put`, `function __intel_atomic_global_state_free`, `function intel_atomic_global_state_put`, `function intel_atomic_global_state_get`, `function intel_atomic_global_obj_init`, `function intel_atomic_global_obj_cleanup`, `function list_for_each_entry_safe`.
- 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.