drivers/gpu/drm/amd/display/dc/dio/dcn32/dcn32_dio_link_encoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dio/dcn32/dcn32_dio_link_encoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dio/dcn32/dcn32_dio_link_encoder.c- Extension
.c- Size
- 17317 bytes
- Lines
- 555
- 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
reg_helper.hcore_types.hlink_encoder.hdcn31/dcn31_dio_link_encoder.hdcn32_dio_link_encoder.hstream_encoder.hdc_bios_types.hlink_enc_cfg.hdc_dmub_srv.hgpio_service_interface.h
Detected Declarations
function filesfunction enc32_hw_initfunction dcn32_link_encoder_enable_dp_outputfunction query_dp_alt_from_dmubfunction dcn32_link_encoder_is_in_alt_modefunction dcn32_link_encoder_get_max_link_capfunction link_transmitter_controlfunction dpcs32_program_eq_settingfunction dpcs32_get_txffefunction dpcs32_set_txffefunction dcn32_link_encoder_construct
Annotated Snippet
#include "reg_helper.h"
#include "core_types.h"
#include "link_encoder.h"
#include "dcn31/dcn31_dio_link_encoder.h"
#include "dcn32_dio_link_encoder.h"
#include "stream_encoder.h"
#include "dc_bios_types.h"
#include "link_enc_cfg.h"
#include "dc_dmub_srv.h"
#include "gpio_service_interface.h"
#ifndef MIN
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
#endif
#define CTX \
enc10->base.ctx
#define DC_LOGGER \
enc10->base.ctx->logger
#define REG(reg)\
(enc10->link_regs->reg)
#undef FN
#define FN(reg_name, field_name) \
enc10->link_shift->field_name, enc10->link_mask->field_name
#define AUX_REG(reg)\
(enc10->aux_regs->reg)
#define AUX_REG_READ(reg_name) \
dm_read_reg(CTX, AUX_REG(reg_name))
#define AUX_REG_WRITE(reg_name, val) \
dm_write_reg(CTX, AUX_REG(reg_name), val)
// HDMI FRL EQ Setting masks/shifts
// EQ level 0-32 bits[0:1]
#define HDMI_FRL_EQ__LEVEL__SHIFT 0x0
#define HDMI_FRL_EQ__LEVEL__MASK 0x3
// Enable no preshoot bit[5]
#define HDMI_FRL_EQ__NO_PRE__SHIFT 0x5
// Enable no demphasis bit[6]
#define HDMI_FRL_EQ__NO_DEMPH__SHIFT 0x6
// Enable no FFE bit[4]
#define HDMI_FRL_EQ__NO_FFE__SHIFT 0x4
static uint8_t phy_id_from_transmitter(enum transmitter t)
{
uint8_t phy_id;
switch (t) {
case TRANSMITTER_UNIPHY_A:
phy_id = 0;
break;
case TRANSMITTER_UNIPHY_B:
phy_id = 1;
break;
case TRANSMITTER_UNIPHY_C:
phy_id = 2;
break;
case TRANSMITTER_UNIPHY_D:
phy_id = 3;
break;
case TRANSMITTER_UNIPHY_E:
phy_id = 4;
break;
case TRANSMITTER_UNIPHY_F:
phy_id = 5;
break;
case TRANSMITTER_UNIPHY_G:
phy_id = 6;
break;
default:
phy_id = 0;
break;
}
return phy_id;
}
void enc32_hw_init(struct link_encoder *enc)
{
struct dcn10_link_encoder *enc10 = TO_DCN10_LINK_ENC(enc);
/*
00 - DP_AUX_DPHY_RX_DETECTION_THRESHOLD__1to2 : 1/2
01 - DP_AUX_DPHY_RX_DETECTION_THRESHOLD__3to4 : 3/4
02 - DP_AUX_DPHY_RX_DETECTION_THRESHOLD__7to8 : 7/8
Annotation
- Immediate include surface: `reg_helper.h`, `core_types.h`, `link_encoder.h`, `dcn31/dcn31_dio_link_encoder.h`, `dcn32_dio_link_encoder.h`, `stream_encoder.h`, `dc_bios_types.h`, `link_enc_cfg.h`.
- Detected declarations: `function files`, `function enc32_hw_init`, `function dcn32_link_encoder_enable_dp_output`, `function query_dp_alt_from_dmub`, `function dcn32_link_encoder_is_in_alt_mode`, `function dcn32_link_encoder_get_max_link_cap`, `function link_transmitter_control`, `function dpcs32_program_eq_setting`, `function dpcs32_get_txffe`, `function dpcs32_set_txffe`.
- 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.