drivers/video/hdmi.c
Source file repositories/reference/linux-study-clean/drivers/video/hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/hdmi.c- Extension
.c- Size
- 52794 bytes
- Lines
- 1922
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/display/drm_dp.hlinux/bitops.hlinux/bug.hlinux/errno.hlinux/export.hlinux/hdmi.hlinux/string.hlinux/device.h
Detected Declarations
function Copyrightfunction hdmi_infoframe_set_checksumfunction hdmi_avi_infoframe_initfunction hdmi_avi_infoframe_check_onlyfunction hdmi_avi_infoframe_checkfunction hdmi_avi_infoframe_pack_onlyfunction hdmi_avi_infoframe_packfunction hdmi_spd_infoframe_initfunction hdmi_spd_infoframe_check_onlyfunction hdmi_spd_infoframe_checkfunction hdmi_spd_infoframe_pack_onlyfunction hdmi_spd_infoframe_packfunction hdmi_audio_infoframe_initfunction hdmi_audio_infoframe_check_onlyfunction hdmi_audio_infoframe_checkfunction hdmi_audio_infoframe_pack_payloadfunction hdmi_audio_infoframe_pack_onlyfunction hdmi_audio_infoframe_packfunction hdmi_audio_infoframe_pack_for_dpfunction hdmi_vendor_infoframe_initfunction hdmi_vendor_infoframe_lengthfunction hdmi_vendor_infoframe_check_onlyfunction hdmi_vendor_infoframe_checkfunction hdmi_vendor_infoframe_pack_onlyfunction hdmi_vendor_infoframe_packfunction hdmi_vendor_any_infoframe_check_onlyfunction hdmi_drm_infoframe_initfunction hdmi_drm_infoframe_check_onlyfunction hdmi_drm_infoframe_checkfunction hdmi_drm_infoframe_pack_onlyfunction hdmi_drm_infoframe_packfunction hdmi_vendor_any_infoframe_checkfunction hdmi_vendor_any_infoframe_pack_onlyfunction hdmi_vendor_any_infoframe_packfunction hdmi_infoframe_pack_onlyfunction hdmi_infoframe_packfunction hdmi_infoframe_log_headerfunction hdmi_picture_aspect_get_namefunction hdmi_active_aspect_get_namefunction hdmi_extended_colorimetry_get_namefunction hdmi_quantization_range_get_namefunction hdmi_ycc_quantization_range_get_namefunction hdmi_content_type_get_namefunction hdmi_avi_infoframe_logfunction hdmi_spd_infoframe_logfunction hdmi_audio_coding_type_get_namefunction hdmi_audio_sample_size_get_namefunction hdmi_audio_sample_frequency_get_name
Annotated Snippet
if (hvf->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) {
if (length != 6)
return -EINVAL;
hvf->s3d_ext_data = ptr[5] >> 4;
}
} else if (hdmi_video_format == 0x1) {
if (length != 5)
return -EINVAL;
hvf->vic = ptr[4];
} else {
if (length != 4)
return -EINVAL;
}
return 0;
}
/**
* hdmi_drm_infoframe_unpack_only() - unpack binary buffer of CTA-861-G DRM
* infoframe DataBytes to a HDMI DRM
* infoframe
* @frame: HDMI DRM infoframe
* @buffer: source buffer
* @size: size of buffer
*
* Unpacks CTA-861-G DRM infoframe DataBytes contained in the binary @buffer
* into a structured @frame of the HDMI Dynamic Range and Mastering (DRM)
* infoframe.
*
* Returns 0 on success or a negative error code on failure.
*/
int hdmi_drm_infoframe_unpack_only(struct hdmi_drm_infoframe *frame,
const void *buffer, size_t size)
{
const u8 *ptr = buffer;
const u8 *temp;
u8 x_lsb, x_msb;
u8 y_lsb, y_msb;
int ret;
int i;
if (size < HDMI_DRM_INFOFRAME_SIZE)
return -EINVAL;
ret = hdmi_drm_infoframe_init(frame);
if (ret)
return ret;
frame->eotf = ptr[0] & 0x7;
frame->metadata_type = ptr[1] & 0x7;
temp = ptr + 2;
for (i = 0; i < 3; i++) {
x_lsb = *temp++;
x_msb = *temp++;
frame->display_primaries[i].x = (x_msb << 8) | x_lsb;
y_lsb = *temp++;
y_msb = *temp++;
frame->display_primaries[i].y = (y_msb << 8) | y_lsb;
}
frame->white_point.x = (ptr[15] << 8) | ptr[14];
frame->white_point.y = (ptr[17] << 8) | ptr[16];
frame->max_display_mastering_luminance = (ptr[19] << 8) | ptr[18];
frame->min_display_mastering_luminance = (ptr[21] << 8) | ptr[20];
frame->max_cll = (ptr[23] << 8) | ptr[22];
frame->max_fall = (ptr[25] << 8) | ptr[24];
return 0;
}
EXPORT_SYMBOL(hdmi_drm_infoframe_unpack_only);
/**
* hdmi_drm_infoframe_unpack() - unpack binary buffer to a HDMI DRM infoframe
* @frame: HDMI DRM infoframe
* @buffer: source buffer
* @size: size of buffer
*
* Unpacks the CTA-861-G DRM infoframe contained in the binary @buffer into
* a structured @frame of the HDMI Dynamic Range and Mastering (DRM)
* infoframe. It also verifies the checksum as required by section 5.3.5 of
* the HDMI 1.4 specification.
*
* Returns 0 on success or a negative error code on failure.
*/
static int hdmi_drm_infoframe_unpack(struct hdmi_drm_infoframe *frame,
const void *buffer, size_t size)
{
const u8 *ptr = buffer;
Annotation
- Immediate include surface: `drm/display/drm_dp.h`, `linux/bitops.h`, `linux/bug.h`, `linux/errno.h`, `linux/export.h`, `linux/hdmi.h`, `linux/string.h`, `linux/device.h`.
- Detected declarations: `function Copyright`, `function hdmi_infoframe_set_checksum`, `function hdmi_avi_infoframe_init`, `function hdmi_avi_infoframe_check_only`, `function hdmi_avi_infoframe_check`, `function hdmi_avi_infoframe_pack_only`, `function hdmi_avi_infoframe_pack`, `function hdmi_spd_infoframe_init`, `function hdmi_spd_infoframe_check_only`, `function hdmi_spd_infoframe_check`.
- 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.