drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c- Extension
.c- Size
- 38464 bytes
- Lines
- 1204
- 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.hcore_types.hreg_helper.hdcn20/dcn20_dpp.hbasics/conversion.hdcn10/dcn10_cm_common.h
Detected Declarations
function filesfunction dpp2_degamma_ram_inusefunction dpp2_program_degamma_lutfunction dpp2_set_degamma_pwlfunction dpp2_set_degammafunction program_gamut_remapfunction dpp2_cm_set_gamut_remapfunction read_gamut_remapfunction dpp2_cm_get_gamut_remapfunction dpp2_program_input_cscfunction dpp20_power_on_blnd_lutfunction dpp20_configure_blnd_lutfunction dpp20_program_blnd_pwlfunction dcn20_dpp_cm_get_reg_fieldfunction dpp20_program_blnd_luta_settingsfunction dpp20_program_blnd_lutb_settingsfunction dpp20_get_blndgam_currentfunction dpp20_program_blnd_lutfunction dpp20_program_shaper_lutfunction dpp20_get_shaper_currentfunction dpp20_configure_shaper_lutfunction dpp20_program_shaper_luta_settingsfunction dpp20_program_shaper_lutb_settingsfunction dpp20_program_shaperfunction get3dlut_configfunction dpp20_set_3dlut_modefunction dpp20_select_3dlut_ramfunction dpp20_set3dlut_ram12function dpp20_set3dlut_ram10function dpp20_select_3dlut_ram_maskfunction dpp20_program_3dlutfunction dpp2_set_hdr_multiplier
Annotated Snippet
if (dpp_input_csc_matrix[i].color_space == color_space) {
regval = dpp_input_csc_matrix[i].regval;
break;
}
if (regval == NULL) {
BREAK_TO_DEBUGGER();
return;
}
} else {
regval = tbl_entry->regval;
}
/* determine which CSC coefficients (A or B) we are using
* currently. select the alternate set to double buffer
* the CSC update so CSC is updated on frame boundary
*/
IX_REG_GET(CM_TEST_DEBUG_INDEX, CM_TEST_DEBUG_DATA,
CM_TEST_DEBUG_DATA_STATUS_IDX,
CM_TEST_DEBUG_DATA_ICSC_MODE, &cur_select);
if (cur_select != DCN2_ICSC_SELECT_ICSC_A)
select = DCN2_ICSC_SELECT_ICSC_A;
else
select = DCN2_ICSC_SELECT_ICSC_B;
icsc_regs.shifts.csc_c11 = dpp->tf_shift->CM_ICSC_C11;
icsc_regs.masks.csc_c11 = dpp->tf_mask->CM_ICSC_C11;
icsc_regs.shifts.csc_c12 = dpp->tf_shift->CM_ICSC_C12;
icsc_regs.masks.csc_c12 = dpp->tf_mask->CM_ICSC_C12;
if (select == DCN2_ICSC_SELECT_ICSC_A) {
icsc_regs.csc_c11_c12 = REG(CM_ICSC_C11_C12);
icsc_regs.csc_c33_c34 = REG(CM_ICSC_C33_C34);
} else {
icsc_regs.csc_c11_c12 = REG(CM_ICSC_B_C11_C12);
icsc_regs.csc_c33_c34 = REG(CM_ICSC_B_C33_C34);
}
cm_helper_program_color_matrices(
dpp->base.ctx,
regval,
&icsc_regs);
REG_SET(CM_ICSC_CONTROL, 0,
CM_ICSC_MODE, select);
}
static void dpp20_power_on_blnd_lut(
struct dpp *dpp_base,
bool power_on)
{
struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
REG_SET(CM_MEM_PWR_CTRL, 0,
BLNDGAM_MEM_PWR_FORCE, power_on == true ? 0:1);
}
static void dpp20_configure_blnd_lut(
struct dpp *dpp_base,
bool is_ram_a)
{
struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
REG_UPDATE(CM_BLNDGAM_LUT_WRITE_EN_MASK,
CM_BLNDGAM_LUT_WRITE_EN_MASK, 7);
REG_UPDATE(CM_BLNDGAM_LUT_WRITE_EN_MASK,
CM_BLNDGAM_LUT_WRITE_SEL, is_ram_a == true ? 0:1);
REG_SET(CM_BLNDGAM_LUT_INDEX, 0, CM_BLNDGAM_LUT_INDEX, 0);
}
static void dpp20_program_blnd_pwl(
struct dpp *dpp_base,
const struct pwl_result_data *rgb,
uint32_t num)
{
uint32_t i;
struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
for (i = 0 ; i < num; i++) {
REG_SET(CM_BLNDGAM_LUT_DATA, 0, CM_BLNDGAM_LUT_DATA, rgb[i].red_reg);
REG_SET(CM_BLNDGAM_LUT_DATA, 0, CM_BLNDGAM_LUT_DATA, rgb[i].green_reg);
REG_SET(CM_BLNDGAM_LUT_DATA, 0, CM_BLNDGAM_LUT_DATA, rgb[i].blue_reg);
REG_SET(CM_BLNDGAM_LUT_DATA, 0,
Annotation
- Immediate include surface: `dm_services.h`, `core_types.h`, `reg_helper.h`, `dcn20/dcn20_dpp.h`, `basics/conversion.h`, `dcn10/dcn10_cm_common.h`.
- Detected declarations: `function files`, `function dpp2_degamma_ram_inuse`, `function dpp2_program_degamma_lut`, `function dpp2_set_degamma_pwl`, `function dpp2_set_degamma`, `function program_gamut_remap`, `function dpp2_cm_set_gamut_remap`, `function read_gamut_remap`, `function dpp2_cm_get_gamut_remap`, `function dpp2_program_input_csc`.
- 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.