drivers/gpu/drm/sysfb/drm_sysfb_helper.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sysfb/drm_sysfb_helper.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sysfb/drm_sysfb_helper.h- Extension
.h- Size
- 6576 bytes
- Lines
- 210
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/container_of.hlinux/iosys-map.hvideo/pixel_format.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_gem_atomic_helper.hdrm/drm_modes.h
Detected Declarations
struct drm_format_infostruct drm_scanout_bufferstruct screen_infostruct drm_sysfb_formatstruct drm_sysfb_devicestruct drm_sysfb_plane_statestruct drm_sysfb_crtc_statefunction to_drm_sysfb_plane_statefunction to_drm_sysfb_crtc_state
Annotated Snippet
struct drm_sysfb_format {
struct pixel_format pixel;
u32 fourcc;
};
int drm_sysfb_get_validated_int(struct drm_device *dev, const char *name,
u64 value, u32 max);
int drm_sysfb_get_validated_int0(struct drm_device *dev, const char *name,
u64 value, u32 max);
const struct drm_format_info *drm_sysfb_get_format(struct drm_device *dev,
const struct drm_sysfb_format *formats,
size_t nformats,
const struct pixel_format *pixel);
#if defined(CONFIG_SCREEN_INFO)
int drm_sysfb_get_width_si(struct drm_device *dev, const struct screen_info *si);
int drm_sysfb_get_height_si(struct drm_device *dev, const struct screen_info *si);
struct resource *drm_sysfb_get_memory_si(struct drm_device *dev,
const struct screen_info *si,
struct resource *res);
int drm_sysfb_get_stride_si(struct drm_device *dev, const struct screen_info *si,
const struct drm_format_info *format,
unsigned int width, unsigned int height, u64 size);
u64 drm_sysfb_get_visible_size_si(struct drm_device *dev, const struct screen_info *si,
unsigned int height, unsigned int stride, u64 size);
#endif
/*
* Display modes
*/
struct drm_display_mode drm_sysfb_mode(unsigned int width,
unsigned int height,
unsigned int width_mm,
unsigned int height_mm);
/*
* Device
*/
struct drm_sysfb_device {
struct drm_device dev;
const u8 *edid; /* can be NULL */
/* hardware settings */
struct drm_display_mode fb_mode;
const struct drm_format_info *fb_format;
unsigned int fb_pitch;
unsigned int fb_gamma_lut_size;
/* hardware-framebuffer kernel address */
struct iosys_map fb_addr;
};
static inline struct drm_sysfb_device *to_drm_sysfb_device(struct drm_device *dev)
{
return container_of(dev, struct drm_sysfb_device, dev);
}
/*
* Plane
*/
struct drm_sysfb_plane_state {
struct drm_shadow_plane_state base;
/* transfers framebuffer data to scanout buffer in CRTC format */
drm_sysfb_blit_func blit_to_crtc;
};
static inline struct drm_sysfb_plane_state *
to_drm_sysfb_plane_state(struct drm_plane_state *base)
{
return container_of(to_drm_shadow_plane_state(base), struct drm_sysfb_plane_state, base);
}
size_t drm_sysfb_build_fourcc_list(struct drm_device *dev,
const u32 *native_fourccs, size_t native_nfourccs,
u32 *fourccs_out, size_t nfourccs_out);
int drm_sysfb_plane_helper_begin_fb_access(struct drm_plane *plane,
struct drm_plane_state *plane_state);
int drm_sysfb_plane_helper_atomic_check(struct drm_plane *plane,
struct drm_atomic_commit *new_state);
void drm_sysfb_plane_helper_atomic_update(struct drm_plane *plane,
struct drm_atomic_commit *state);
void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,
struct drm_atomic_commit *state);
int drm_sysfb_plane_helper_get_scanout_buffer(struct drm_plane *plane,
Annotation
- Immediate include surface: `linux/container_of.h`, `linux/iosys-map.h`, `video/pixel_format.h`, `drm/drm_crtc.h`, `drm/drm_device.h`, `drm/drm_gem_atomic_helper.h`, `drm/drm_modes.h`.
- Detected declarations: `struct drm_format_info`, `struct drm_scanout_buffer`, `struct screen_info`, `struct drm_sysfb_format`, `struct drm_sysfb_device`, `struct drm_sysfb_plane_state`, `struct drm_sysfb_crtc_state`, `function to_drm_sysfb_plane_state`, `function to_drm_sysfb_crtc_state`.
- 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.
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.