drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c- Extension
.c- Size
- 47200 bytes
- Lines
- 1688
- 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.hdcn10_optc.hdc.hdc_trace.h
Detected Declarations
function filesfunction optc1_program_global_syncfunction optc1_disable_stereofunction optc1_setup_vertical_interrupt0function optc1_setup_vertical_interrupt1function optc1_setup_vertical_interrupt2function optc1_program_timingfunction optc1_set_vtg_paramsfunction optc1_set_blank_data_double_bufferfunction optc1_set_timing_double_bufferfunction optc1_unblank_crtcfunction optc1_blank_crtcfunction optc1_set_blankfunction optc1_is_blankedfunction optc1_enable_optc_clockfunction optc1_enable_crtcfunction optc1_disable_crtcfunction optc1_program_blank_colorfunction optc1_validate_timingfunction optc1_get_vblank_counterfunction optc1_lockfunction optc1_unlockfunction optc1_get_positionfunction optc1_is_counter_movingfunction optc1_did_triggered_reset_occurfunction optc1_disable_reset_triggerfunction optc1_enable_reset_triggerfunction optc1_enable_crtc_resetfunction optc1_wait_for_statefunction optc1_set_early_controlfunction optc1_set_static_screen_controlfunction optc1_setup_manual_triggerfunction optc1_program_manual_triggerfunction optc1_set_drrfunction optc1_set_vtotal_min_maxfunction optc1_set_test_patternfunction optc1_get_crtc_scanoutposfunction optc1_enable_stereofunction optc1_program_stereofunction optc1_is_stereo_left_eyefunction optc1_get_hw_timingfunction optc1_read_otg_statefunction optc1_get_otg_active_sizefunction optc1_clear_optc_underflowfunction optc1_tg_initfunction optc1_is_tg_enabledfunction optc1_is_optc_underflow_occurredfunction optc1_configure_crc
Annotated Snippet
if (patched_crtc_timing.flags.INTERLACE == 1) {
v_init = v_init / 2;
if ((uint32_t)((optc1->vstartup_start/2)*2) > asic_blank_end)
v_fp2 = v_fp2 / 2;
}
}
if (program_fp2)
REG_UPDATE_2(CONTROL,
VTG0_FP2, v_fp2,
VTG0_VCOUNT_INIT, v_init);
else
REG_UPDATE(CONTROL, VTG0_VCOUNT_INIT, v_init);
}
void optc1_set_blank_data_double_buffer(struct timing_generator *optc, bool enable)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
uint32_t blank_data_double_buffer_enable = enable ? 1 : 0;
REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
OTG_BLANK_DATA_DOUBLE_BUFFER_EN, blank_data_double_buffer_enable);
}
/**
* optc1_set_timing_double_buffer() - DRR double buffering control
*
* Sets double buffer point for V_TOTAL, H_TOTAL, VTOTAL_MIN,
* VTOTAL_MAX, VTOTAL_MIN_SEL and VTOTAL_MAX_SEL registers.
*
* @optc: timing_generator instance.
* @enable: Enable DRR double buffering control if true, disable otherwise.
*
* Options: any time, start of frame, dp start of frame (range timing)
*/
void optc1_set_timing_double_buffer(struct timing_generator *optc, bool enable)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
uint32_t mode = enable ? 2 : 0;
REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
OTG_RANGE_TIMING_DBUF_UPDATE_MODE, mode);
}
/**
* optc1_unblank_crtc() - Call ASIC Control Object to UnBlank CRTC.
*
* @optc: timing_generator instance.
*/
static void optc1_unblank_crtc(struct timing_generator *optc)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
REG_UPDATE_2(OTG_BLANK_CONTROL,
OTG_BLANK_DATA_EN, 0,
OTG_BLANK_DE_MODE, 0);
/* W/A for automated testing
* Automated testing will fail underflow test as there
* sporadic underflows which occur during the optc blank
* sequence. As a w/a, clear underflow on unblank.
* This prevents the failure, but will not mask actual
* underflow that affect real use cases.
*/
optc1_clear_optc_underflow(optc);
}
/**
* optc1_blank_crtc() - Call ASIC Control Object to Blank CRTC.
*
* @optc: timing_generator instance.
*/
static void optc1_blank_crtc(struct timing_generator *optc)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
REG_UPDATE_2(OTG_BLANK_CONTROL,
OTG_BLANK_DATA_EN, 1,
OTG_BLANK_DE_MODE, 0);
optc1_set_blank_data_double_buffer(optc, false);
}
void optc1_set_blank(struct timing_generator *optc,
bool enable_blanking)
{
if (enable_blanking)
optc1_blank_crtc(optc);
Annotation
- Immediate include surface: `reg_helper.h`, `dcn10_optc.h`, `dc.h`, `dc_trace.h`.
- Detected declarations: `function files`, `function optc1_program_global_sync`, `function optc1_disable_stereo`, `function optc1_setup_vertical_interrupt0`, `function optc1_setup_vertical_interrupt1`, `function optc1_setup_vertical_interrupt2`, `function optc1_program_timing`, `function optc1_set_vtg_params`, `function optc1_set_blank_data_double_buffer`, `function optc1_set_timing_double_buffer`.
- 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.