drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c- Extension
.c- Size
- 44371 bytes
- Lines
- 1679
- 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.
- 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
dcn302/dcn302_init.hdcn302_resource.hdcn302/dcn302_dccg.hirq/dcn302/irq_service_dcn302.hdcn30/dcn30_dio_link_encoder.hdcn30/dcn30_dio_stream_encoder.hdcn30/dcn30_dwb.hdcn30/dcn30_dpp.hdcn30/dcn30_hpo_frl_link_encoder.hdcn30/dcn30_hpo_frl_stream_encoder.hdcn30/dcn30_hubbub.hdcn30/dcn30_hubp.hdcn30/dcn30_mmhubbub.hdcn30/dcn30_mpc.hdcn30/dcn30_opp.hdcn30/dcn30_optc.hdcn30/dcn30_resource.hdcn20/dcn20_dsc.hdcn20/dcn20_resource.hdml/dcn30/dcn30_fpu.hdcn10/dcn10_resource.hdio/dcn10/dcn10_dio.hlink_service.hdce/dce_abm.hdce/dce_audio.hdce/dce_aux.hdce/dce_clock_source.hdce/dce_hwseq.hdce/dce_i2c_hw.hdce/dce_panel_cntl.hdce/dmub_abm.hdce/dmub_psr.h
Detected Declarations
enum dcn302_clk_src_array_idfunction dcn302_dwbc_createfunction dcn302_mmhubbub_createfunction read_dce_strapsfunction is_soc_bounding_box_validfunction init_soc_bounding_boxfunction dcn302_resource_destructfunction dcn302_destroy_resource_poolfunction dcn302_update_bw_bounding_boxfunction dcn302_get_panel_config_defaultsfunction dcn302_resource_construct
Annotated Snippet
if (!dwbc30) {
dm_error("DC: failed to create dwbc30!\n");
return false;
}
dcn30_dwbc_construct(dwbc30, ctx, &dwbc30_regs[i], &dwbc30_shift, &dwbc30_mask, i);
pool->dwbc[i] = &dwbc30->base;
}
return true;
}
#define mcif_wb_regs_dcn3(id)\
[id] = { MCIF_WB_COMMON_REG_LIST_DCN30(id) }
static const struct dcn30_mmhubbub_registers mcif_wb30_regs[] = {
mcif_wb_regs_dcn3(0)
};
static const struct dcn30_mmhubbub_shift mcif_wb30_shift = {
MCIF_WB_COMMON_MASK_SH_LIST_DCN30(__SHIFT)
};
static const struct dcn30_mmhubbub_mask mcif_wb30_mask = {
MCIF_WB_COMMON_MASK_SH_LIST_DCN30(_MASK)
};
static bool dcn302_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool)
{
unsigned int i;
uint32_t pipe_count = pool->res_cap->num_dwb;
for (i = 0; i < pipe_count; i++) {
struct dcn30_mmhubbub *mcif_wb30 = kzalloc_obj(struct dcn30_mmhubbub);
if (!mcif_wb30) {
dm_error("DC: failed to create mcif_wb30!\n");
return false;
}
dcn30_mmhubbub_construct(mcif_wb30, ctx, &mcif_wb30_regs[i], &mcif_wb30_shift, &mcif_wb30_mask, i);
pool->mcif_wb[i] = &mcif_wb30->base;
}
return true;
}
#define aux_engine_regs(id)\
[id] = {\
AUX_COMMON_REG_LIST0(id), \
.AUXN_IMPCAL = 0, \
.AUXP_IMPCAL = 0, \
.AUX_RESET_MASK = DP_AUX0_AUX_CONTROL__AUX_RESET_MASK, \
}
static const struct dce110_aux_registers aux_engine_regs[] = {
aux_engine_regs(0),
aux_engine_regs(1),
aux_engine_regs(2),
aux_engine_regs(3),
aux_engine_regs(4)
};
static const struct dce110_aux_registers_shift aux_shift = {
DCN_AUX_MASK_SH_LIST(__SHIFT)
};
static const struct dce110_aux_registers_mask aux_mask = {
DCN_AUX_MASK_SH_LIST(_MASK)
};
static struct dce_aux *dcn302_aux_engine_create(struct dc_context *ctx, uint32_t inst)
{
struct aux_engine_dce110 *aux_engine = kzalloc_obj(struct aux_engine_dce110);
if (!aux_engine)
return NULL;
dce110_aux_engine_construct(aux_engine, ctx, inst, SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD,
&aux_engine_regs[inst], &aux_mask, &aux_shift, ctx->dc->caps.extended_aux_timeout_support);
return &aux_engine->base;
}
#define i2c_inst_regs(id) { I2C_HW_ENGINE_COMMON_REG_LIST(id) }
static const struct dce_i2c_registers i2c_hw_regs[] = {
i2c_inst_regs(1),
i2c_inst_regs(2),
i2c_inst_regs(3),
Annotation
- Immediate include surface: `dcn302/dcn302_init.h`, `dcn302_resource.h`, `dcn302/dcn302_dccg.h`, `irq/dcn302/irq_service_dcn302.h`, `dcn30/dcn30_dio_link_encoder.h`, `dcn30/dcn30_dio_stream_encoder.h`, `dcn30/dcn30_dwb.h`, `dcn30/dcn30_dpp.h`.
- Detected declarations: `enum dcn302_clk_src_array_id`, `function dcn302_dwbc_create`, `function dcn302_mmhubbub_create`, `function read_dce_straps`, `function is_soc_bounding_box_valid`, `function init_soc_bounding_box`, `function dcn302_resource_destruct`, `function dcn302_destroy_resource_pool`, `function dcn302_update_bw_bounding_box`, `function dcn302_get_panel_config_defaults`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.