drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c- Extension
.c- Size
- 17504 bytes
- Lines
- 583
- 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.hdcn20_optc.hdc.h
Detected Declarations
function filesfunction optc2_set_gslfunction optc2_set_gsl_source_selectfunction optc2_set_dsc_configfunction optc2_get_dsc_statusfunction optc2_set_odm_bypassfunction optc2_set_odm_combinefunction optc2_get_optc_sourcefunction optc2_set_dwb_sourcefunction optc2_align_vblanksfunction optc2_triplebuffer_lockfunction optc2_triplebuffer_unlockfunction optc2_lock_doublebuffer_enablefunction optc2_lock_doublebuffer_disablefunction optc2_setup_manual_triggerfunction optc2_program_manual_triggerfunction optc2_configure_crcfunction optc2_get_last_used_drr_vtotalfunction dcn20_timing_generator_init
Annotated Snippet
#include "reg_helper.h"
#include "dcn20_optc.h"
#include "dc.h"
#define REG(reg)\
optc1->tg_regs->reg
#define CTX \
optc1->base.ctx
#undef FN
#define FN(reg_name, field_name) \
optc1->tg_shift->field_name, optc1->tg_mask->field_name
/**
* optc2_enable_crtc() - Enable CRTC - call ASIC Control Object to enable Timing generator.
*
* @optc: timing_generator instance.
*
* Return: If CRTC is enabled, return true.
*
*/
bool optc2_enable_crtc(struct timing_generator *optc)
{
/* TODO FPGA wait for answer
* OTG_MASTER_UPDATE_MODE != CRTC_MASTER_UPDATE_MODE
* OTG_MASTER_UPDATE_LOCK != CRTC_MASTER_UPDATE_LOCK
*/
struct optc *optc1 = DCN10TG_FROM_TG(optc);
/* opp instance for OTG. For DCN1.0, ODM is remoed.
* OPP and OPTC should 1:1 mapping
*/
REG_UPDATE(OPTC_DATA_SOURCE_SELECT,
OPTC_SEG0_SRC_SEL, optc->inst);
/* VTG enable first is for HW workaround */
REG_UPDATE(CONTROL,
VTG0_ENABLE, 1);
REG_SEQ_START();
/* Enable CRTC */
REG_UPDATE_2(OTG_CONTROL,
OTG_DISABLE_POINT_CNTL, 3,
OTG_MASTER_EN, 1);
REG_SEQ_SUBMIT();
REG_SEQ_WAIT_DONE();
return true;
}
/**
* optc2_set_gsl() - Assign OTG to GSL groups,
* set one of the OTGs to be master & rest are slaves
*
* @optc: timing_generator instance.
* @params: pointer to gsl_params
*/
void optc2_set_gsl(struct timing_generator *optc,
const struct gsl_params *params)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
/*
* There are (MAX_OPTC+1)/2 gsl groups available for use.
* In each group (assign an OTG to a group by setting OTG_GSLX_EN = 1,
* set one of the OTGs to be the master (OTG_GSL_MASTER_EN = 1) and the rest are slaves.
*/
REG_UPDATE_5(OTG_GSL_CONTROL,
OTG_GSL0_EN, params->gsl0_en,
OTG_GSL1_EN, params->gsl1_en,
OTG_GSL2_EN, params->gsl2_en,
OTG_GSL_MASTER_EN, params->gsl_master_en,
OTG_GSL_MASTER_MODE, params->gsl_master_mode);
}
void optc2_set_gsl_source_select(
struct timing_generator *optc,
int group_idx,
uint32_t gsl_ready_signal)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
switch (group_idx) {
case 1:
REG_UPDATE(GSL_SOURCE_SELECT, GSL0_READY_SOURCE_SEL, gsl_ready_signal);
break;
Annotation
- Immediate include surface: `reg_helper.h`, `dcn20_optc.h`, `dc.h`.
- Detected declarations: `function files`, `function optc2_set_gsl`, `function optc2_set_gsl_source_select`, `function optc2_set_dsc_config`, `function optc2_get_dsc_status`, `function optc2_set_odm_bypass`, `function optc2_set_odm_combine`, `function optc2_get_optc_source`, `function optc2_set_dwb_source`, `function optc2_align_vblanks`.
- 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.