drivers/gpu/drm/amd/display/dc/dml2_0/dml2_mall_phantom.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml2_0/dml2_mall_phantom.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_mall_phantom.c- Extension
.c- Size
- 37190 bytes
- Lines
- 951
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dml2_dc_types.hdml2_internal_types.hdml2_utils.hdml2_mall_phantom.h
Detected Declarations
function filesfunction merge_pipes_for_subvpfunction all_pipes_have_stream_and_planefunction mpo_in_usefunction get_num_free_pipesfunction firstfunction pipesfunction subvp_subvp_schedulablefunction dml2_svp_drr_schedulablefunction subvp_vblank_schedulablefunction dml2_svp_validate_static_schedulabilityfunction set_phantom_stream_timingfunction enable_phantom_planefunction add_phantom_pipes_for_main_pipefunction dml2_svp_remove_all_phantom_pipesfunction dml2_svp_add_phantom_pipe_to_dc_state
Annotated Snippet
if (pipe->prev_odm_pipe) {
/*split off odm pipe*/
pipe->prev_odm_pipe->next_odm_pipe = pipe->next_odm_pipe;
if (pipe->next_odm_pipe)
pipe->next_odm_pipe->prev_odm_pipe = pipe->prev_odm_pipe;
pipe->bottom_pipe = NULL;
pipe->next_odm_pipe = NULL;
pipe->plane_state = NULL;
pipe->stream = NULL;
pipe->top_pipe = NULL;
pipe->prev_odm_pipe = NULL;
if (pipe->stream_res.dsc)
ctx->config.svp_pstate.callbacks.release_dsc(&context->res_ctx, ctx->config.svp_pstate.callbacks.dc->res_pool, &pipe->stream_res.dsc);
memset(&pipe->plane_res, 0, sizeof(pipe->plane_res));
memset(&pipe->stream_res, 0, sizeof(pipe->stream_res));
} else if (pipe->top_pipe && pipe->top_pipe->plane_state == pipe->plane_state) {
struct pipe_ctx *top_pipe = pipe->top_pipe;
struct pipe_ctx *bottom_pipe = pipe->bottom_pipe;
top_pipe->bottom_pipe = bottom_pipe;
if (bottom_pipe)
bottom_pipe->top_pipe = top_pipe;
pipe->top_pipe = NULL;
pipe->bottom_pipe = NULL;
pipe->plane_state = NULL;
pipe->stream = NULL;
memset(&pipe->plane_res, 0, sizeof(pipe->plane_res));
memset(&pipe->stream_res, 0, sizeof(pipe->stream_res));
}
}
}
static bool all_pipes_have_stream_and_plane(struct dml2_context *ctx, const struct dc_state *context)
{
int i;
for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
const struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
if (!pipe->stream)
continue;
if (!pipe->plane_state)
return false;
}
return true;
}
static bool mpo_in_use(const struct dc_state *context)
{
int i;
for (i = 0; i < context->stream_count; i++) {
if (context->stream_status[i].plane_count > 1)
return true;
}
return false;
}
/*
* dcn32_get_num_free_pipes: Calculate number of free pipes
*
* This function assumes that a "used" pipe is a pipe that has
* both a stream and a plane assigned to it.
*
* @dc: current dc state
* @context: new dc state
*
* Return:
* Number of free pipes available in the context
*/
static unsigned int get_num_free_pipes(struct dml2_context *ctx, struct dc_state *state)
{
unsigned int i;
unsigned int free_pipes = 0;
unsigned int num_pipes = 0;
for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
struct pipe_ctx *pipe = &state->res_ctx.pipe_ctx[i];
if (pipe->stream && !pipe->top_pipe) {
while (pipe) {
num_pipes++;
pipe = pipe->bottom_pipe;
}
}
}
Annotation
- Immediate include surface: `dml2_dc_types.h`, `dml2_internal_types.h`, `dml2_utils.h`, `dml2_mall_phantom.h`.
- Detected declarations: `function files`, `function merge_pipes_for_subvp`, `function all_pipes_have_stream_and_plane`, `function mpo_in_use`, `function get_num_free_pipes`, `function first`, `function pipes`, `function subvp_subvp_schedulable`, `function dml2_svp_drr_schedulable`, `function subvp_vblank_schedulable`.
- 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.