drivers/gpu/drm/clients/drm_fbdev_client.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/clients/drm_fbdev_client.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/clients/drm_fbdev_client.c- Extension
.c- Size
- 4413 bytes
- Lines
- 177
- 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.
- 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
drm/drm_client.hdrm/drm_crtc_helper.hdrm/drm_drv.hdrm/drm_fb_helper.hdrm/drm_fourcc.hdrm/drm_print.hdrm_client_internal.h
Detected Declarations
function drm_fbdev_client_freefunction drm_fbdev_client_unregisterfunction drm_fbdev_client_restorefunction drm_fbdev_client_hotplugfunction drm_fbdev_client_suspendfunction drm_fbdev_client_resumefunction drm_fbdev_client_setup
Annotated Snippet
switch (bpp) {
case 16:
color_mode = format->depth; // could also be 15
break;
default:
color_mode = bpp;
}
} else {
switch (dev->mode_config.preferred_depth) {
case 0:
case 24:
color_mode = 32;
break;
default:
color_mode = dev->mode_config.preferred_depth;
}
}
drm_WARN(dev, !dev->registered, "Device has not been registered.\n");
drm_WARN(dev, dev->fb_helper, "fb_helper is already set!\n");
fb_helper = kzalloc_obj(*fb_helper);
if (!fb_helper)
return -ENOMEM;
drm_fb_helper_prepare(dev, fb_helper, color_mode, NULL);
ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
if (ret) {
drm_err(dev, "Failed to register client: %d\n", ret);
goto err_drm_client_init;
}
drm_client_register(&fb_helper->client);
return 0;
err_drm_client_init:
drm_fb_helper_unprepare(fb_helper);
kfree(fb_helper);
return ret;
}
Annotation
- Immediate include surface: `drm/drm_client.h`, `drm/drm_crtc_helper.h`, `drm/drm_drv.h`, `drm/drm_fb_helper.h`, `drm/drm_fourcc.h`, `drm/drm_print.h`, `drm_client_internal.h`.
- Detected declarations: `function drm_fbdev_client_free`, `function drm_fbdev_client_unregister`, `function drm_fbdev_client_restore`, `function drm_fbdev_client_hotplug`, `function drm_fbdev_client_suspend`, `function drm_fbdev_client_resume`, `function drm_fbdev_client_setup`.
- 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.