drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c- Extension
.c- Size
- 62796 bytes
- Lines
- 2372
- 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.hdce/dce_11_0_d.hdce/dce_11_0_sh_mask.hdc_types.hdc_bios_types.hdc.hinclude/grph_object_id.hinclude/logger_interface.hdce110_timing_generator.htiming_generator.h
Detected Declarations
function filesfunction dce110_timing_generator_is_in_vertical_blankfunction dce110_timing_generator_set_early_controlfunction dce110_timing_generator_enable_crtcfunction dce110_timing_generator_program_blank_colorfunction disable_stereofunction dce110_timing_generator_disable_crtcfunction program_horz_count_by_2function dce110_timing_generator_program_timing_generatorfunction dce110_timing_generator_set_drrfunction dce110_timing_generator_set_static_screen_controlfunction dce110_timing_generator_get_vblank_counterfunction dce110_timing_generator_get_positionfunction dce110_timing_generator_get_crtc_scanoutposfunction dce110_timing_generator_program_blankingfunction dce110_timing_generator_set_test_patternfunction dce110_timing_generator_validate_timingfunction dce110_timing_generator_wait_for_vblankfunction VActivefunction dce110_timing_generator_setup_global_swap_lockfunction dce110_timing_generator_tear_down_global_swap_lockfunction dce110_timing_generator_is_counter_movingfunction dce110_timing_generator_enable_advanced_requestfunction dce110_timing_generator_set_lock_masterfunction dce110_timing_generator_enable_reset_triggerfunction dce110_timing_generator_enable_crtc_resetfunction dce110_timing_generator_disable_reset_triggerfunction dce110_timing_generator_did_triggered_reset_occurfunction dce110_timing_generator_disable_vgafunction dce110_timing_generator_set_overscan_color_blackfunction dce110_tg_program_blank_colorfunction dce110_tg_set_overscan_colorfunction dce110_tg_program_timingfunction dce110_tg_is_blankedfunction dce110_tg_set_blankfunction dce110_tg_validate_timingfunction dce110_is_two_pixels_per_containerfunction dce110_tg_wait_for_statefunction dce110_tg_set_colorsfunction dce110_arm_vert_intrfunction dce110_is_tg_enabledfunction dce110_configure_crcfunction dce110_get_crcfunction dce110_timing_generator_construct
Annotated Snippet
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);
/* CRTC_TEST_PATTERN_DATA has 16 bits,
* lowest 6 are hardwired to ZERO
* color bits should be left aligned aligned to MSB
* XXXXXXXXXX000000 for 10 bit,
* XXXXXXXX00000000 for 8 bit and XXXXXX0000000000 for 6
*/
dst_color[index] <<= (16 - dst_bpc);
}
value = 0;
addr = CRTC_REG(mmCRTC_TEST_PATTERN_PARAMETERS);
dm_write_reg(ctx, addr, value);
/* We have to write the mask before data, similar to pipeline.
* For example, for 8 bpc, if we want RGB0 to be magenta,
* and RGB1 to be cyan,
* we need to make 7 writes:
* MASK DATA
* 000001 00000000 00000000 set mask to R0
* 000010 11111111 00000000 R0 255, 0xFF00, set mask to G0
* 000100 00000000 00000000 G0 0, 0x0000, set mask to B0
* 001000 11111111 00000000 B0 255, 0xFF00, set mask to R1
* 010000 00000000 00000000 R1 0, 0x0000, set mask to G1
* 100000 11111111 00000000 G1 255, 0xFF00, set mask to B1
* 100000 11111111 00000000 B1 255, 0xFF00
*
* we will make a loop of 6 in which we prepare the mask,
* then write, then prepare the color for next write.
* first iteration will write mask only,
* but each next iteration color prepared in
* previous iteration will be written within new mask,
* the last component will written separately,
* mask is not changing between 6th and 7th write
* and color will be prepared by last iteration
*/
/* write color, color values mask in CRTC_TEST_PATTERN_MASK
* is B1, G1, R1, B0, G0, R0
*/
value = 0;
addr = CRTC_REG(mmCRTC_TEST_PATTERN_COLOR);
for (index = 0; index < 6; index++) {
/* prepare color mask, first write PATTERN_DATA
* will have all zeros
*/
set_reg_field_value(
value,
(1 << index),
CRTC_TEST_PATTERN_COLOR,
CRTC_TEST_PATTERN_MASK);
/* write color component */
dm_write_reg(ctx, addr, value);
/* prepare next color component,
* will be written in the next iteration
*/
set_reg_field_value(
value,
dst_color[index],
CRTC_TEST_PATTERN_COLOR,
CRTC_TEST_PATTERN_DATA);
}
/* write last color component,
* it's been already prepared in the loop
*/
dm_write_reg(ctx, addr, value);
/* enable test pattern */
addr = CRTC_REG(mmCRTC_TEST_PATTERN_CONTROL);
Annotation
- Immediate include surface: `dm_services.h`, `dce/dce_11_0_d.h`, `dce/dce_11_0_sh_mask.h`, `dc_types.h`, `dc_bios_types.h`, `dc.h`, `include/grph_object_id.h`, `include/logger_interface.h`.
- Detected declarations: `function files`, `function dce110_timing_generator_is_in_vertical_blank`, `function dce110_timing_generator_set_early_control`, `function dce110_timing_generator_enable_crtc`, `function dce110_timing_generator_program_blank_color`, `function disable_stereo`, `function dce110_timing_generator_disable_crtc`, `function program_horz_count_by_2`, `function dce110_timing_generator_program_timing_generator`, `function dce110_timing_generator_set_drr`.
- 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.