drivers/gpu/drm/radeon/atombios_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/atombios_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/atombios_crtc.c- Extension
.c- Size
- 72138 bytes
- Lines
- 2229
- 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
drm/drm_fixed.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_modeset_helper_vtables.hdrm/drm_vblank.hdrm/radeon_drm.hradeon.hatom.hatom-bits.h
Detected Declarations
function filesfunction atombios_scaler_setupfunction atombios_lock_crtcfunction atombios_enable_crtcfunction atombios_enable_crtc_memreqfunction atombios_blank_crtcfunction atombios_powergate_crtcfunction atombios_crtc_dpmsfunction atombios_set_crtc_dtd_timingfunction atombios_crtc_set_timingfunction atombios_disable_ssfunction atombios_crtc_program_ssfunction atombios_adjust_pllfunction atombios_crtc_set_disp_eng_pllfunction atombios_crtc_program_pllfunction atombios_crtc_prepare_pllfunction atombios_crtc_set_pllfunction dce4_crtc_do_set_basefunction avivo_crtc_do_set_basefunction atombios_crtc_set_basefunction radeon_legacy_atom_fixupfunction PPLLsfunction list_for_each_entryfunction PPLLfunction list_for_each_entryfunction PPLLfunction list_for_each_entryfunction PPLLfunction radeon_atom_disp_eng_pll_initfunction atombios_crtc_mode_setfunction atombios_crtc_mode_fixupfunction atombios_crtc_preparefunction atombios_crtc_commitfunction atombios_crtc_disablefunction radeon_atombios_init_crtc
Annotated Snippet
if (a1 > a2) {
args.usOverscanLeft = cpu_to_le16((adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2);
args.usOverscanRight = cpu_to_le16((adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2);
} else if (a2 > a1) {
args.usOverscanTop = cpu_to_le16((adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2);
args.usOverscanBottom = cpu_to_le16((adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2);
}
break;
case RMX_FULL:
default:
args.usOverscanRight = cpu_to_le16(radeon_crtc->h_border);
args.usOverscanLeft = cpu_to_le16(radeon_crtc->h_border);
args.usOverscanBottom = cpu_to_le16(radeon_crtc->v_border);
args.usOverscanTop = cpu_to_le16(radeon_crtc->v_border);
break;
}
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
}
static void atombios_scaler_setup(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct radeon_device *rdev = dev->dev_private;
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
ENABLE_SCALER_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, EnableScaler);
struct radeon_encoder *radeon_encoder =
to_radeon_encoder(radeon_crtc->encoder);
/* fixme - fill in enc_priv for atom dac */
enum radeon_tv_std tv_std = TV_STD_NTSC;
bool is_tv = false, is_cv = false;
if (!ASIC_IS_AVIVO(rdev) && radeon_crtc->crtc_id)
return;
if (radeon_encoder->active_device & ATOM_DEVICE_TV_SUPPORT) {
struct radeon_encoder_atom_dac *tv_dac = radeon_encoder->enc_priv;
tv_std = tv_dac->tv_std;
is_tv = true;
}
memset(&args, 0, sizeof(args));
args.ucScaler = radeon_crtc->crtc_id;
if (is_tv) {
switch (tv_std) {
case TV_STD_NTSC:
default:
args.ucTVStandard = ATOM_TV_NTSC;
break;
case TV_STD_PAL:
args.ucTVStandard = ATOM_TV_PAL;
break;
case TV_STD_PAL_M:
args.ucTVStandard = ATOM_TV_PALM;
break;
case TV_STD_PAL_60:
args.ucTVStandard = ATOM_TV_PAL60;
break;
case TV_STD_NTSC_J:
args.ucTVStandard = ATOM_TV_NTSCJ;
break;
case TV_STD_SCART_PAL:
args.ucTVStandard = ATOM_TV_PAL; /* ??? */
break;
case TV_STD_SECAM:
args.ucTVStandard = ATOM_TV_SECAM;
break;
case TV_STD_PAL_CN:
args.ucTVStandard = ATOM_TV_PALCN;
break;
}
args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
} else if (is_cv) {
args.ucTVStandard = ATOM_TV_CV;
args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
} else {
switch (radeon_crtc->rmx_type) {
case RMX_FULL:
args.ucEnable = ATOM_SCALER_EXPANSION;
break;
case RMX_CENTER:
args.ucEnable = ATOM_SCALER_CENTER;
break;
case RMX_ASPECT:
args.ucEnable = ATOM_SCALER_EXPANSION;
break;
default:
if (ASIC_IS_AVIVO(rdev))
Annotation
- Immediate include surface: `drm/drm_fixed.h`, `drm/drm_fourcc.h`, `drm/drm_framebuffer.h`, `drm/drm_modeset_helper_vtables.h`, `drm/drm_vblank.h`, `drm/radeon_drm.h`, `radeon.h`, `atom.h`.
- Detected declarations: `function files`, `function atombios_scaler_setup`, `function atombios_lock_crtc`, `function atombios_enable_crtc`, `function atombios_enable_crtc_memreq`, `function atombios_blank_crtc`, `function atombios_powergate_crtc`, `function atombios_crtc_dpms`, `function atombios_set_crtc_dtd_timing`, `function atombios_crtc_set_timing`.
- 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.