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.

Dependency Surface

Detected Declarations

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

Implementation Notes