drivers/video/fbdev/core/fbmem.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fbmem.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/fbmem.c- Extension
.c- Size
- 18064 bytes
- Lines
- 788
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/console.hlinux/export.hlinux/fb.hlinux/lcd.hlinux/leds.hvideo/nomodeset.hfb_internal.hfbcon.h
Detected Declarations
function put_fb_infofunction fb_get_color_depthfunction fb_pad_aligned_bufferfunction fb_pad_unaligned_bufferfunction fb_imageblitfunction fb_pan_displayfunction fb_check_capsfunction fb_lcd_notify_mode_changefunction fb_set_varfunction fb_set_var_from_userfunction fb_lcd_notify_blankfunction fb_ledtrig_backlight_notify_blankfunction fb_blankfunction fb_blank_from_userfunction fb_check_foreignnessfunction do_register_framebufferfunction unbind_consolefunction unlink_framebufferfunction do_unregister_framebufferfunction register_framebufferfunction fb_openfunction devm_unregister_framebufferfunction devm_register_framebufferfunction fb_set_suspendfunction fb_switch_outputsfunction fbmem_initfunction fbmem_exitfunction fb_new_modelistfunction list_for_each_safefunction fb_modesetting_disabledmodule init fbmem_initmodule init fbmem_initexport fb_get_color_depthexport fb_pad_aligned_bufferexport fb_pad_unaligned_bufferexport fb_get_buffer_offsetexport fb_pan_displayexport fb_set_varexport fb_set_var_from_userexport fb_blankexport register_framebufferexport unregister_framebufferexport devm_register_framebufferexport fb_set_suspendexport fb_switch_outputsexport fb_modesetting_disabled
Annotated Snippet
module_init(fbmem_init);
module_exit(fbmem_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Framebuffer base");
#else
subsys_initcall(fbmem_init);
#endif
int fb_new_modelist(struct fb_info *info)
{
struct fb_var_screeninfo var = info->var;
struct list_head *pos, *n;
struct fb_modelist *modelist;
struct fb_videomode *m, mode;
int err;
list_for_each_safe(pos, n, &info->modelist) {
modelist = list_entry(pos, struct fb_modelist, list);
m = &modelist->mode;
fb_videomode_to_var(&var, m);
var.activate = FB_ACTIVATE_TEST;
err = fb_set_var(info, &var);
fb_var_to_videomode(&mode, &var);
if (err || !fb_mode_is_equal(m, &mode)) {
list_del(pos);
kfree(pos);
}
}
if (list_empty(&info->modelist))
return 1;
fbcon_new_modelist(info);
return 0;
}
bool fb_modesetting_disabled(const char *drvname)
{
bool fwonly = video_firmware_drivers_only();
if (fwonly)
pr_warn("Driver %s not loading because of nomodeset parameter\n",
drvname);
return fwonly;
}
EXPORT_SYMBOL(fb_modesetting_disabled);
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/console.h`, `linux/export.h`, `linux/fb.h`, `linux/lcd.h`, `linux/leds.h`, `video/nomodeset.h`, `fb_internal.h`, `fbcon.h`.
- Detected declarations: `function put_fb_info`, `function fb_get_color_depth`, `function fb_pad_aligned_buffer`, `function fb_pad_unaligned_buffer`, `function fb_imageblit`, `function fb_pan_display`, `function fb_check_caps`, `function fb_lcd_notify_mode_change`, `function fb_set_var`, `function fb_set_var_from_user`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: integration 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.