drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c- Extension
.c- Size
- 31112 bytes
- Lines
- 1233
- 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.hclk_mgr.hinclude/irq_service_interface.hdio/virtual/virtual_stream_encoder.hdce110/dce110_resource.hdce110/dce110_timing_generator.hirq/dce110/irq_service_dce110.hdce/dce_link_encoder.hdce/dce_stream_encoder.hdce/dce_mem_input.hdce/dce_ipp.hdce/dce_transform.hdce/dce_opp.hdce/dce_clock_source.hdce/dce_audio.hdce/dce_hwseq.hdce100/dce100_hwseq.hdce/dce_panel_cntl.hreg_helper.hdce/dce_10_0_d.hdce/dce_10_0_sh_mask.hdce/dce_dmcu.hdce/dce_aux.hdce/dce_abm.hdce/dce_i2c.hdce100_resource.hgmc/gmc_8_2_d.hgmc/gmc_8_2_sh_mask.h
Detected Declarations
function map_transmitter_id_to_phy_instancefunction read_dce_strapsfunction dce100_transform_destroyfunction dce100_clock_source_destroyfunction dce100_resource_destructfunction build_mapped_resourcefunction dce100_validate_bandwidthfunction dce100_validate_surface_setsfunction dce100_validate_globalfunction dce100_add_stream_to_ctxfunction dce100_destroy_resource_poolfunction dce100_validate_planefunction dce100_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)
dce100_clock_source_destroy(&pool->base.clock_sources[i]);
}
if (pool->base.dp_clock_source != NULL)
dce100_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 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;
dce110_resource_build_pipe_hw_param(pipe_ctx);
resource_build_info_frame(pipe_ctx);
return DC_OK;
}
enum dc_status dce100_validate_bandwidth(
struct dc *dc,
struct dc_state *context,
enum dc_validate_mode validate_mode)
{
(void)validate_mode;
unsigned int i;
bool at_least_one_pipe = false;
struct dc_stream_state *stream = NULL;
const uint32_t max_pix_clk_khz = max(dc->clk_mgr->clks.max_supported_dispclk_khz, 400000);
for (i = 0; i < dc->res_pool->pipe_count; i++) {
stream = context->res_ctx.pipe_ctx[i].stream;
if (stream) {
at_least_one_pipe = true;
if (stream->timing.pix_clk_100hz >= max_pix_clk_khz * 10)
return DC_FAIL_BANDWIDTH_VALIDATE;
}
}
Annotation
- Immediate include surface: `dm_services.h`, `link_encoder.h`, `stream_encoder.h`, `resource.h`, `clk_mgr.h`, `include/irq_service_interface.h`, `dio/virtual/virtual_stream_encoder.h`, `dce110/dce110_resource.h`.
- Detected declarations: `function map_transmitter_id_to_phy_instance`, `function read_dce_straps`, `function dce100_transform_destroy`, `function dce100_clock_source_destroy`, `function dce100_resource_destruct`, `function build_mapped_resource`, `function dce100_validate_bandwidth`, `function dce100_validate_surface_sets`, `function dce100_validate_global`, `function dce100_add_stream_to_ctx`.
- 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.