drivers/gpu/drm/amd/display/dc/core/dc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/core/dc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/core/dc.c- Extension
.c- Size
- 266686 bytes
- Lines
- 8233
- 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.hamdgpu.hdc.hcore_status.hcore_types.hhw_sequencer.hdce/dce_hwseq.hhw/dccg.hresource.hdc_state.hdc_state_priv.hdc_plane.hdc_plane_priv.hdc_stream_priv.hgpio_service_interface.hclk_mgr.hclock_source.hdc_bios_types.hbios_parser_interface.hbios/bios_parser_helper.hinclude/irq_service_interface.htransform.hdmcu.hdpp.htiming_generator.habm.hdio/virtual/virtual_link_encoder.hhubp.hlink_hwss.hlink_encoder.hlink_enc_cfg.hlink_service.h
Detected Declarations
struct pipe_split_policy_backupstruct dc_update_scratch_spaceenum update_v3_flowfunction sinksfunction destroy_linksfunction get_num_of_internal_dispfunction get_seamless_boot_stream_countfunction create_linksfunction create_link_encodersfunction create_link_encodersfunction dc_perf_trace_destroyfunction set_long_vtotalfunction dc_stream_get_last_used_drr_vtotalfunction dc_stream_forward_dmub_crc_windowfunction dc_stream_forward_dmcu_crc_windowfunction dc_stream_forward_crc_windowfunction dc_stream_forward_dmub_multiple_crc_windowfunction dc_stream_forward_multiple_crc_windowfunction dc_stream_configure_crcfunction dc_stream_get_crcfunction dc_stream_set_dyn_expansionfunction dc_stream_set_dither_optionfunction dc_stream_set_gamut_remapfunction dc_stream_program_csc_matrixfunction dc_stream_set_static_screen_paramsfunction dc_destructfunction dc_construct_ctxfunction dc_constructfunction disable_all_writeback_pipes_for_streamfunction apply_ctx_interdependent_lockfunction dc_update_visual_confirm_colorfunction dc_get_visual_confirm_for_streamfunction dc_stream_adjust_vmin_vmaxfunction disable_dangling_planefunction disable_vbios_mode_if_requiredfunction detect_edp_presencefunction dc_hardware_initfunction dc_init_callbacksfunction dc_deinit_callbacksfunction dc_destroyfunction enable_timing_multisyncfunction program_timing_syncfunction streams_changedfunction dc_validate_boot_timingfunction should_update_pipe_for_streamfunction should_update_pipe_for_planefunction dc_enable_stereofunction dc_trigger_sync
Annotated Snippet
struct pipe_split_policy_backup {
bool dynamic_odm_policy;
bool subvp_policy;
enum pipe_split_policy mpc_policy;
char force_odm[MAX_PIPES];
};
static void backup_and_set_minimal_pipe_split_policy(struct dc *dc,
struct dc_state *context,
struct pipe_split_policy_backup *policy)
{
int i;
if (!dc->config.is_vmin_only_asic) {
policy->mpc_policy = dc->debug.pipe_split_policy;
dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
}
policy->dynamic_odm_policy = dc->debug.enable_single_display_2to1_odm_policy;
dc->debug.enable_single_display_2to1_odm_policy = false;
policy->subvp_policy = dc->debug.force_disable_subvp;
dc->debug.force_disable_subvp = true;
for (i = 0; i < context->stream_count; i++) {
policy->force_odm[i] = context->streams[i]->debug.force_odm_combine_segments;
if (context->streams[i]->debug.allow_transition_for_forced_odm)
context->streams[i]->debug.force_odm_combine_segments = 0;
}
}
static void restore_minimal_pipe_split_policy(struct dc *dc,
struct dc_state *context,
struct pipe_split_policy_backup *policy)
{
uint8_t i;
if (!dc->config.is_vmin_only_asic)
dc->debug.pipe_split_policy = policy->mpc_policy;
dc->debug.enable_single_display_2to1_odm_policy =
policy->dynamic_odm_policy;
dc->debug.force_disable_subvp = policy->subvp_policy;
for (i = 0; i < context->stream_count; i++)
context->streams[i]->debug.force_odm_combine_segments = policy->force_odm[i];
}
/**
* update_planes_and_stream_state() - The function takes planes and stream
* updates as inputs and determines the appropriate update type. If update type
* is FULL, the function allocates a new context, populates and validates it.
* Otherwise, it updates current dc context. The function will return both
* new_context and new_update_type back to the caller. The function also backs
* up both current and new contexts into corresponding dc state scratch memory.
* TODO: The function does too many things, and even conditionally allocates dc
* context memory implicitly. We should consider to break it down.
*
* @dc: Current DC state
* @srf_updates: an array of surface updates
* @surface_count: surface update count
* @stream: Corresponding stream to be updated
* @stream_update: stream update
* @update_descriptor: describes what plane and stream changes to apply
* @new_update_type: [out] determined update type by the function
* @new_context: [out] new context allocated and validated if update type is
* FULL, reference to current context if update type is less than FULL.
*
* Return: true if a valid update is populated into new_context, false
* otherwise.
*/
static bool update_planes_and_stream_state(struct dc *dc,
struct dc_surface_update *srf_updates, int surface_count,
struct dc_stream_state *stream,
struct dc_stream_update *stream_update,
enum surface_update_type *new_update_type,
struct dc_state **new_context)
{
struct dc_state *context;
int i;
unsigned int j;
enum surface_update_type update_type;
const struct dc_stream_status *stream_status;
struct dc_context *dc_ctx = dc->ctx;
stream_status = dc_stream_get_status(stream);
if (!stream_status) {
if (surface_count) /* Only an error condition if surf_count non-zero*/
ASSERT(false);
return false; /* Cannot commit surface to stream that is not committed */
}
context = dc->current_state;
Annotation
- Immediate include surface: `dm_services.h`, `amdgpu.h`, `dc.h`, `core_status.h`, `core_types.h`, `hw_sequencer.h`, `dce/dce_hwseq.h`, `hw/dccg.h`.
- Detected declarations: `struct pipe_split_policy_backup`, `struct dc_update_scratch_space`, `enum update_v3_flow`, `function sinks`, `function destroy_links`, `function get_num_of_internal_disp`, `function get_seamless_boot_stream_count`, `function create_links`, `function create_link_encoders`, `function create_link_encoders`.
- 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.