drivers/gpu/drm/sysfb/corebootdrm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sysfb/corebootdrm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sysfb/corebootdrm.c- Extension
.c- Size
- 12271 bytes
- Lines
- 456
- 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/aperture.hlinux/coreboot.hlinux/minmax.hlinux/platform_device.hlinux/pm.hdrm/clients/drm_client_setup.hdrm/drm_atomic.hdrm/drm_atomic_state_helper.hdrm/drm_connector.hdrm/drm_damage_helper.hdrm/drm_device.hdrm/drm_drv.hdrm/drm_fbdev_shmem.hdrm/drm_framebuffer.hdrm/drm_gem_atomic_helper.hdrm/drm_gem_framebuffer_helper.hdrm/drm_gem_shmem_helper.hdrm/drm_managed.hdrm/drm_modeset_helper.hdrm/drm_modeset_helper_vtables.hdrm/drm_print.hdrm/drm_probe_helper.hdrm_sysfb_helper.h
Detected Declarations
struct corebootdrm_devicefunction corebootdrm_get_format_fbfunction corebootdrm_get_width_fbfunction corebootdrm_get_height_fbfunction corebootdrm_get_pitch_fbfunction corebootdrm_get_size_fbfunction corebootdrm_get_address_fbfunction corebootdrm_get_orientation_fbfunction corebootdrm_mode_config_initfunction corebootdrm_pm_suspendfunction corebootdrm_pm_resumefunction corebootdrm_probefunction corebootdrm_remove
Annotated Snippet
struct corebootdrm_device {
struct drm_sysfb_device sysfb;
/* modesetting */
u32 formats[DRM_SYSFB_PLANE_NFORMATS(1)];
struct drm_plane primary_plane;
struct drm_crtc crtc;
struct drm_encoder encoder;
struct drm_connector connector;
};
/*
* Modesetting
*/
static const u64 corebootdrm_primary_plane_format_modifiers[] = {
DRM_SYSFB_PLANE_FORMAT_MODIFIERS,
};
static const struct drm_plane_helper_funcs corebootdrm_primary_plane_helper_funcs = {
DRM_SYSFB_PLANE_HELPER_FUNCS,
};
static const struct drm_plane_funcs corebootdrm_primary_plane_funcs = {
DRM_SYSFB_PLANE_FUNCS,
.destroy = drm_plane_cleanup,
};
static const struct drm_crtc_helper_funcs corebootdrm_crtc_helper_funcs = {
DRM_SYSFB_CRTC_HELPER_FUNCS,
};
static const struct drm_crtc_funcs corebootdrm_crtc_funcs = {
DRM_SYSFB_CRTC_FUNCS,
.destroy = drm_crtc_cleanup,
};
static const struct drm_encoder_funcs corebootdrm_encoder_funcs = {
.destroy = drm_encoder_cleanup,
};
static const struct drm_connector_helper_funcs corebootdrm_connector_helper_funcs = {
DRM_SYSFB_CONNECTOR_HELPER_FUNCS,
};
static const struct drm_connector_funcs corebootdrm_connector_funcs = {
DRM_SYSFB_CONNECTOR_FUNCS,
.destroy = drm_connector_cleanup,
};
static const struct drm_mode_config_funcs corebootdrm_mode_config_funcs = {
DRM_SYSFB_MODE_CONFIG_FUNCS,
};
static int corebootdrm_mode_config_init(struct corebootdrm_device *cdev,
enum drm_panel_orientation orientation)
{
struct drm_sysfb_device *sysfb = &cdev->sysfb;
struct drm_device *dev = &sysfb->dev;
const struct drm_format_info *format = sysfb->fb_format;
unsigned int width = sysfb->fb_mode.hdisplay;
unsigned int height = sysfb->fb_mode.vdisplay;
struct drm_plane *primary_plane;
struct drm_crtc *crtc;
struct drm_encoder *encoder;
struct drm_connector *connector;
size_t nformats;
int ret;
ret = drmm_mode_config_init(dev);
if (ret)
return ret;
dev->mode_config.min_width = width;
dev->mode_config.max_width = max_t(unsigned int, width, DRM_SHADOW_PLANE_MAX_WIDTH);
dev->mode_config.min_height = height;
dev->mode_config.max_height = max_t(unsigned int, height, DRM_SHADOW_PLANE_MAX_HEIGHT);
dev->mode_config.funcs = &corebootdrm_mode_config_funcs;
dev->mode_config.preferred_depth = format->depth;
/* Primary plane */
nformats = drm_sysfb_build_fourcc_list(dev, &format->format, 1,
cdev->formats, ARRAY_SIZE(cdev->formats));
primary_plane = &cdev->primary_plane;
ret = drm_universal_plane_init(dev, primary_plane, 0, &corebootdrm_primary_plane_funcs,
cdev->formats, nformats,
corebootdrm_primary_plane_format_modifiers,
DRM_PLANE_TYPE_PRIMARY, NULL);
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/coreboot.h`, `linux/minmax.h`, `linux/platform_device.h`, `linux/pm.h`, `drm/clients/drm_client_setup.h`, `drm/drm_atomic.h`, `drm/drm_atomic_state_helper.h`.
- Detected declarations: `struct corebootdrm_device`, `function corebootdrm_get_format_fb`, `function corebootdrm_get_width_fb`, `function corebootdrm_get_height_fb`, `function corebootdrm_get_pitch_fb`, `function corebootdrm_get_size_fb`, `function corebootdrm_get_address_fb`, `function corebootdrm_get_orientation_fb`, `function corebootdrm_mode_config_init`, `function corebootdrm_pm_suspend`.
- 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.