drivers/gpu/drm/amd/display/dc/bios/command_table.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/bios/command_table.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/bios/command_table.c- Extension
.c- Size
- 81877 bytes
- Lines
- 2694
- 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
dm_services.hamdgpu.hatom.hinclude/bios_parser_interface.hcommand_table.hcommand_table_helper.hbios_parser_helper.hbios_parser_types_internal.h
Detected Declarations
function dal_bios_parser_init_cmd_tblfunction bios_cmd_table_para_revisionfunction init_dig_encoder_controlfunction init_encoder_control_dig_v1function encoder_control_dig_v1function encoder_control_dig1_v1function encoder_control_dig2_v1function dc_color_depth_to_atomfunction encoder_control_digx_v3function encoder_control_digx_v4function encoder_control_digx_v5function init_transmitter_controlfunction transmitter_control_v2function transmitter_control_v3function transmitter_control_v4function transmitter_control_v1_5function transmitter_control_v1_6function init_set_pixel_clockfunction set_pixel_clock_v3function set_pixel_clock_v5function set_pixel_clock_v6function set_pixel_clock_v7function init_enable_spread_spectrum_on_ppllfunction enable_spread_spectrum_on_ppll_v1function enable_spread_spectrum_on_ppll_v2function enable_spread_spectrum_on_ppll_v3function init_adjust_display_pllfunction adjust_display_pll_v2function adjust_display_pll_v3function init_select_crtc_sourcefunction select_crtc_source_v1function select_crtc_source_v2_encoder_idfunction select_crtc_source_v2_encoder_modefunction select_crtc_source_v2function select_crtc_source_v3function init_dac_encoder_controlfunction dac_encoder_control_prepare_paramsfunction dac1_encoder_control_v1function dac2_encoder_control_v1function init_dac_load_detectionfunction dac_load_detect_prepare_paramsfunction dac_load_detection_v1function dac_load_detection_v3function init_dac_output_controlfunction dac1_output_control_v1function dac2_output_control_v1function init_set_crtc_timingfunction set_crtc_timing_v1
Annotated Snippet
switch (cntl->engine_id) {
case ENGINE_ID_DIGA:
if (cmd_tbl->encoder_control_dig1 != NULL)
result =
cmd_tbl->encoder_control_dig1(bp, cntl);
break;
case ENGINE_ID_DIGB:
if (cmd_tbl->encoder_control_dig2 != NULL)
result =
cmd_tbl->encoder_control_dig2(bp, cntl);
break;
default:
break;
}
return result;
}
static enum bp_result encoder_control_dig1_v1(
struct bios_parser *bp,
struct bp_encoder_control *cntl)
{
enum bp_result result = BP_RESULT_FAILURE;
DIG_ENCODER_CONTROL_PARAMETERS_V2 params = {0};
bp->cmd_helper->assign_control_parameter(bp->cmd_helper, cntl, ¶ms);
if (EXEC_BIOS_CMD_TABLE(DIG1EncoderControl, params))
result = BP_RESULT_OK;
return result;
}
static enum bp_result encoder_control_dig2_v1(
struct bios_parser *bp,
struct bp_encoder_control *cntl)
{
enum bp_result result = BP_RESULT_FAILURE;
DIG_ENCODER_CONTROL_PARAMETERS_V2 params = {0};
bp->cmd_helper->assign_control_parameter(bp->cmd_helper, cntl, ¶ms);
if (EXEC_BIOS_CMD_TABLE(DIG2EncoderControl, params))
result = BP_RESULT_OK;
return result;
}
static uint8_t dc_color_depth_to_atom(enum dc_color_depth color_depth)
{
switch (color_depth) {
case COLOR_DEPTH_UNDEFINED:
return PANEL_BPC_UNDEFINE;
case COLOR_DEPTH_666:
return PANEL_6BIT_PER_COLOR;
default:
case COLOR_DEPTH_888:
return PANEL_8BIT_PER_COLOR;
case COLOR_DEPTH_101010:
return PANEL_10BIT_PER_COLOR;
case COLOR_DEPTH_121212:
return PANEL_12BIT_PER_COLOR;
case COLOR_DEPTH_141414:
dm_error("14-bit color not supported by ATOMBIOS\n");
return PANEL_BPC_UNDEFINE;
case COLOR_DEPTH_161616:
return PANEL_16BIT_PER_COLOR;
}
}
static enum bp_result encoder_control_digx_v3(
struct bios_parser *bp,
struct bp_encoder_control *cntl)
{
enum bp_result result = BP_RESULT_FAILURE;
DIG_ENCODER_CONTROL_PARAMETERS_V3 params = {0};
if (LANE_COUNT_FOUR < cntl->lanes_number)
params.acConfig.ucDPLinkRate = 1; /* dual link 2.7GHz */
else
params.acConfig.ucDPLinkRate = 0; /* single link 1.62GHz */
params.acConfig.ucDigSel = (uint8_t)(cntl->engine_id);
/* We need to convert from KHz units into 10KHz units */
params.ucAction = bp->cmd_helper->encoder_action_to_atom(cntl->action);
params.usPixelClock = cpu_to_le16((uint16_t)(cntl->pixel_clock / 10));
params.ucEncoderMode =
(uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom(
Annotation
- Immediate include surface: `dm_services.h`, `amdgpu.h`, `atom.h`, `include/bios_parser_interface.h`, `command_table.h`, `command_table_helper.h`, `bios_parser_helper.h`, `bios_parser_types_internal.h`.
- Detected declarations: `function dal_bios_parser_init_cmd_tbl`, `function bios_cmd_table_para_revision`, `function init_dig_encoder_control`, `function init_encoder_control_dig_v1`, `function encoder_control_dig_v1`, `function encoder_control_dig1_v1`, `function encoder_control_dig2_v1`, `function dc_color_depth_to_atom`, `function encoder_control_digx_v3`, `function encoder_control_digx_v4`.
- 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.