drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c- Extension
.c- Size
- 23079 bytes
- Lines
- 785
- 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.
- 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.hlinux/string_choices.hdpu_encoder_phys.hdpu_hw_interrupts.hdpu_hw_pingpong.hdpu_core_irq.hdpu_formats.hdpu_trace.hdisp/msm_disp_snapshot.hdrm/drm_managed.h
Detected Declarations
function dpu_encoder_phys_cmd_is_masterfunction _dpu_encoder_phys_cmd_update_intf_cfgfunction dpu_encoder_phys_cmd_pp_tx_done_irqfunction dpu_encoder_phys_cmd_te_rd_ptr_irqfunction dpu_encoder_phys_cmd_ctl_start_irqfunction dpu_encoder_phys_cmd_underrun_irqfunction dpu_encoder_phys_cmd_atomic_mode_setfunction _dpu_encoder_phys_cmd_handle_ppdone_timeoutfunction _dpu_encoder_phys_cmd_wait_for_idlefunction dpu_encoder_phys_cmd_control_vblank_irqfunction dpu_encoder_phys_cmd_irq_enablefunction dpu_encoder_phys_cmd_irq_disablefunction dpu_encoder_phys_cmd_tearcheck_configfunction _dpu_encoder_phys_cmd_pingpong_configfunction dpu_encoder_phys_cmd_needs_single_flushfunction dpu_encoder_phys_cmd_enable_helperfunction dpu_encoder_phys_cmd_enablefunction _dpu_encoder_phys_cmd_connect_tefunction dpu_encoder_phys_cmd_prepare_idle_pcfunction dpu_encoder_phys_cmd_get_line_countfunction dpu_encoder_phys_cmd_disablefunction dpu_encoder_phys_cmd_prepare_for_kickofffunction dpu_encoder_phys_cmd_enable_tefunction _dpu_encoder_phys_cmd_wait_for_ctl_startfunction dpu_encoder_phys_cmd_wait_for_tx_completefunction dpu_encoder_phys_cmd_wait_for_commit_donefunction dpu_encoder_phys_cmd_handle_post_kickofffunction dpu_encoder_phys_cmd_trigger_startfunction dpu_encoder_phys_cmd_init_ops
Annotated Snippet
if (!phys_enc->hw_pp) {
DPU_ERROR("invalid encoder\n");
return;
}
DRM_DEBUG_KMS("id:%u pp:%d state:%d\n", DRMID(phys_enc->parent),
phys_enc->hw_pp->idx - PINGPONG_0,
phys_enc->enable_state);
if (phys_enc->hw_pp->ops.disable_tearcheck)
phys_enc->hw_pp->ops.disable_tearcheck(phys_enc->hw_pp);
}
if (phys_enc->hw_intf->ops.bind_pingpong_blk) {
phys_enc->hw_intf->ops.bind_pingpong_blk(
phys_enc->hw_intf,
PINGPONG_NONE);
ctl = phys_enc->hw_ctl;
ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx);
}
phys_enc->enable_state = DPU_ENC_DISABLED;
}
static void dpu_encoder_phys_cmd_prepare_for_kickoff(
struct dpu_encoder_phys *phys_enc)
{
struct dpu_encoder_phys_cmd *cmd_enc =
to_dpu_encoder_phys_cmd(phys_enc);
int ret;
if (!phys_enc->hw_pp) {
DPU_ERROR("invalid encoder\n");
return;
}
DRM_DEBUG_KMS("id:%u pp:%d pending_cnt:%d\n", DRMID(phys_enc->parent),
phys_enc->hw_pp->idx - PINGPONG_0,
atomic_read(&phys_enc->pending_kickoff_cnt));
/*
* Mark kickoff request as outstanding. If there are more than one,
* outstanding, then we have to wait for the previous one to complete
*/
ret = _dpu_encoder_phys_cmd_wait_for_idle(phys_enc);
if (ret) {
/* force pending_kickoff_cnt 0 to discard failed kickoff */
atomic_set(&phys_enc->pending_kickoff_cnt, 0);
DRM_ERROR("failed wait_for_idle: id:%u ret:%d pp:%d\n",
DRMID(phys_enc->parent), ret,
phys_enc->hw_pp->idx - PINGPONG_0);
}
dpu_encoder_phys_cmd_enable_te(phys_enc);
DPU_DEBUG_CMDENC(cmd_enc, "pp:%d pending_cnt %d\n",
phys_enc->hw_pp->idx - PINGPONG_0,
atomic_read(&phys_enc->pending_kickoff_cnt));
}
static void dpu_encoder_phys_cmd_enable_te(struct dpu_encoder_phys *phys_enc)
{
if (!phys_enc)
return;
if (!dpu_encoder_phys_cmd_is_master(phys_enc))
return;
if (phys_enc->has_intf_te) {
if (!phys_enc->hw_intf->ops.disable_autorefresh)
return;
phys_enc->hw_intf->ops.disable_autorefresh(
phys_enc->hw_intf,
DRMID(phys_enc->parent),
phys_enc->cached_mode.vdisplay);
} else {
if (!phys_enc->hw_pp ||
!phys_enc->hw_pp->ops.disable_autorefresh)
return;
phys_enc->hw_pp->ops.disable_autorefresh(
phys_enc->hw_pp,
DRMID(phys_enc->parent),
phys_enc->cached_mode.vdisplay);
}
}
static int _dpu_encoder_phys_cmd_wait_for_ctl_start(
struct dpu_encoder_phys *phys_enc)
{
Annotation
- Immediate include surface: `linux/delay.h`, `linux/string_choices.h`, `dpu_encoder_phys.h`, `dpu_hw_interrupts.h`, `dpu_hw_pingpong.h`, `dpu_core_irq.h`, `dpu_formats.h`, `dpu_trace.h`.
- Detected declarations: `function dpu_encoder_phys_cmd_is_master`, `function _dpu_encoder_phys_cmd_update_intf_cfg`, `function dpu_encoder_phys_cmd_pp_tx_done_irq`, `function dpu_encoder_phys_cmd_te_rd_ptr_irq`, `function dpu_encoder_phys_cmd_ctl_start_irq`, `function dpu_encoder_phys_cmd_underrun_irq`, `function dpu_encoder_phys_cmd_atomic_mode_set`, `function _dpu_encoder_phys_cmd_handle_ppdone_timeout`, `function _dpu_encoder_phys_cmd_wait_for_idle`, `function dpu_encoder_phys_cmd_control_vblank_irq`.
- 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.