drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c- Extension
.c- Size
- 39581 bytes
- Lines
- 1357
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_print.hlinux/clk.hkomeda_dev.hkomeda_kms.hkomeda_pipeline.hkomeda_framebuffer.h
Detected Declarations
function is_switching_userfunction komeda_pipeline_get_statefunction komeda_pipeline_get_old_statefunction komeda_pipeline_get_new_statefunction komeda_pipeline_get_state_and_set_crtcfunction komeda_component_get_statefunction komeda_component_get_old_statefunction komeda_component_get_state_and_set_userfunction komeda_component_add_inputfunction memcmpfunction komeda_component_check_inputfunction komeda_component_set_outputfunction komeda_component_validate_privatefunction komeda_component_get_avail_scalerfunction komeda_rotate_data_flowfunction komeda_layer_check_cfgfunction komeda_layer_validatefunction komeda_wb_layer_validatefunction scaling_ratio_validfunction komeda_scaler_check_cfgfunction komeda_scaler_validatefunction komeda_splitter_validatefunction komeda_merger_validatefunction pipeline_composition_sizefunction komeda_compiz_set_inputfunction komeda_compiz_validatefunction komeda_improc_validatefunction komeda_timing_ctrlr_validatefunction komeda_complete_data_flow_cfgfunction merger_is_availablefunction komeda_build_layer_data_flowfunction partsfunction komeda_build_layer_split_data_flowfunction komeda_build_wb_data_flowfunction komeda_build_wb_split_data_flowfunction komeda_build_display_data_flowfunction komeda_pipeline_unbound_componentsfunction komeda_release_unclaimed_resourcesfunction twicefunction for_each_set_bitfunction komeda_pipeline_updatefunction for_each_set_bit
Annotated Snippet
memcmp(&state->inputs[idx], input, sizeof(*input))) {
memcpy(&state->inputs[idx], input, sizeof(*input));
state->changed_active_inputs |= BIT(idx);
}
state->active_inputs |= BIT(idx);
state->affected_inputs |= BIT(idx);
}
static int
komeda_component_check_input(struct komeda_component_state *state,
struct komeda_component_output *input,
int idx)
{
struct komeda_component *c = state->component;
if ((idx < 0) || (idx >= c->max_active_inputs)) {
DRM_DEBUG_ATOMIC("%s required an invalid %s-input[%d].\n",
input->component->name, c->name, idx);
return -EINVAL;
}
if (has_bit(idx, state->active_inputs)) {
DRM_DEBUG_ATOMIC("%s required %s-input[%d] has been occupied already.\n",
input->component->name, c->name, idx);
return -EINVAL;
}
return 0;
}
static void
komeda_component_set_output(struct komeda_component_output *output,
struct komeda_component *comp,
u8 output_port)
{
output->component = comp;
output->output_port = output_port;
}
static int
komeda_component_validate_private(struct komeda_component *c,
struct komeda_component_state *st)
{
int err;
if (!c->funcs->validate)
return 0;
err = c->funcs->validate(c, st);
if (err)
DRM_DEBUG_ATOMIC("%s validate private failed.\n", c->name);
return err;
}
/* Get current available scaler from the component->supported_outputs */
static struct komeda_scaler *
komeda_component_get_avail_scaler(struct komeda_component *c,
struct drm_atomic_commit *state)
{
struct komeda_pipeline_state *pipe_st;
u32 avail_scalers;
pipe_st = komeda_pipeline_get_state(c->pipeline, state);
if (IS_ERR_OR_NULL(pipe_st))
return NULL;
avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^
KOMEDA_PIPELINE_SCALERS;
c = komeda_component_pickup_output(c, avail_scalers);
return to_scaler(c);
}
static void
komeda_rotate_data_flow(struct komeda_data_flow_cfg *dflow, u32 rot)
{
if (drm_rotation_90_or_270(rot)) {
swap(dflow->in_h, dflow->in_w);
swap(dflow->total_in_h, dflow->total_in_w);
}
}
static int
komeda_layer_check_cfg(struct komeda_layer *layer,
struct komeda_fb *kfb,
struct komeda_data_flow_cfg *dflow)
{
u32 src_x, src_y, src_w, src_h;
Annotation
- Immediate include surface: `drm/drm_print.h`, `linux/clk.h`, `komeda_dev.h`, `komeda_kms.h`, `komeda_pipeline.h`, `komeda_framebuffer.h`.
- Detected declarations: `function is_switching_user`, `function komeda_pipeline_get_state`, `function komeda_pipeline_get_old_state`, `function komeda_pipeline_get_new_state`, `function komeda_pipeline_get_state_and_set_crtc`, `function komeda_component_get_state`, `function komeda_component_get_old_state`, `function komeda_component_get_state_and_set_user`, `function komeda_component_add_input`, `function memcmp`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.