drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c- Extension
.c- Size
- 52337 bytes
- Lines
- 1593
- 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.hdcn30_mpc.hdcn30/dcn30_cm_common.hbasics/conversion.hdcn10/dcn10_cm_common.hdc.h
Detected Declarations
function filesfunction mpc3_mpc_init_single_instfunction mpc3_is_dwb_idlefunction mpc3_set_dwb_muxfunction mpc3_disable_dwb_muxfunction mpc3_set_out_rate_controlfunction mpc3_get_ogam_currentfunction mpc3_power_on_ogam_lutfunction mpc3_configure_ogam_lutfunction mpc3_ogam_get_reg_fieldfunction mpc3_program_lutafunction mpc3_program_lutbfunction mpc3_program_ogam_pwlfunction mpc3_set_output_gammafunction mpc3_set_denormfunction mpc3_set_denorm_clampfunction mpc3_get_shaper_currentfunction mpc3_configure_shaper_lutfunction mpc3_program_shaper_luta_settingsfunction mpc3_program_shaper_lutb_settingsfunction mpc3_program_shaper_lutfunction mpc3_power_on_shaper_3dlutfunction mpc3_program_shaperfunction mpc3_set_3dlut_modefunction get3dlut_configfunction mpc3_select_3dlut_ramfunction mpc3_select_3dlut_ram_maskfunction mpc3_set3dlut_ram12function mpc3_set3dlut_ram10function mpc3_init_mpccfunction program_gamut_remapfunction mpc3_set_gamut_remapfunction read_gamut_remapfunction mpc3_get_gamut_remapfunction mpc3_program_3dlutfunction mpc3_set_output_cscfunction mpc3_set_ocsc_defaultfunction mpc3_set_rmu_muxfunction mpc3_get_rmu_mux_statusfunction mpcc3_acquire_rmufunction mpcc3_release_rmufunction mpc3_set_mpc_mem_lp_modefunction mpc3_read_mpcc_statefunction mpc3_read_reg_statefunction dcn30_mpc_construct
Annotated Snippet
switch (state_ram_lut_in_use) {
case 0:
mode = LUT_RAM_A;
break;
case 1:
mode = LUT_RAM_B;
break;
default:
mode = LUT_BYPASS;
break;
}
break;
default:
mode = LUT_BYPASS;
break;
}
return mode;
}
void mpc3_power_on_ogam_lut(
struct mpc *mpc, int mpcc_id,
bool power_on)
{
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
/*
* Powering on: force memory active so the LUT can be updated.
* Powering off: allow entering memory low power mode
*
* Memory low power mode is controlled during MPC OGAM LUT init.
*/
REG_UPDATE(MPCC_MEM_PWR_CTRL[mpcc_id],
MPCC_OGAM_MEM_PWR_DIS, power_on != 0);
/* Wait for memory to be powered on - we won't be able to write to it otherwise. */
if (power_on)
REG_WAIT(MPCC_MEM_PWR_CTRL[mpcc_id], MPCC_OGAM_MEM_PWR_STATE, 0, 10, 10);
}
static void mpc3_configure_ogam_lut(
struct mpc *mpc, int mpcc_id,
bool is_ram_a)
{
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
REG_UPDATE_2(MPCC_OGAM_LUT_CONTROL[mpcc_id],
MPCC_OGAM_LUT_WRITE_COLOR_MASK, 7,
MPCC_OGAM_LUT_HOST_SEL, is_ram_a == true ? 0:1);
REG_SET(MPCC_OGAM_LUT_INDEX[mpcc_id], 0, MPCC_OGAM_LUT_INDEX, 0);
}
static void mpc3_ogam_get_reg_field(
struct mpc *mpc,
struct dcn3_xfer_func_reg *reg)
{
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
reg->shifts.field_region_start_base = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_START_BASE_B;
reg->masks.field_region_start_base = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_START_BASE_B;
reg->shifts.field_offset = mpc30->mpc_shift->MPCC_OGAM_RAMA_OFFSET_B;
reg->masks.field_offset = mpc30->mpc_mask->MPCC_OGAM_RAMA_OFFSET_B;
reg->shifts.exp_region0_lut_offset = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION0_LUT_OFFSET;
reg->masks.exp_region0_lut_offset = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION0_LUT_OFFSET;
reg->shifts.exp_region0_num_segments = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION0_NUM_SEGMENTS;
reg->masks.exp_region0_num_segments = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION0_NUM_SEGMENTS;
reg->shifts.exp_region1_lut_offset = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION1_LUT_OFFSET;
reg->masks.exp_region1_lut_offset = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION1_LUT_OFFSET;
reg->shifts.exp_region1_num_segments = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION1_NUM_SEGMENTS;
reg->masks.exp_region1_num_segments = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION1_NUM_SEGMENTS;
reg->shifts.field_region_end = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_END_B;
reg->masks.field_region_end = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_END_B;
reg->shifts.field_region_end_slope = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_END_SLOPE_B;
reg->masks.field_region_end_slope = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_END_SLOPE_B;
reg->shifts.field_region_end_base = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_END_BASE_B;
reg->masks.field_region_end_base = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_END_BASE_B;
reg->shifts.field_region_linear_slope = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_START_SLOPE_B;
reg->masks.field_region_linear_slope = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_START_SLOPE_B;
reg->shifts.exp_region_start = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_START_B;
reg->masks.exp_region_start = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_START_B;
reg->shifts.exp_resion_start_segment = mpc30->mpc_shift->MPCC_OGAM_RAMA_EXP_REGION_START_SEGMENT_B;
reg->masks.exp_resion_start_segment = mpc30->mpc_mask->MPCC_OGAM_RAMA_EXP_REGION_START_SEGMENT_B;
}
static void mpc3_program_luta(struct mpc *mpc, int mpcc_id,
const struct pwl_params *params)
{
Annotation
- Immediate include surface: `reg_helper.h`, `dcn30_mpc.h`, `dcn30/dcn30_cm_common.h`, `basics/conversion.h`, `dcn10/dcn10_cm_common.h`, `dc.h`.
- Detected declarations: `function files`, `function mpc3_mpc_init_single_inst`, `function mpc3_is_dwb_idle`, `function mpc3_set_dwb_mux`, `function mpc3_disable_dwb_mux`, `function mpc3_set_out_rate_control`, `function mpc3_get_ogam_current`, `function mpc3_power_on_ogam_lut`, `function mpc3_configure_ogam_lut`, `function mpc3_ogam_get_reg_field`.
- 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.