drivers/video/fbdev/core/modedb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/modedb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/modedb.c- Extension
.c- Size
- 36725 bytes
- Lines
- 1209
- 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.
- 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/export.hlinux/module.hlinux/slab.hlinux/fb.hlinux/kernel.h
Detected Declarations
function fb_try_modefunction VESAfunction fb_var_to_videomodefunction fb_videomode_to_varfunction fb_mode_is_equalfunction list_for_each_entryfunction list_for_each_entryfunction fb_add_videomodefunction list_for_each_entryfunction fb_delete_videomodefunction list_for_each_safefunction fb_destroy_modelistfunction list_for_each_safefunction fb_videomode_to_modelistexport vesa_modesexport dmt_modesexport fb_destroy_modelistexport fb_find_best_displayexport fb_videomode_to_varexport fb_var_to_videomodeexport fb_mode_is_equalexport fb_add_videomodeexport fb_match_modeexport fb_find_best_modeexport fb_find_nearest_modeexport fb_videomode_to_modelistexport fb_find_modeexport fb_find_mode_cvt
Annotated Snippet
switch (name[i]) {
case '@':
namelen = i;
if (!refresh_specified && !bpp_specified &&
!yres_specified) {
refresh = simple_strtol(&name[i+1], NULL,
10);
refresh_specified = 1;
if (cvt || rb)
cvt = 0;
} else
goto done;
break;
case '-':
namelen = i;
if (!bpp_specified && !yres_specified) {
bpp = simple_strtol(&name[i+1], NULL,
10);
bpp_specified = 1;
if (cvt || rb)
cvt = 0;
} else
goto done;
break;
case 'x':
if (!yres_specified) {
yres = simple_strtol(&name[i+1], NULL,
10);
yres_specified = 1;
} else
goto done;
break;
case '0' ... '9':
break;
case 'M':
if (!yres_specified)
cvt = 1;
break;
case 'R':
if (!cvt)
rb = 1;
break;
case 'm':
if (!cvt)
margins = 1;
break;
case 'p':
if (!cvt) {
interlace = 0;
interlace_specified = 1;
}
break;
case 'i':
if (!cvt) {
interlace = 1;
interlace_specified = 1;
}
break;
default:
goto done;
}
}
if (i < 0 && yres_specified) {
xres = simple_strtol(name, NULL, 10);
res_specified = 1;
}
done:
if (cvt) {
struct fb_videomode cvt_mode;
int ret;
DPRINTK("CVT mode %dx%d@%dHz%s%s%s\n", xres, yres,
(refresh) ? refresh : 60,
(rb) ? " reduced blanking" : "",
(margins) ? " with margins" : "",
(interlace) ? " interlaced" : "");
memset(&cvt_mode, 0, sizeof(cvt_mode));
cvt_mode.xres = xres;
cvt_mode.yres = yres;
cvt_mode.refresh = (refresh) ? refresh : 60;
if (interlace)
cvt_mode.vmode |= FB_VMODE_INTERLACED;
else
cvt_mode.vmode &= ~FB_VMODE_INTERLACED;
ret = fb_find_mode_cvt(&cvt_mode, margins, rb);
if (!ret && !fb_try_mode(var, info, &cvt_mode, bpp)) {
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/slab.h`, `linux/fb.h`, `linux/kernel.h`.
- Detected declarations: `function fb_try_mode`, `function VESA`, `function fb_var_to_videomode`, `function fb_videomode_to_var`, `function fb_mode_is_equal`, `function list_for_each_entry`, `function list_for_each_entry`, `function fb_add_videomode`, `function list_for_each_entry`, `function fb_delete_videomode`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: integration implementation candidate.
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.