drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c- Extension
.c- Size
- 23907 bytes
- Lines
- 874
- 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
linux/delay.hdrm/drm_managed.hdpu_hwio.hdpu_hw_ctl.hdpu_kms.hdpu_trace.h
Detected Declarations
struct ctl_blend_configfunction _mixer_stagesfunction dpu_hw_ctl_get_flush_registerfunction dpu_hw_ctl_trigger_startfunction dpu_hw_ctl_is_startedfunction dpu_hw_ctl_trigger_pendingfunction dpu_hw_ctl_clear_pending_flushfunction dpu_hw_ctl_update_pending_flushfunction dpu_hw_ctl_get_pending_flushfunction dpu_hw_ctl_trigger_flush_v1function dpu_hw_ctl_trigger_flushfunction dpu_hw_ctl_update_pending_flush_ssppfunction dpu_hw_ctl_update_pending_flush_mixerfunction dpu_hw_ctl_update_pending_flush_intffunction dpu_hw_ctl_update_pending_flush_wbfunction dpu_hw_ctl_update_pending_flush_cdmfunction dpu_hw_ctl_update_pending_flush_wb_v1function dpu_hw_ctl_update_pending_flush_cwb_v1function dpu_hw_ctl_update_pending_flush_intf_v1function dpu_hw_ctl_update_pending_flush_periph_v1function dpu_hw_ctl_update_pending_flush_merge_3d_v1function dpu_hw_ctl_update_pending_flush_dsc_v1function dpu_hw_ctl_update_pending_flush_cdm_v1function dpu_hw_ctl_update_pending_flush_dsppfunction dpu_hw_ctl_update_pending_flush_dspp_sub_blocksfunction dpu_hw_ctl_poll_reset_statusfunction dpu_hw_ctl_reset_controlfunction dpu_hw_ctl_wait_reset_statusfunction dpu_hw_ctl_clear_all_blendstagesfunction dpu_hw_ctl_setup_blendstagefunction dpu_hw_ctl_intf_cfg_v1function dpu_hw_ctl_intf_cfgfunction dpu_hw_ctl_reset_intf_cfg_v1function dpu_hw_ctl_set_active_fetch_pipesfunction dpu_hw_ctl_set_active_pipesfunction dpu_hw_ctl_set_active_lmsfunction dpu_hw_ctl_init
Annotated Snippet
struct ctl_blend_config {
int idx, shift, ext_shift;
};
static const struct ctl_blend_config ctl_blend_config[][2] = {
[SSPP_NONE] = { { -1 }, { -1 } },
[SSPP_MAX] = { { -1 }, { -1 } },
[SSPP_VIG0] = { { 0, 0, 0 }, { 3, 0 } },
[SSPP_VIG1] = { { 0, 3, 2 }, { 3, 4 } },
[SSPP_VIG2] = { { 0, 6, 4 }, { 3, 8 } },
[SSPP_VIG3] = { { 0, 26, 6 }, { 3, 12 } },
[SSPP_RGB0] = { { 0, 9, 8 }, { -1 } },
[SSPP_RGB1] = { { 0, 12, 10 }, { -1 } },
[SSPP_RGB2] = { { 0, 15, 12 }, { -1 } },
[SSPP_RGB3] = { { 0, 29, 14 }, { -1 } },
[SSPP_DMA0] = { { 0, 18, 16 }, { 2, 8 } },
[SSPP_DMA1] = { { 0, 21, 18 }, { 2, 12 } },
[SSPP_DMA2] = { { 2, 0 }, { 2, 16 } },
[SSPP_DMA3] = { { 2, 4 }, { 2, 20 } },
[SSPP_DMA4] = { { 4, 0 }, { 4, 8 } },
[SSPP_DMA5] = { { 4, 4 }, { 4, 12 } },
[SSPP_CURSOR0] = { { 1, 20 }, { -1 } },
[SSPP_CURSOR1] = { { 1, 26 }, { -1 } },
};
static void dpu_hw_ctl_setup_blendstage(struct dpu_hw_ctl *ctx,
enum dpu_lm lm, struct dpu_hw_stage_cfg *stage_cfg)
{
struct dpu_hw_blk_reg_map *c = &ctx->hw;
u32 mix, ext, mix_ext;
u32 mixercfg[5] = { 0 };
int i, j;
int stages;
int pipes_per_stage;
stages = _mixer_stages(ctx->mixer_hw_caps, ctx->mixer_count, lm);
if (stages < 0)
return;
if (test_bit(DPU_MIXER_SOURCESPLIT,
&ctx->mixer_hw_caps->features))
pipes_per_stage = PIPES_PER_STAGE;
else
pipes_per_stage = 1;
mixercfg[0] = CTL_MIXER_BORDER_OUT; /* always set BORDER_OUT */
if (!stage_cfg)
goto exit;
for (i = 0; i <= stages; i++) {
/* overflow to ext register if 'i + 1 > 7' */
mix = (i + 1) & 0x7;
ext = i >= 7;
mix_ext = (i + 1) & 0xf;
for (j = 0 ; j < pipes_per_stage; j++) {
enum dpu_sspp_multirect_index rect_index =
stage_cfg->multirect_index[i][j];
enum dpu_sspp pipe = stage_cfg->stage[i][j];
const struct ctl_blend_config *cfg =
&ctl_blend_config[pipe][rect_index == DPU_SSPP_RECT_1];
/*
* CTL_LAYER has 3-bit field (and extra bits in EXT register),
* all EXT registers has 4-bit fields.
*/
if (cfg->idx == -1) {
continue;
} else if (cfg->idx == 0) {
mixercfg[0] |= mix << cfg->shift;
mixercfg[1] |= ext << cfg->ext_shift;
} else {
mixercfg[cfg->idx] |= mix_ext << cfg->shift;
}
}
}
exit:
DPU_REG_WRITE(c, CTL_LAYER(lm), mixercfg[0]);
DPU_REG_WRITE(c, CTL_LAYER_EXT(lm), mixercfg[1]);
DPU_REG_WRITE(c, CTL_LAYER_EXT2(lm), mixercfg[2]);
DPU_REG_WRITE(c, CTL_LAYER_EXT3(lm), mixercfg[3]);
if (ctx->mdss_ver->core_major_ver >= 9)
DPU_REG_WRITE(c, CTL_LAYER_EXT4(lm), mixercfg[4]);
}
static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
struct dpu_hw_intf_cfg *cfg)
Annotation
- Immediate include surface: `linux/delay.h`, `drm/drm_managed.h`, `dpu_hwio.h`, `dpu_hw_ctl.h`, `dpu_kms.h`, `dpu_trace.h`.
- Detected declarations: `struct ctl_blend_config`, `function _mixer_stages`, `function dpu_hw_ctl_get_flush_register`, `function dpu_hw_ctl_trigger_start`, `function dpu_hw_ctl_is_started`, `function dpu_hw_ctl_trigger_pending`, `function dpu_hw_ctl_clear_pending_flush`, `function dpu_hw_ctl_update_pending_flush`, `function dpu_hw_ctl_get_pending_flush`, `function dpu_hw_ctl_trigger_flush_v1`.
- 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.