drivers/gpu/drm/drm_modes.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/drm_modes.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/drm_modes.c- Extension
.c- Size
- 81288 bytes
- Lines
- 2779
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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/ctype.hlinux/export.hlinux/fb.hlinux/list.hlinux/list_sort.hlinux/of.hvideo/of_display_timing.hvideo/of_videomode.hvideo/videomode.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_edid.hdrm/drm_modes.hdrm/drm_print.hdrm_crtc_internal.h
Detected Declarations
struct analog_param_fieldstruct analog_param_rangestruct analog_parametersstruct drm_named_modeenum drm_mode_analogfunction Copyrightfunction drm_mode_destroyfunction drm_mode_probed_addfunction fill_analog_modefunction VESAfunction drm_mode_createfunction Morrishfunction drm_display_mode_from_videomodefunction drm_display_mode_to_videomodefunction DRM_BUS_FLAG_DE_function of_get_drm_display_modefunction of_get_drm_panel_display_modefunction drm_mode_set_namefunction drm_mode_vrefreshfunction drm_mode_get_hv_timingfunction eyesfunction drm_mode_copyfunction drm_mode_initfunction drm_mode_match_timingsfunction drm_mode_match_clockfunction drm_mode_match_flagsfunction drm_mode_match_3d_flagsfunction drm_mode_match_aspect_ratiofunction arefunction drm_mode_equalfunction drm_mode_equal_no_clocksfunction drm_mode_equal_no_clocks_no_stereofunction drm_mode_validate_basicfunction drm_mode_validate_driverfunction drm_mode_validate_sizefunction drm_mode_validate_ycbcr420function drm_mode_prune_invalidfunction list_for_each_entry_safefunction drm_mode_comparefunction drm_mode_sortfunction drm_connector_list_updatefunction list_for_each_entry_safefunction list_for_each_entryfunction stalefunction drm_mode_parse_cmdline_bppfunction drm_mode_parse_cmdline_refreshfunction drm_mode_parse_cmdline_extrafunction drm_mode_parse_cmdline_res_mode
Annotated Snippet
struct analog_param_field {
unsigned int even, odd;
};
#define PARAM_FIELD(_odd, _even) \
{ .even = _even, .odd = _odd }
struct analog_param_range {
unsigned int min, typ, max;
};
#define PARAM_RANGE(_min, _typ, _max) \
{ .min = _min, .typ = _typ, .max = _max }
struct analog_parameters {
unsigned int num_lines;
unsigned int line_duration_ns;
struct analog_param_range hact_ns;
struct analog_param_range hfp_ns;
struct analog_param_range hslen_ns;
struct analog_param_range hbp_ns;
struct analog_param_range hblk_ns;
unsigned int bt601_hfp;
struct analog_param_field vfp_lines;
struct analog_param_field vslen_lines;
struct analog_param_field vbp_lines;
};
#define TV_MODE_PARAMETER(_mode, _lines, _line_dur, _hact, _hfp, \
_hslen, _hbp, _hblk, _bt601_hfp, _vfp, \
_vslen, _vbp) \
[_mode] = { \
.num_lines = _lines, \
.line_duration_ns = _line_dur, \
.hact_ns = _hact, \
.hfp_ns = _hfp, \
.hslen_ns = _hslen, \
.hbp_ns = _hbp, \
.hblk_ns = _hblk, \
.bt601_hfp = _bt601_hfp, \
.vfp_lines = _vfp, \
.vslen_lines = _vslen, \
.vbp_lines = _vbp, \
}
static const struct analog_parameters tv_modes_parameters[] = {
TV_MODE_PARAMETER(DRM_MODE_ANALOG_NTSC,
NTSC_LINES_NUMBER,
NTSC_LINE_DURATION_NS,
PARAM_RANGE(NTSC_HACT_DURATION_MIN_NS,
NTSC_HACT_DURATION_TYP_NS,
NTSC_HACT_DURATION_MAX_NS),
PARAM_RANGE(NTSC_HFP_DURATION_MIN_NS,
NTSC_HFP_DURATION_TYP_NS,
NTSC_HFP_DURATION_MAX_NS),
PARAM_RANGE(NTSC_HSLEN_DURATION_MIN_NS,
NTSC_HSLEN_DURATION_TYP_NS,
NTSC_HSLEN_DURATION_MAX_NS),
PARAM_RANGE(NTSC_HBP_DURATION_MIN_NS,
NTSC_HBP_DURATION_TYP_NS,
NTSC_HBP_DURATION_MAX_NS),
PARAM_RANGE(NTSC_HBLK_DURATION_MIN_NS,
NTSC_HBLK_DURATION_TYP_NS,
NTSC_HBLK_DURATION_MAX_NS),
16,
PARAM_FIELD(3, 3),
PARAM_FIELD(3, 3),
PARAM_FIELD(16, 17)),
TV_MODE_PARAMETER(DRM_MODE_ANALOG_PAL,
PAL_LINES_NUMBER,
PAL_LINE_DURATION_NS,
PARAM_RANGE(PAL_HACT_DURATION_MIN_NS,
PAL_HACT_DURATION_TYP_NS,
PAL_HACT_DURATION_MAX_NS),
PARAM_RANGE(PAL_HFP_DURATION_MIN_NS,
PAL_HFP_DURATION_TYP_NS,
PAL_HFP_DURATION_MAX_NS),
PARAM_RANGE(PAL_HSLEN_DURATION_MIN_NS,
PAL_HSLEN_DURATION_TYP_NS,
PAL_HSLEN_DURATION_MAX_NS),
PARAM_RANGE(PAL_HBP_DURATION_MIN_NS,
PAL_HBP_DURATION_TYP_NS,
PAL_HBP_DURATION_MAX_NS),
PARAM_RANGE(PAL_HBLK_DURATION_MIN_NS,
PAL_HBLK_DURATION_TYP_NS,
PAL_HBLK_DURATION_MAX_NS),
12,
Annotation
- Immediate include surface: `linux/ctype.h`, `linux/export.h`, `linux/fb.h`, `linux/list.h`, `linux/list_sort.h`, `linux/of.h`, `video/of_display_timing.h`, `video/of_videomode.h`.
- Detected declarations: `struct analog_param_field`, `struct analog_param_range`, `struct analog_parameters`, `struct drm_named_mode`, `enum drm_mode_analog`, `function Copyright`, `function drm_mode_destroy`, `function drm_mode_probed_add`, `function fill_analog_mode`, `function VESA`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.