drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c- Extension
.c- Size
- 16919 bytes
- Lines
- 585
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dc_bios_types.hdcn30/dcn30_dio_stream_encoder.hdcn32/dcn32_dio_stream_encoder.hdcn35/dcn35_dio_stream_encoder.hdcn401/dcn401_dio_stream_encoder.hdcn31/dcn31_apg.hdcn42_dio_stream_encoder.hreg_helper.hhw_shared.hlink_service.hdpcd_defs.h
Detected Declarations
function enc42_stream_encoder_hdmi_set_stream_attributefunction enc42_stream_encoder_stop_dp_info_packetsfunction enc42_stream_encoder_update_hdmi_info_packetsfunction enc42_dp_set_dsc_pps_info_packetfunction enc42_se_dp_audio_setupfunction enc42_se_setup_dp_audiofunction enc42_se_dp_audio_enablefunction enc42_se_disable_dp_audiofunction enc42_se_dp_audio_disablefunction enc42_se_setup_hdmi_audiofunction enc42_se_hdmi_audio_disablefunction enc42_se_enable_audio_clockfunction enc42_se_hdmi_audio_setupfunction enc42_audio_mute_controlfunction enc42_reset_hdmi_stream_attributefunction enc42_dio_get_uncompressed_dp_pixel_formatfunction dcn42_dio_stream_encoder_construct
Annotated Snippet
if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DEEP_COLOR_DEPTH, 1,
HDMI_DEEP_COLOR_ENABLE, 0);
} else {
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DEEP_COLOR_DEPTH, 1,
HDMI_DEEP_COLOR_ENABLE, 1);
}
break;
case COLOR_DEPTH_121212:
if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DEEP_COLOR_DEPTH, 2,
HDMI_DEEP_COLOR_ENABLE, 0);
} else {
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DEEP_COLOR_DEPTH, 2,
HDMI_DEEP_COLOR_ENABLE, 1);
}
break;
case COLOR_DEPTH_161616:
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DEEP_COLOR_DEPTH, 3,
HDMI_DEEP_COLOR_ENABLE, 1);
break;
default:
break;
}
if (actual_pix_clk_khz >= HDMI_CLOCK_CHANNEL_RATE_MORE_340M) {
/* enable HDMI data scrambler
* HDMI_CLOCK_CHANNEL_RATE_MORE_340M
* Clock channel frequency is 1/4 of character rate.
*/
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DATA_SCRAMBLE_EN, 1,
HDMI_CLOCK_CHANNEL_RATE, 1);
} else if (crtc_timing->flags.LTE_340MCSC_SCRAMBLE) {
/* TODO: New feature for DCE11, still need to implement */
/* enable HDMI data scrambler
* HDMI_CLOCK_CHANNEL_FREQ_EQUAL_TO_CHAR_RATE
* Clock channel frequency is the same
* as character rate
*/
REG_UPDATE_2(HDMI_CONTROL,
HDMI_DATA_SCRAMBLE_EN, 1,
HDMI_CLOCK_CHANNEL_RATE, 0);
}
/* Enable transmission of General Control packet on every frame */
REG_UPDATE_3(HDMI_VBI_PACKET_CONTROL,
HDMI_GC_CONT, 1,
HDMI_GC_SEND, 1,
HDMI_NULL_SEND, 1);
/* Disable Audio Content Protection packet transmission */
REG_UPDATE(HDMI_VBI_PACKET_CONTROL, HDMI_ACP_SEND, 0);
/* following belongs to audio */
/* Enable Audio InfoFrame packet transmission. */
REG_UPDATE(HDMI_INFOFRAME_CONTROL0, HDMI_AUDIO_INFO_SEND, 1);
/* Select line number on which to send Audio InfoFrame packets */
REG_UPDATE(HDMI_INFOFRAME_CONTROL0, HDMI_AUDIO_INFO_LINE,
VBI_LINE_0 + 2);
/* set HDMI GC AVMUTE */
REG_UPDATE(HDMI_GC, HDMI_GC_AVMUTE, 0);
}
static void enc42_stream_encoder_stop_dp_info_packets(
struct stream_encoder *enc)
{
/* stop generic packets on DP */
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
uint32_t value = 0;
REG_SET_9(DP_SEC_CNTL, 0,
DP_SEC_GSP0_ENABLE, 0,
DP_SEC_GSP1_ENABLE, 0,
DP_SEC_GSP2_ENABLE, 0,
DP_SEC_GSP3_ENABLE, 0,
DP_SEC_GSP4_ENABLE, 0,
DP_SEC_GSP5_ENABLE, 0,
DP_SEC_GSP6_ENABLE, 0,
DP_SEC_GSP7_ENABLE, 0,
DP_SEC_STREAM_ENABLE, 0);
Annotation
- Immediate include surface: `dc_bios_types.h`, `dcn30/dcn30_dio_stream_encoder.h`, `dcn32/dcn32_dio_stream_encoder.h`, `dcn35/dcn35_dio_stream_encoder.h`, `dcn401/dcn401_dio_stream_encoder.h`, `dcn31/dcn31_apg.h`, `dcn42_dio_stream_encoder.h`, `reg_helper.h`.
- Detected declarations: `function enc42_stream_encoder_hdmi_set_stream_attribute`, `function enc42_stream_encoder_stop_dp_info_packets`, `function enc42_stream_encoder_update_hdmi_info_packets`, `function enc42_dp_set_dsc_pps_info_packet`, `function enc42_se_dp_audio_setup`, `function enc42_se_setup_dp_audio`, `function enc42_se_dp_audio_enable`, `function enc42_se_disable_dp_audio`, `function enc42_se_dp_audio_disable`, `function enc42_se_setup_hdmi_audio`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.