drivers/gpu/drm/display/drm_hdmi_state_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_hdmi_state_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_hdmi_state_helper.c- Extension
.c- Size
- 37350 bytes
- Lines
- 1211
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hdrm/drm_atomic.hdrm/drm_connector.hdrm/drm_edid.hdrm/drm_modes.hdrm/drm_print.hdrm/display/drm_hdmi_audio_helper.hdrm/display/drm_hdmi_cec_helper.hdrm/display/drm_hdmi_helper.hdrm/display/drm_hdmi_state_helper.h
Detected Declarations
function rangesfunction output_color_format_to_hdmi_colorspacefunction connector_state_get_modefunction hdmi_is_limited_rangefunction sink_supports_format_bpcfunction timingfunction hdmi_clock_validfunction hdmi_compute_clockfunction hdmi_try_format_bpcfunction hdmi_compute_format_bpcfunction hdmi_compute_configfunction hdmi_generate_avi_infoframefunction hdmi_generate_spd_infoframefunction hdmi_generate_hdr_infoframefunction hdmi_generate_hdmi_vendor_infoframefunction hdmi_generate_infoframesfunction drm_atomic_helper_connector_hdmi_checkfunction drm_hdmi_connector_mode_validfunction clear_infoframefunction write_infoframefunction write_or_clear_infoframefunction drm_atomic_helper_connector_hdmi_update_infoframesfunction drm_atomic_helper_connector_hdmi_update_audio_infoframefunction drm_atomic_helper_connector_hdmi_clear_audio_infoframefunction drm_atomic_helper_connector_hdmi_updatefunction drm_atomic_helper_connector_hdmi_hotplugfunction drm_atomic_helper_connector_hdmi_forceexport __drm_atomic_helper_connector_hdmi_resetexport drm_atomic_helper_connector_hdmi_checkexport drm_hdmi_connector_mode_validexport drm_atomic_helper_connector_hdmi_update_infoframesexport drm_atomic_helper_connector_hdmi_update_audio_infoframeexport drm_atomic_helper_connector_hdmi_clear_audio_infoframeexport drm_atomic_helper_connector_hdmi_hotplugexport drm_atomic_helper_connector_hdmi_force
Annotated Snippet
if (bpc == 10 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30)) {
drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n");
return false;
}
if (bpc == 12 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_36)) {
drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n");
return false;
}
drm_dbg_kms(dev, "RGB format supported in that configuration.\n");
return true;
case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n");
if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) {
drm_dbg_kms(dev, "Sink doesn't support YUV420.\n");
return false;
}
if (!drm_mode_is_420(info, mode)) {
drm_dbg_kms(dev, "Mode cannot be supported in YUV420 format.\n");
return false;
}
if (bpc == 10 && !(info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_30)) {
drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n");
return false;
}
if (bpc == 12 && !(info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_36)) {
drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n");
return false;
}
if (bpc == 16 && !(info->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_48)) {
drm_dbg_kms(dev, "16 BPC but sink doesn't support Deep Color 48.\n");
return false;
}
drm_dbg_kms(dev, "YUV420 format supported in that configuration.\n");
return true;
case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n");
if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) {
drm_dbg_kms(dev, "Sink doesn't support YUV422.\n");
return false;
}
if (bpc > 12) {
drm_dbg_kms(dev, "YUV422 only supports 12 bpc or lower.\n");
return false;
}
/*
* HDMI Spec 1.3 - Section 6.5 Pixel Encodings and Color Depth
* states that Deep Color is not relevant for YUV422 so we
* don't need to check the Deep Color bits in the EDIDs here.
*/
drm_dbg_kms(dev, "YUV422 format supported in that configuration.\n");
return true;
case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n");
if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))) {
drm_dbg_kms(dev, "Sink doesn't support YUV444.\n");
return false;
}
if (bpc == 10 && !(info->edid_hdmi_ycbcr444_dc_modes & DRM_EDID_HDMI_DC_30)) {
drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n");
return false;
}
if (bpc == 12 && !(info->edid_hdmi_ycbcr444_dc_modes & DRM_EDID_HDMI_DC_36)) {
drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n");
return false;
}
drm_dbg_kms(dev, "YUV444 format supported in that configuration.\n");
return true;
Annotation
- Immediate include surface: `linux/export.h`, `drm/drm_atomic.h`, `drm/drm_connector.h`, `drm/drm_edid.h`, `drm/drm_modes.h`, `drm/drm_print.h`, `drm/display/drm_hdmi_audio_helper.h`, `drm/display/drm_hdmi_cec_helper.h`.
- Detected declarations: `function ranges`, `function output_color_format_to_hdmi_colorspace`, `function connector_state_get_mode`, `function hdmi_is_limited_range`, `function sink_supports_format_bpc`, `function timing`, `function hdmi_clock_valid`, `function hdmi_compute_clock`, `function hdmi_try_format_bpc`, `function hdmi_compute_format_bpc`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.