drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c- Extension
.c- Size
- 79445 bytes
- Lines
- 2832
- 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/bitfield.hlinux/clk.hlinux/component.hlinux/delay.hlinux/iopoll.hlinux/kernel.hlinux/media-bus-format.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/swab.hdrm/drm.hdrm/drm_atomic.hdrm/drm_atomic_uapi.hdrm/drm_blend.hdrm/drm_crtc.hlinux/debugfs.hdrm/drm_debugfs.hdrm/drm_flip_work.hdrm/drm_framebuffer.hdrm/drm_gem_framebuffer_helper.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_vblank.huapi/linux/videodev2.hrockchip_drm_gem.hrockchip_drm_vop2.hrockchip_rgb.h
Detected Declarations
struct drm_bus_format_enum_listenum vop2_data_formatenum vop2_afbc_formatfunction vop2_lockfunction vop2_unlockfunction vop2_win_disablefunction vop2_get_bppfunction vop2_convert_formatfunction vop2_convert_afbc_formatfunction vop2_win_rb_swapfunction vop2_afbc_uv_swapfunction vop2_win_uv_swapfunction vop2_win_dither_upfunction vop2_output_uv_swapfunction vop2_output_rg_swapfunction is_yuv_outputfunction rockchip_vop2_mod_supportedfunction vop2_half_block_enablefunction vop2_afbc_transform_offsetfunction vop2_get_cluster_lb_modefunction vop2_scale_factorfunction vop2_setup_scalefunction vop2_convert_csc_modefunction vop2_setup_csc_modefunction vop2_crtc_enable_irqfunction vop2_crtc_disable_irqfunction vop2_core_clks_prepare_enablefunction rk3588_vop2_power_domain_enable_allfunction vop2_enablefunction vop2_disablefunction vop2_vp_dsp_lut_is_enabledfunction vop2_vp_dsp_lut_disablefunction vop2_vp_dsp_lut_poll_disabledfunction vop2_vp_dsp_lut_enablefunction vop2_vp_dsp_lut_update_enablefunction vop2_supports_seamless_gamma_lut_updatefunction vop2_gamma_lut_in_usefunction vop2_crtc_atomic_disablefunction vop2_plane_atomic_checkfunction vop2_plane_atomic_disablefunction vop2_plane_setup_color_keyfunction vop2_plane_atomic_updatefunction vop2_crtc_enable_vblankfunction vop2_crtc_disable_vblankfunction vop2_crtc_mode_validfunction vop2_crtc_mode_fixupfunction vop2_crtc_write_gamma_lutfunction vop2_crtc_atomic_set_gamma_seamless
Annotated Snippet
struct drm_bus_format_enum_list {
int type;
const char *name;
};
static const struct drm_bus_format_enum_list drm_bus_format_enum_list[] = {
{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
{ MEDIA_BUS_FMT_RGB565_1X16, "RGB565_1X16" },
{ MEDIA_BUS_FMT_RGB666_1X18, "RGB666_1X18" },
{ MEDIA_BUS_FMT_RGB666_1X24_CPADHI, "RGB666_1X24_CPADHI" },
{ MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, "RGB666_1X7X3_SPWG" },
{ MEDIA_BUS_FMT_YUV8_1X24, "YUV8_1X24" },
{ MEDIA_BUS_FMT_UYYVYY8_0_5X24, "UYYVYY8_0_5X24" },
{ MEDIA_BUS_FMT_YUV10_1X30, "YUV10_1X30" },
{ MEDIA_BUS_FMT_UYYVYY10_0_5X30, "UYYVYY10_0_5X30" },
{ MEDIA_BUS_FMT_RGB888_3X8, "RGB888_3X8" },
{ MEDIA_BUS_FMT_RGB888_1X24, "RGB888_1X24" },
{ MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, "RGB888_1X7X4_SPWG" },
{ MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, "RGB888_1X7X4_JEIDA" },
{ MEDIA_BUS_FMT_UYVY8_2X8, "UYVY8_2X8" },
{ MEDIA_BUS_FMT_YUYV8_1X16, "YUYV8_1X16" },
{ MEDIA_BUS_FMT_UYVY8_1X16, "UYVY8_1X16" },
{ MEDIA_BUS_FMT_RGB101010_1X30, "RGB101010_1X30" },
{ MEDIA_BUS_FMT_YUYV10_1X20, "YUYV10_1X20" },
};
static DRM_ENUM_NAME_FN(drm_get_bus_format_name, drm_bus_format_enum_list)
static const struct regmap_config vop2_regmap_config;
static void vop2_lock(struct vop2 *vop2)
{
mutex_lock(&vop2->vop2_lock);
}
static void vop2_unlock(struct vop2 *vop2)
{
mutex_unlock(&vop2->vop2_lock);
}
static void vop2_win_disable(struct vop2_win *win)
{
vop2_win_write(win, VOP2_WIN_ENABLE, 0);
if (vop2_cluster_window(win))
vop2_win_write(win, VOP2_WIN_CLUSTER_ENABLE, 0);
}
static u32 vop2_get_bpp(const struct drm_format_info *format)
{
switch (format->format) {
case DRM_FORMAT_YUV420_8BIT:
return 12;
case DRM_FORMAT_YUV420_10BIT:
return 15;
case DRM_FORMAT_VUY101010:
return 30;
default:
return drm_format_info_bpp(format, 0);
}
}
static enum vop2_data_format vop2_convert_format(u32 format)
{
switch (format) {
case DRM_FORMAT_XRGB2101010:
case DRM_FORMAT_ARGB2101010:
case DRM_FORMAT_XBGR2101010:
case DRM_FORMAT_ABGR2101010:
return VOP2_FMT_XRGB101010;
case DRM_FORMAT_XRGB8888:
case DRM_FORMAT_ARGB8888:
case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_ABGR8888:
return VOP2_FMT_ARGB8888;
case DRM_FORMAT_RGB888:
case DRM_FORMAT_BGR888:
return VOP2_FMT_RGB888;
case DRM_FORMAT_RGB565:
case DRM_FORMAT_BGR565:
return VOP2_FMT_RGB565;
case DRM_FORMAT_NV12:
case DRM_FORMAT_NV21:
case DRM_FORMAT_YUV420_8BIT:
return VOP2_FMT_YUV420SP;
case DRM_FORMAT_NV15:
case DRM_FORMAT_YUV420_10BIT:
return VOP2_FMT_YUV420SP_10;
case DRM_FORMAT_NV16:
case DRM_FORMAT_NV61:
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/component.h`, `linux/delay.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/media-bus-format.h`, `linux/mfd/syscon.h`.
- Detected declarations: `struct drm_bus_format_enum_list`, `enum vop2_data_format`, `enum vop2_afbc_format`, `function vop2_lock`, `function vop2_unlock`, `function vop2_win_disable`, `function vop2_get_bpp`, `function vop2_convert_format`, `function vop2_convert_afbc_format`, `function vop2_win_rb_swap`.
- 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.