drivers/gpu/drm/sun4i/sun8i_mixer.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sun4i/sun8i_mixer.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sun4i/sun8i_mixer.h- Extension
.h- Size
- 8537 bytes
- Lines
- 275
- 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/clk.hlinux/regmap.hlinux/reset.hdrm/drm_plane.hsunxi_engine.h
Detected Declarations
struct sun8i_layer_cfgstruct sun8i_mixer_cfgstruct sun8i_mixerstruct sun8i_layerenum sun8i_mixer_typefunction plane_to_sun8i_layerfunction engine_to_sun8i_mixerfunction sun8i_blender_basefunction sun8i_blender_regmapfunction sun8i_channel_base
Annotated Snippet
struct sun8i_layer_cfg {
unsigned int vi_scaler_num;
int scaler_mask;
int ccsc;
unsigned int de_type;
unsigned int scanline_yuv;
unsigned int de2_fcc_alpha : 1;
};
/**
* struct sun8i_mixer_cfg - mixer HW configuration
* @lay_cfg: layer configuration
* @vi_num: number of VI channels
* @ui_num: number of UI channels
* @de_type: sun8i_mixer_type enum representing the display engine generation.
* @mod_rate: module clock rate that needs to be set in order to have
* a functional block.
* @map: channel map for DE variants processing YUV separately (DE33)
*/
struct sun8i_mixer_cfg {
struct sun8i_layer_cfg lay_cfg;
int vi_num;
int ui_num;
unsigned int de_type;
unsigned long mod_rate;
unsigned int map[6];
};
struct sun8i_mixer {
struct sunxi_engine engine;
const struct sun8i_mixer_cfg *cfg;
struct reset_control *reset;
struct clk *bus_clk;
struct clk *mod_clk;
struct regmap *top_regs;
struct regmap *disp_regs;
};
enum {
SUN8I_LAYER_TYPE_UI,
SUN8I_LAYER_TYPE_VI,
};
struct sun8i_layer {
struct drm_plane plane;
int type;
int index;
int channel;
int overlay;
struct regmap *regs;
const struct sun8i_layer_cfg *cfg;
};
static inline struct sun8i_layer *
plane_to_sun8i_layer(struct drm_plane *plane)
{
return container_of(plane, struct sun8i_layer, plane);
}
static inline struct sun8i_mixer *
engine_to_sun8i_mixer(struct sunxi_engine *engine)
{
return container_of(engine, struct sun8i_mixer, engine);
}
static inline u32
sun8i_blender_base(struct sun8i_mixer *mixer)
{
return mixer->cfg->de_type == SUN8I_MIXER_DE3 ? DE3_BLD_BASE : DE2_BLD_BASE;
}
static inline struct regmap *
sun8i_blender_regmap(struct sun8i_mixer *mixer)
{
return mixer->cfg->de_type == SUN8I_MIXER_DE33 ?
mixer->disp_regs : mixer->engine.regs;
}
static inline u32
sun8i_channel_base(struct sun8i_layer *layer)
{
if (layer->cfg->de_type == SUN8I_MIXER_DE33)
return DE33_CH_BASE + layer->channel * DE33_CH_SIZE;
else if (layer->cfg->de_type == SUN8I_MIXER_DE3)
return DE3_CH_BASE + layer->channel * DE3_CH_SIZE;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/regmap.h`, `linux/reset.h`, `drm/drm_plane.h`, `sunxi_engine.h`.
- Detected declarations: `struct sun8i_layer_cfg`, `struct sun8i_mixer_cfg`, `struct sun8i_mixer`, `struct sun8i_layer`, `enum sun8i_mixer_type`, `function plane_to_sun8i_layer`, `function engine_to_sun8i_mixer`, `function sun8i_blender_base`, `function sun8i_blender_regmap`, `function sun8i_channel_base`.
- 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.