drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c- Extension
.c- Size
- 38953 bytes
- Lines
- 1446
- 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
dm_services.hlink_encoder.hstream_encoder.hresource.hinclude/irq_service_interface.hdce110/dce110_resource.hdce110/dce110_timing_generator.hirq/dce110/irq_service_dce110.hdce/dce_mem_input.hdce/dce_transform.hdce/dce_link_encoder.hdce/dce_stream_encoder.hdce/dce_audio.hdce/dce_opp.hdce/dce_ipp.hdce/dce_clock_source.hdce/dce_hwseq.hdce112/dce112_hwseq.hdce/dce_abm.hdce/dce_dmcu.hdce/dce_aux.hdce/dce_i2c.hdce/dce_panel_cntl.hreg_helper.hdce/dce_11_2_d.hdce/dce_11_2_sh_mask.hdce100/dce100_resource.hdce112_resource.h
Detected Declarations
enum dce112_clk_src_array_idfunction map_transmitter_id_to_phy_instancefunction read_dce_strapsfunction dce112_transform_destroyfunction dce112_clock_source_destroyfunction dce112_resource_destructfunction build_mapped_resourcefunction dce112_validate_bandwidthfunction resource_map_phy_clock_resourcesfunction dce112_validate_surface_setsfunction dce112_add_stream_to_ctxfunction dce112_validate_globalfunction dce112_destroy_resource_poolfunction bw_calcs_data_update_from_pplibfunction dce112_resource_construct
Annotated Snippet
if (pool->base.mis[i] != NULL) {
kfree(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL;
}
if (pool->base.timing_generators[i] != NULL) {
kfree(DCE110TG_FROM_TG(pool->base.timing_generators[i]));
pool->base.timing_generators[i] = NULL;
}
}
for (i = 0; i < (unsigned int)pool->base.res_cap->num_ddc; i++) {
if (pool->base.engines[i] != NULL)
dce110_engine_destroy(&pool->base.engines[i]);
if (pool->base.hw_i2cs[i] != NULL) {
kfree(pool->base.hw_i2cs[i]);
pool->base.hw_i2cs[i] = NULL;
}
if (pool->base.sw_i2cs[i] != NULL) {
kfree(pool->base.sw_i2cs[i]);
pool->base.sw_i2cs[i] = NULL;
}
}
for (i = 0; i < pool->base.stream_enc_count; i++) {
if (pool->base.stream_enc[i] != NULL)
kfree(DCE110STRENC_FROM_STRENC(pool->base.stream_enc[i]));
}
for (i = 0; i < pool->base.clk_src_count; i++) {
if (pool->base.clock_sources[i] != NULL) {
dce112_clock_source_destroy(&pool->base.clock_sources[i]);
}
}
if (pool->base.dp_clock_source != NULL)
dce112_clock_source_destroy(&pool->base.dp_clock_source);
for (i = 0; i < pool->base.audio_count; i++) {
if (pool->base.audios[i] != NULL) {
dce_aud_destroy(&pool->base.audios[i]);
}
}
if (pool->base.abm != NULL)
dce_abm_destroy(&pool->base.abm);
if (pool->base.dmcu != NULL)
dce_dmcu_destroy(&pool->base.dmcu);
if (pool->base.irqs != NULL) {
dal_irq_service_destroy(&pool->base.irqs);
}
}
static struct clock_source *find_matching_pll(
struct resource_context *res_ctx,
const struct resource_pool *pool,
const struct dc_stream_state *const stream)
{
(void)res_ctx;
switch (stream->link->link_enc->transmitter) {
case TRANSMITTER_UNIPHY_A:
return pool->clock_sources[DCE112_CLK_SRC_PLL0];
case TRANSMITTER_UNIPHY_B:
return pool->clock_sources[DCE112_CLK_SRC_PLL1];
case TRANSMITTER_UNIPHY_C:
return pool->clock_sources[DCE112_CLK_SRC_PLL2];
case TRANSMITTER_UNIPHY_D:
return pool->clock_sources[DCE112_CLK_SRC_PLL3];
case TRANSMITTER_UNIPHY_E:
return pool->clock_sources[DCE112_CLK_SRC_PLL4];
case TRANSMITTER_UNIPHY_F:
return pool->clock_sources[DCE112_CLK_SRC_PLL5];
default:
return NULL;
}
}
static enum dc_status build_mapped_resource(
const struct dc *dc,
struct dc_state *context,
struct dc_stream_state *stream)
{
(void)dc;
struct pipe_ctx *pipe_ctx = resource_get_otg_master_for_stream(&context->res_ctx, stream);
if (!pipe_ctx)
return DC_ERROR_UNEXPECTED;
Annotation
- Immediate include surface: `dm_services.h`, `link_encoder.h`, `stream_encoder.h`, `resource.h`, `include/irq_service_interface.h`, `dce110/dce110_resource.h`, `dce110/dce110_timing_generator.h`, `irq/dce110/irq_service_dce110.h`.
- Detected declarations: `enum dce112_clk_src_array_id`, `function map_transmitter_id_to_phy_instance`, `function read_dce_straps`, `function dce112_transform_destroy`, `function dce112_clock_source_destroy`, `function dce112_resource_destruct`, `function build_mapped_resource`, `function dce112_validate_bandwidth`, `function resource_map_phy_clock_resources`, `function dce112_validate_surface_sets`.
- 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.