drivers/gpu/drm/rockchip/rockchip_drm_vop.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/rockchip/rockchip_drm_vop.c- Extension
.c- Size
- 62065 bytes
- Lines
- 2297
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clk.hlinux/component.hlinux/delay.hlinux/iopoll.hlinux/kernel.hlinux/log2.hlinux/module.hlinux/of.hlinux/overflow.hlinux/platform_device.hlinux/pm_runtime.hlinux/reset.hdrm/drm.hdrm/drm_atomic.hdrm/drm_atomic_uapi.hdrm/drm_blend.hdrm/drm_crtc.hdrm/drm_flip_work.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_gem_atomic_helper.hdrm/drm_gem_framebuffer_helper.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_self_refresh_helper.hdrm/drm_vblank.hdrm/bridge/analogix_dp.hrockchip_drm_drv.hrockchip_drm_gem.hrockchip_drm_fb.hrockchip_drm_vop.hrockchip_rgb.h
Detected Declarations
struct vop_winstruct rockchip_rgbstruct vopenum vop_pendingfunction vop_readlfunction vop_read_regfunction vop_reg_setfunction vop_get_intr_typefunction vop_cfg_donefunction has_rb_swappedfunction has_uv_swappedfunction is_fmt_10function vop_convert_formatfunction vop_convert_afbc_formatfunction scl_vop_cal_scalefunction scl_vop_cal_scl_facfunction vop_dsp_hold_valid_irq_enablefunction vop_dsp_hold_valid_irq_disablefunction vop_line_flag_irq_is_enabledfunction vop_line_flag_irq_enablefunction vop_line_flag_irq_disablefunction vop_core_clks_enablefunction vop_core_clks_disablefunction vop_win_disablefunction vop_enablefunction rockchip_drm_set_win_enabledfunction vop_crtc_atomic_disablefunction rockchip_afbcfunction rockchip_mod_supportedfunction vop_plane_atomic_checkfunction vop_plane_atomic_disablefunction vop_plane_atomic_updatefunction vop_plane_atomic_async_checkfunction vop_plane_atomic_async_updatefunction vop_crtc_enable_vblankfunction vop_crtc_disable_vblankfunction vop_crtc_mode_validfunction vop_crtc_mode_fixupfunction vop_dsp_lut_is_enabledfunction vop_lut_buffer_indexfunction vop_crtc_write_gamma_lutfunction vop_crtc_gamma_setfunction vop_crtc_atomic_beginfunction vop_crtc_atomic_enablefunction vop_fs_irq_is_pendingfunction vop_wait_for_irq_handlerfunction vop_crtc_atomic_checkfunction drm_atomic_crtc_state_for_each_plane
Annotated Snippet
struct vop_win {
struct drm_plane base;
const struct vop_win_data *data;
const struct vop_win_yuv2yuv_data *yuv2yuv_data;
struct vop *vop;
};
struct rockchip_rgb;
struct vop {
struct drm_crtc crtc;
struct device *dev;
struct drm_device *drm_dev;
bool is_enabled;
struct completion dsp_hold_completion;
unsigned int win_enabled;
/* protected by dev->event_lock */
struct drm_pending_vblank_event *event;
struct drm_flip_work fb_unref_work;
unsigned long pending;
struct completion line_flag_completion;
const struct vop_data *data;
uint32_t *regsbak;
void __iomem *regs;
void __iomem *lut_regs;
/* physical map length of vop register */
uint32_t len;
/* one time only one process allowed to config the register */
spinlock_t reg_lock;
/* lock vop irq reg */
spinlock_t irq_lock;
/* protects crtc enable/disable */
struct mutex vop_lock;
unsigned int irq;
/* vop AHP clk */
struct clk *hclk;
/* vop dclk */
struct clk *dclk;
/* vop share memory frequency */
struct clk *aclk;
/* vop dclk reset */
struct reset_control *dclk_rst;
/* optional internal rgb encoder */
struct rockchip_rgb *rgb;
struct vop_win win[];
};
static inline uint32_t vop_readl(struct vop *vop, uint32_t offset)
{
return readl(vop->regs + offset);
}
static inline uint32_t vop_read_reg(struct vop *vop, uint32_t base,
const struct vop_reg *reg)
{
return (vop_readl(vop, base + reg->offset) >> reg->shift) & reg->mask;
}
static void vop_reg_set(struct vop *vop, const struct vop_reg *reg,
uint32_t _offset, uint32_t _mask, uint32_t v,
const char *reg_name)
{
int offset, mask, shift;
if (!reg || !reg->mask) {
DRM_DEV_DEBUG(vop->dev, "Warning: not support %s\n", reg_name);
return;
}
offset = reg->offset + _offset;
mask = reg->mask & _mask;
shift = reg->shift;
if (reg->write_mask) {
v = ((v << shift) & 0xffff) | (mask << (shift + 16));
} else {
uint32_t cached_val = vop->regsbak[offset >> 2];
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/delay.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/log2.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct vop_win`, `struct rockchip_rgb`, `struct vop`, `enum vop_pending`, `function vop_readl`, `function vop_read_reg`, `function vop_reg_set`, `function vop_get_intr_type`, `function vop_cfg_done`, `function has_rb_swapped`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.