drivers/gpu/drm/sysfb/efidrm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sysfb/efidrm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sysfb/efidrm.c- Extension
.c- Size
- 11148 bytes
- Lines
- 434
- 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/efi.hlinux/limits.hlinux/platform_device.hlinux/sysfb.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_edid.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.hvideo/pixel_format.hdrm_sysfb_helper.h
Detected Declarations
struct efidrm_devicefunction efidrm_get_mem_flagsfunction efidrm_pm_suspendfunction efidrm_pm_resumefunction efidrm_probefunction efidrm_remove
Annotated Snippet
struct efidrm_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 efidrm_primary_plane_format_modifiers[] = {
DRM_SYSFB_PLANE_FORMAT_MODIFIERS,
};
static const struct drm_plane_helper_funcs efidrm_primary_plane_helper_funcs = {
DRM_SYSFB_PLANE_HELPER_FUNCS,
};
static const struct drm_plane_funcs efidrm_primary_plane_funcs = {
DRM_SYSFB_PLANE_FUNCS,
.destroy = drm_plane_cleanup,
};
static const struct drm_crtc_helper_funcs efidrm_crtc_helper_funcs = {
DRM_SYSFB_CRTC_HELPER_FUNCS,
};
static const struct drm_crtc_funcs efidrm_crtc_funcs = {
DRM_SYSFB_CRTC_FUNCS,
.destroy = drm_crtc_cleanup,
};
static const struct drm_encoder_funcs efidrm_encoder_funcs = {
.destroy = drm_encoder_cleanup,
};
static const struct drm_connector_helper_funcs efidrm_connector_helper_funcs = {
DRM_SYSFB_CONNECTOR_HELPER_FUNCS,
};
static const struct drm_connector_funcs efidrm_connector_funcs = {
DRM_SYSFB_CONNECTOR_FUNCS,
.destroy = drm_connector_cleanup,
};
static const struct drm_mode_config_funcs efidrm_mode_config_funcs = {
DRM_SYSFB_MODE_CONFIG_FUNCS,
};
/*
* Init / Cleanup
*/
static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
struct platform_device *pdev)
{
const struct sysfb_display_info *dpy;
const struct screen_info *si;
const struct drm_format_info *format;
int width, height, stride;
u64 vsize, mem_flags;
struct resource resbuf;
struct resource *res;
struct efidrm_device *efi;
struct drm_sysfb_device *sysfb;
struct drm_device *dev;
struct resource *mem = NULL;
struct drm_plane *primary_plane;
struct drm_crtc *crtc;
struct drm_encoder *encoder;
struct drm_connector *connector;
unsigned long max_width, max_height;
size_t nformats;
int ret;
dpy = dev_get_platdata(&pdev->dev);
if (!dpy)
return ERR_PTR(-ENODEV);
si = &dpy->screen;
if (screen_info_video_type(si) != VIDEO_TYPE_EFI)
return ERR_PTR(-ENODEV);
/*
* EFI DRM driver
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/efi.h`, `linux/limits.h`, `linux/platform_device.h`, `linux/sysfb.h`, `linux/pm.h`, `drm/clients/drm_client_setup.h`, `drm/drm_atomic.h`.
- Detected declarations: `struct efidrm_device`, `function efidrm_get_mem_flags`, `function efidrm_pm_suspend`, `function efidrm_pm_resume`, `function efidrm_probe`, `function efidrm_remove`.
- 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.