drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c- Extension
.c- Size
- 35158 bytes
- Lines
- 1282
- 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.
- 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/dmapool.hlinux/mfd/atmel-hlcdc.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_blend.hdrm/drm_fb_dma_helper.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_gem_dma_helper.hdrm/drm_print.hatmel_hlcdc_dc.h
Detected Declarations
struct atmel_hlcdc_plane_statefunction drm_plane_state_to_atmel_hlcdc_plane_statefunction atmel_hlcdc_format_to_plane_modefunction atmel_hlcdc_plane_phiscaler_get_factorfunction atmel_hlcdc_plane_scaler_set_phicoefffunction atmel_hlcdc_plane_setup_scalerfunction atmel_xlcdc_plane_setup_scalerfunction atmel_hlcdc_plane_update_pos_and_sizefunction atmel_hlcdc_plane_update_general_settingsfunction atmel_xlcdc_plane_update_general_settingsfunction atmel_hlcdc_plane_update_formatfunction atmel_hlcdc_plane_update_clutfunction atmel_hlcdc_update_buffersfunction atmel_xlcdc_update_buffersfunction atmel_hlcdc_plane_update_buffersfunction atmel_hlcdc_plane_prepare_ahb_routingfunction drm_atomic_crtc_state_for_each_planefunction atmel_hlcdc_plane_prepare_disc_areafunction drm_atomic_crtc_state_for_each_planefunction atmel_hlcdc_plane_update_disc_areafunction atmel_hlcdc_plane_atomic_checkfunction atmel_hlcdc_atomic_disablefunction atmel_xlcdc_atomic_disablefunction atmel_hlcdc_plane_atomic_disablefunction atmel_hlcdc_atomic_updatefunction atmel_xlcdc_atomic_updatefunction atmel_hlcdc_plane_atomic_updatefunction atmel_hlcdc_csc_initfunction atmel_xlcdc_csc_initfunction atmel_hlcdc_plane_init_propertiesfunction atmel_hlcdc_irq_dbgfunction atmel_xlcdc_irq_dbgfunction atmel_hlcdc_plane_irqfunction atmel_hlcdc_plane_alloc_dscrsfunction atmel_hlcdc_plane_atomic_duplicate_statefunction atmel_hlcdc_plane_atomic_destroy_statefunction atmel_hlcdc_plane_resetfunction atmel_hlcdc_plane_createfunction atmel_hlcdc_create_planes
Annotated Snippet
struct atmel_hlcdc_plane_state {
struct drm_plane_state base;
int crtc_x;
int crtc_y;
unsigned int crtc_w;
unsigned int crtc_h;
uint32_t src_x;
uint32_t src_y;
uint32_t src_w;
uint32_t src_h;
int disc_x;
int disc_y;
int disc_w;
int disc_h;
int ahb_id;
/* These fields are private and should not be touched */
int bpp[ATMEL_HLCDC_LAYER_MAX_PLANES];
unsigned int offsets[ATMEL_HLCDC_LAYER_MAX_PLANES];
int xstride[ATMEL_HLCDC_LAYER_MAX_PLANES];
int pstride[ATMEL_HLCDC_LAYER_MAX_PLANES];
int nplanes;
/* DMA descriptors. */
struct atmel_hlcdc_dma_channel_dscr *dscrs[ATMEL_HLCDC_LAYER_MAX_PLANES];
};
static inline struct atmel_hlcdc_plane_state *
drm_plane_state_to_atmel_hlcdc_plane_state(struct drm_plane_state *s)
{
return container_of(s, struct atmel_hlcdc_plane_state, base);
}
static uint32_t rgb_formats[] = {
DRM_FORMAT_C8,
DRM_FORMAT_XRGB4444,
DRM_FORMAT_ARGB4444,
DRM_FORMAT_RGBA4444,
DRM_FORMAT_ARGB1555,
DRM_FORMAT_RGB565,
DRM_FORMAT_RGB888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
DRM_FORMAT_RGBA8888,
};
struct atmel_hlcdc_formats atmel_hlcdc_plane_rgb_formats = {
.formats = rgb_formats,
.nformats = ARRAY_SIZE(rgb_formats),
};
static uint32_t rgb_and_yuv_formats[] = {
DRM_FORMAT_C8,
DRM_FORMAT_XRGB4444,
DRM_FORMAT_ARGB4444,
DRM_FORMAT_RGBA4444,
DRM_FORMAT_ARGB1555,
DRM_FORMAT_RGB565,
DRM_FORMAT_RGB888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
DRM_FORMAT_RGBA8888,
DRM_FORMAT_AYUV,
DRM_FORMAT_YUYV,
DRM_FORMAT_UYVY,
DRM_FORMAT_YVYU,
DRM_FORMAT_VYUY,
DRM_FORMAT_NV21,
DRM_FORMAT_NV61,
DRM_FORMAT_YUV422,
DRM_FORMAT_YUV420,
};
struct atmel_hlcdc_formats atmel_hlcdc_plane_rgb_and_yuv_formats = {
.formats = rgb_and_yuv_formats,
.nformats = ARRAY_SIZE(rgb_and_yuv_formats),
};
static int atmel_hlcdc_format_to_plane_mode(u32 format, u32 *mode)
{
switch (format) {
case DRM_FORMAT_C8:
*mode = ATMEL_HLCDC_C8_MODE;
break;
case DRM_FORMAT_XRGB4444:
*mode = ATMEL_HLCDC_XRGB4444_MODE;
break;
case DRM_FORMAT_ARGB4444:
Annotation
- Immediate include surface: `linux/dmapool.h`, `linux/mfd/atmel-hlcdc.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_blend.h`, `drm/drm_fb_dma_helper.h`, `drm/drm_fourcc.h`, `drm/drm_framebuffer.h`.
- Detected declarations: `struct atmel_hlcdc_plane_state`, `function drm_plane_state_to_atmel_hlcdc_plane_state`, `function atmel_hlcdc_format_to_plane_mode`, `function atmel_hlcdc_plane_phiscaler_get_factor`, `function atmel_hlcdc_plane_scaler_set_phicoeff`, `function atmel_hlcdc_plane_setup_scaler`, `function atmel_xlcdc_plane_setup_scaler`, `function atmel_hlcdc_plane_update_pos_and_size`, `function atmel_hlcdc_plane_update_general_settings`, `function atmel_xlcdc_plane_update_general_settings`.
- 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.
- 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.