drivers/gpu/drm/mediatek/mtk_ddp_comp.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/mediatek/mtk_ddp_comp.h- Extension
.h- Size
- 10358 bytes
- Lines
- 366
- 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
linux/io.hlinux/pm_runtime.hlinux/soc/mediatek/mtk-cmdq.hlinux/soc/mediatek/mtk-mmsys.hlinux/soc/mediatek/mtk-mutex.hdrm/drm_modes.h
Detected Declarations
struct devicestruct device_nodestruct drm_crtcstruct drm_devicestruct mtk_plane_statestruct drm_crtc_statestruct mtk_ddp_compstruct cmdq_pktstruct mtk_ddp_comp_funcsstruct mtk_ddp_compenum mtk_ddp_comp_typefunction mtk_ddp_comp_power_onfunction mtk_ddp_comp_power_offfunction mtk_ddp_comp_clk_enablefunction mtk_ddp_comp_clk_disablefunction mtk_ddp_comp_mode_validfunction mtk_ddp_comp_configfunction mtk_ddp_comp_startfunction mtk_ddp_comp_stopfunction mtk_ddp_comp_register_vblank_cbfunction mtk_ddp_comp_unregister_vblank_cbfunction mtk_ddp_comp_enable_vblankfunction mtk_ddp_comp_disable_vblankfunction mtk_ddp_comp_supported_rotationsfunction mtk_ddp_comp_layer_nrfunction mtk_ddp_comp_layer_checkfunction mtk_ddp_comp_layer_configfunction mtk_ddp_gamma_get_lut_sizefunction mtk_ddp_gamma_setfunction mtk_ddp_comp_bgclr_in_onfunction mtk_ddp_comp_bgclr_in_offfunction mtk_ddp_ctm_setfunction mtk_ddp_comp_get_blend_modesfunction mtk_ddp_comp_get_num_formatsfunction mtk_ddp_comp_is_afbc_supportedfunction mtk_ddp_comp_addfunction mtk_ddp_comp_removefunction mtk_ddp_comp_connectfunction mtk_ddp_comp_disconnectfunction mtk_ddp_comp_encoder_index_set
Annotated Snippet
struct mtk_ddp_comp_funcs {
int (*power_on)(struct device *dev);
void (*power_off)(struct device *dev);
int (*clk_enable)(struct device *dev);
void (*clk_disable)(struct device *dev);
void (*config)(struct device *dev, unsigned int w,
unsigned int h, unsigned int vrefresh,
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
void (*start)(struct device *dev);
void (*stop)(struct device *dev);
void (*register_vblank_cb)(struct device *dev,
void (*vblank_cb)(void *),
void *vblank_cb_data);
void (*unregister_vblank_cb)(struct device *dev);
void (*enable_vblank)(struct device *dev);
void (*disable_vblank)(struct device *dev);
unsigned int (*supported_rotations)(struct device *dev);
unsigned int (*layer_nr)(struct device *dev);
int (*layer_check)(struct device *dev,
unsigned int idx,
struct mtk_plane_state *state);
void (*layer_config)(struct device *dev, unsigned int idx,
struct mtk_plane_state *state,
struct cmdq_pkt *cmdq_pkt);
unsigned int (*gamma_get_lut_size)(struct device *dev);
void (*gamma_set)(struct device *dev,
struct drm_crtc_state *state);
void (*bgclr_in_on)(struct device *dev);
void (*bgclr_in_off)(struct device *dev);
void (*ctm_set)(struct device *dev,
struct drm_crtc_state *state);
struct device * (*dma_dev_get)(struct device *dev);
u32 (*get_blend_modes)(struct device *dev);
const u32 *(*get_formats)(struct device *dev);
size_t (*get_num_formats)(struct device *dev);
bool (*is_afbc_supported)(struct device *dev);
void (*connect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
void (*disconnect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
void (*add)(struct device *dev, struct mtk_mutex *mutex);
void (*remove)(struct device *dev, struct mtk_mutex *mutex);
unsigned int (*encoder_index)(struct device *dev);
enum drm_mode_status (*mode_valid)(struct device *dev, const struct drm_display_mode *mode);
};
struct mtk_ddp_comp {
struct device *dev;
int irq;
unsigned int id;
int encoder_index;
const struct mtk_ddp_comp_funcs *funcs;
};
static inline int mtk_ddp_comp_power_on(struct mtk_ddp_comp *comp)
{
if (comp->funcs && comp->funcs->power_on)
return comp->funcs->power_on(comp->dev);
else
return pm_runtime_resume_and_get(comp->dev);
return 0;
}
static inline void mtk_ddp_comp_power_off(struct mtk_ddp_comp *comp)
{
if (comp->funcs && comp->funcs->power_off)
comp->funcs->power_off(comp->dev);
else
pm_runtime_put(comp->dev);
}
static inline int mtk_ddp_comp_clk_enable(struct mtk_ddp_comp *comp)
{
if (comp->funcs && comp->funcs->clk_enable)
return comp->funcs->clk_enable(comp->dev);
return 0;
}
static inline void mtk_ddp_comp_clk_disable(struct mtk_ddp_comp *comp)
{
if (comp->funcs && comp->funcs->clk_disable)
comp->funcs->clk_disable(comp->dev);
}
static inline
enum drm_mode_status mtk_ddp_comp_mode_valid(struct mtk_ddp_comp *comp,
const struct drm_display_mode *mode)
{
if (comp && comp->funcs && comp->funcs->mode_valid)
return comp->funcs->mode_valid(comp->dev, mode);
return MODE_OK;
Annotation
- Immediate include surface: `linux/io.h`, `linux/pm_runtime.h`, `linux/soc/mediatek/mtk-cmdq.h`, `linux/soc/mediatek/mtk-mmsys.h`, `linux/soc/mediatek/mtk-mutex.h`, `drm/drm_modes.h`.
- Detected declarations: `struct device`, `struct device_node`, `struct drm_crtc`, `struct drm_device`, `struct mtk_plane_state`, `struct drm_crtc_state`, `struct mtk_ddp_comp`, `struct cmdq_pkt`, `struct mtk_ddp_comp_funcs`, `struct mtk_ddp_comp`.
- 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.