drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c- Extension
.c- Size
- 29518 bytes
- Lines
- 1023
- 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
dm_services_types.hdc.hamdgpu.hamdgpu_dm.hamdgpu_dm_irq.h
Detected Declarations
struct amdgpu_dm_irq_handler_datafunction init_handler_common_datafunction dm_irq_work_funcfunction list_for_each_safefunction unregister_all_irq_handlersfunction list_for_each_safefunction list_for_each_safefunction validate_irq_registration_paramsfunction validate_irq_unregistration_paramsfunction amdgpu_dm_irq_register_interruptfunction amdgpu_dm_irq_unregister_interruptfunction amdgpu_dm_irq_initfunction amdgpu_dm_irq_finifunction amdgpu_dm_irq_suspendfunction amdgpu_dm_irq_resume_earlyfunction amdgpu_dm_irq_resume_latefunction amdgpu_dm_irq_schedule_workfunction list_for_each_entryfunction amdgpu_dm_irq_immediate_workfunction list_for_each_entryfunction amdgpu_dm_irq_handlerfunction amdgpu_dm_hpd_to_dal_irq_sourcefunction amdgpu_dm_set_hpd_irq_statefunction dm_irq_statefunction amdgpu_dm_set_pflip_irq_statefunction amdgpu_dm_set_crtc_irq_statefunction amdgpu_dm_set_vline0_irq_statefunction amdgpu_dm_set_dmub_outbox_irq_statefunction amdgpu_dm_set_vupdate_irq_statefunction amdgpu_dm_set_dmub_trace_irq_statefunction amdgpu_dm_set_irq_funcsfunction amdgpu_dm_outbox_initfunction cardfunction dc_interrupt_setfunction card
Annotated Snippet
struct amdgpu_dm_irq_handler_data {
struct list_head list;
interrupt_handler handler;
void *handler_arg;
struct amdgpu_display_manager *dm;
/* DAL irq source which registered for this interrupt. */
enum dc_irq_source irq_source;
struct work_struct work;
};
#define DM_IRQ_TABLE_LOCK(adev, flags) \
spin_lock_irqsave(&adev->dm.irq_handler_list_table_lock, flags)
#define DM_IRQ_TABLE_UNLOCK(adev, flags) \
spin_unlock_irqrestore(&adev->dm.irq_handler_list_table_lock, flags)
/******************************************************************************
* Private functions.
*****************************************************************************/
static void init_handler_common_data(struct amdgpu_dm_irq_handler_data *hcd,
void (*ih)(void *),
void *args,
struct amdgpu_display_manager *dm)
{
hcd->handler = ih;
hcd->handler_arg = args;
hcd->dm = dm;
}
/**
* dm_irq_work_func() - Handle an IRQ outside of the interrupt handler proper.
*
* @work: work struct
*/
static void dm_irq_work_func(struct work_struct *work)
{
struct amdgpu_dm_irq_handler_data *handler_data =
container_of(work, struct amdgpu_dm_irq_handler_data, work);
handler_data->handler(handler_data->handler_arg);
/* Call a DAL subcomponent which registered for interrupt notification
* at INTERRUPT_LOW_IRQ_CONTEXT.
* (The most common use is HPD interrupt)
*/
}
/*
* Remove a handler and return a pointer to handler list from which the
* handler was removed.
*/
static struct list_head *remove_irq_handler(struct amdgpu_device *adev,
void *ih,
const struct dc_interrupt_params *int_params)
{
struct list_head *hnd_list;
struct list_head *entry, *tmp;
struct amdgpu_dm_irq_handler_data *handler;
unsigned long irq_table_flags;
bool handler_removed = false;
enum dc_irq_source irq_source;
DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
irq_source = int_params->irq_source;
switch (int_params->int_context) {
case INTERRUPT_HIGH_IRQ_CONTEXT:
hnd_list = &adev->dm.irq_handler_list_high_tab[irq_source];
break;
case INTERRUPT_LOW_IRQ_CONTEXT:
default:
hnd_list = &adev->dm.irq_handler_list_low_tab[irq_source];
break;
}
list_for_each_safe(entry, tmp, hnd_list) {
handler = list_entry(entry, struct amdgpu_dm_irq_handler_data,
list);
if (handler == NULL)
continue;
if (ih == handler->handler) {
/* Found our handler. Remove it from the list. */
list_del(&handler->list);
handler_removed = true;
Annotation
- Immediate include surface: `dm_services_types.h`, `dc.h`, `amdgpu.h`, `amdgpu_dm.h`, `amdgpu_dm_irq.h`.
- Detected declarations: `struct amdgpu_dm_irq_handler_data`, `function init_handler_common_data`, `function dm_irq_work_func`, `function list_for_each_safe`, `function unregister_all_irq_handlers`, `function list_for_each_safe`, `function list_for_each_safe`, `function validate_irq_registration_params`, `function validate_irq_unregistration_params`, `function amdgpu_dm_irq_register_interrupt`.
- 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.