drivers/gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c- Extension
.c- Size
- 11589 bytes
- Lines
- 429
- 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
core_types.hdm_services.hdcn20_opp.hreg_helper.h
Detected Declarations
function filesfunction opp2_program_dpg_dimensionsfunction opp2_dpg_set_blank_colorfunction opp2_dpg_is_blankedfunction opp2_dpg_is_pendingfunction opp2_program_left_edge_extra_pixelfunction opp2_get_left_edge_extra_pixel_countfunction opp2_read_reg_statefunction dcn20_opp_construct
Annotated Snippet
switch (color_space) {
case CONTROLLER_DP_COLOR_SPACE_YCBCR601:
mode = TEST_PATTERN_MODE_COLORSQUARES_YCBCR601;
break;
case CONTROLLER_DP_COLOR_SPACE_YCBCR709:
mode = TEST_PATTERN_MODE_COLORSQUARES_YCBCR709;
break;
case CONTROLLER_DP_COLOR_SPACE_RGB:
default:
mode = TEST_PATTERN_MODE_COLORSQUARES_RGB;
break;
}
REG_UPDATE_6(DPG_CONTROL,
DPG_EN, 1,
DPG_MODE, mode,
DPG_DYNAMIC_RANGE, dyn_range,
DPG_BIT_DEPTH, bit_depth,
DPG_VRES, 6,
DPG_HRES, 6);
}
break;
case CONTROLLER_DP_TEST_PATTERN_VERTICALBARS:
case CONTROLLER_DP_TEST_PATTERN_HORIZONTALBARS:
{
mode = (test_pattern ==
CONTROLLER_DP_TEST_PATTERN_VERTICALBARS ?
TEST_PATTERN_MODE_VERTICALBARS :
TEST_PATTERN_MODE_HORIZONTALBARS);
switch (bit_depth) {
case TEST_PATTERN_COLOR_FORMAT_BPC_6:
dst_bpc = 6;
break;
case TEST_PATTERN_COLOR_FORMAT_BPC_8:
dst_bpc = 8;
break;
case TEST_PATTERN_COLOR_FORMAT_BPC_10:
dst_bpc = 10;
break;
default:
dst_bpc = 8;
break;
}
/* adjust color to the required colorFormat */
for (index = 0; index < 6; index++) {
/* dst = 2^dstBpc * src / 2^srcBpc = src >>
* (srcBpc - dstBpc);
*/
dst_color[index] =
src_color[index] >> (src_bpc - dst_bpc);
/* DPG_COLOUR registers are 16-bit MSB aligned value with bits 3:0 hardwired to ZERO.
* XXXXXXXXXX000000 for 10 bit,
* XXXXXXXX00000000 for 8 bit,
* XXXXXX0000000000 for 6 bits
*/
dst_color[index] <<= (16 - dst_bpc);
}
REG_SET_2(DPG_COLOUR_R_CR, 0,
DPG_COLOUR1_R_CR, dst_color[0],
DPG_COLOUR0_R_CR, dst_color[3]);
REG_SET_2(DPG_COLOUR_G_Y, 0,
DPG_COLOUR1_G_Y, dst_color[1],
DPG_COLOUR0_G_Y, dst_color[4]);
REG_SET_2(DPG_COLOUR_B_CB, 0,
DPG_COLOUR1_B_CB, dst_color[2],
DPG_COLOUR0_B_CB, dst_color[5]);
/* enable test pattern */
REG_UPDATE_6(DPG_CONTROL,
DPG_EN, 1,
DPG_MODE, mode,
DPG_DYNAMIC_RANGE, 0,
DPG_BIT_DEPTH, bit_depth,
DPG_VRES, 0,
DPG_HRES, 0);
}
break;
case CONTROLLER_DP_TEST_PATTERN_COLORRAMP:
{
mode = (bit_depth ==
TEST_PATTERN_COLOR_FORMAT_BPC_10 ?
TEST_PATTERN_MODE_DUALRAMP_RGB :
TEST_PATTERN_MODE_SINGLERAMP_RGB);
switch (bit_depth) {
Annotation
- Immediate include surface: `core_types.h`, `dm_services.h`, `dcn20_opp.h`, `reg_helper.h`.
- Detected declarations: `function files`, `function opp2_program_dpg_dimensions`, `function opp2_dpg_set_blank_color`, `function opp2_dpg_is_blanked`, `function opp2_dpg_is_pending`, `function opp2_program_left_edge_extra_pixel`, `function opp2_get_left_edge_extra_pixel_count`, `function opp2_read_reg_state`, `function dcn20_opp_construct`.
- 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.