drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c- Extension
.c- Size
- 435554 bytes
- Lines
- 14117
- 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.hlink_enc_cfg.hdc/inc/core_types.hdal_asic_id.hdmub/dmub_srv.hdc/inc/hw/dmcu.hdc/inc/hw/abm.hdc/dc_dmub_srv.hdc/dc_edid_parser.hdc/dc_stat.hdc/dc_state.hamdgpu_dm_trace.hlink/protocols/link_dpcd.hlink_service_types.hlink/protocols/link_dp_capability.hlink/protocols/link_ddc.hamdgpu.hamdgpu_display.hamdgpu_ucode.hatom.hamdgpu_dm.hamdgpu_dm_plane.hamdgpu_dm_crtc.hamdgpu_dm_hdcp.hdrm/display/drm_hdcp_helper.hamdgpu_dm_wb.hamdgpu_atombios.hamd_shared.hamdgpu_dm_irq.hdm_helpers.hamdgpu_dm_mst_types.h
Detected Declarations
struct amdgpu_stutter_quirkfunction get_subconnector_typefunction update_subconnector_propertyfunction dm_vblank_get_counterfunction dm_crtc_get_scanoutposfunction dm_is_idlefunction dm_wait_for_idlefunction dm_check_soft_resetfunction dm_soft_resetfunction get_crtc_by_otg_instfunction list_for_each_entryfunction is_dc_timing_adjust_neededfunction dm_plane_layer_index_cmpfunction update_planes_and_stream_adapterfunction dm_pflip_high_irqfunction dm_handle_vmin_vmax_updatefunction schedule_dc_vmin_vmaxfunction dm_vupdate_high_irqfunction dm_crtc_high_irqfunction dm_dcn_vertical_interrupt0_high_irqfunction dmub_aux_setconfig_callbackfunction dmub_aux_fused_io_callbackfunction dmub_hpd_callbackfunction dmub_hpd_sense_callbackfunction register_dmub_notify_callbackfunction dm_handle_hpd_workfunction dm_dmub_outbox1_low_irqfunction dm_set_clockgating_statefunction dm_set_powergating_statefunction amdgpu_dm_fbc_initfunction list_for_each_entryfunction amdgpu_dm_audio_component_get_eldfunction amdgpu_dm_audio_component_bindfunction amdgpu_dm_audio_component_unbindfunction amdgpu_dm_audio_initfunction amdgpu_dm_audio_finifunction amdgpu_dm_audio_eld_notifyfunction dm_dmub_hw_initfunction dm_dmub_hw_resumefunction mmhub_read_system_contextfunction force_connector_statefunction dm_handle_hpd_rx_offload_workfunction dc_link_check_link_loss_statusfunction dm_should_disable_stutterfunction dm_allocate_gpu_memfunction dm_free_gpu_memfunction dm_dmub_send_vbios_gpint_commandfunction dm_get_default_ips_mode
Annotated Snippet
struct amdgpu_stutter_quirk {
u16 chip_vendor;
u16 chip_device;
u16 subsys_vendor;
u16 subsys_device;
u8 revision;
};
static const struct amdgpu_stutter_quirk amdgpu_stutter_quirk_list[] = {
/* https://bugzilla.kernel.org/show_bug.cgi?id=214417 */
{ 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
{ 0, 0, 0, 0, 0 },
};
static bool dm_should_disable_stutter(struct pci_dev *pdev)
{
const struct amdgpu_stutter_quirk *p = amdgpu_stutter_quirk_list;
while (p && p->chip_device != 0) {
if (pdev->vendor == p->chip_vendor &&
pdev->device == p->chip_device &&
pdev->subsystem_vendor == p->subsys_vendor &&
pdev->subsystem_device == p->subsys_device &&
pdev->revision == p->revision) {
return true;
}
++p;
}
return false;
}
void*
dm_allocate_gpu_mem(
struct amdgpu_device *adev,
enum dc_gpu_mem_alloc_type type,
size_t size,
long long *addr)
{
struct dal_allocation *da;
u32 domain = (type == DC_MEM_ALLOC_TYPE_GART) ?
AMDGPU_GEM_DOMAIN_GTT : AMDGPU_GEM_DOMAIN_VRAM;
int ret;
da = kzalloc_obj(struct dal_allocation);
if (!da)
return NULL;
ret = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE,
domain, &da->bo,
&da->gpu_addr, &da->cpu_ptr);
*addr = da->gpu_addr;
if (ret) {
kfree(da);
return NULL;
}
/* add da to list in dm */
list_add(&da->list, &adev->dm.da_list);
return da->cpu_ptr;
}
void
dm_free_gpu_mem(
struct amdgpu_device *adev,
enum dc_gpu_mem_alloc_type type,
void *pvMem)
{
struct dal_allocation *da;
/* walk the da list in DM */
list_for_each_entry(da, &adev->dm.da_list, list) {
if (pvMem == da->cpu_ptr) {
amdgpu_bo_free_kernel(&da->bo, &da->gpu_addr, &da->cpu_ptr);
list_del(&da->list);
kfree(da);
break;
}
}
}
static enum dmub_status
dm_dmub_send_vbios_gpint_command(struct amdgpu_device *adev,
enum dmub_gpint_command command_code,
uint16_t param,
uint32_t timeout_us)
Annotation
- Immediate include surface: `dm_services_types.h`, `dc.h`, `link_enc_cfg.h`, `dc/inc/core_types.h`, `dal_asic_id.h`, `dmub/dmub_srv.h`, `dc/inc/hw/dmcu.h`, `dc/inc/hw/abm.h`.
- Detected declarations: `struct amdgpu_stutter_quirk`, `function get_subconnector_type`, `function update_subconnector_property`, `function dm_vblank_get_counter`, `function dm_crtc_get_scanoutpos`, `function dm_is_idle`, `function dm_wait_for_idle`, `function dm_check_soft_reset`, `function dm_soft_reset`, `function get_crtc_by_otg_inst`.
- 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.