drivers/gpu/drm/radeon/radeon_connectors.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/radeon_connectors.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/radeon_connectors.c- Extension
.c- Size
- 84506 bytes
- Lines
- 2525
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/display/drm_dp_mst_helper.hdrm/drm_edid.hdrm/drm_crtc_helper.hdrm/drm_modeset_helper_vtables.hdrm/drm_probe_helper.hdrm/radeon_drm.hradeon.hradeon_audio.hatom.hlinux/pm_runtime.hlinux/vga_switcheroo.h
Detected Declarations
struct mode_sizefunction filesfunction radeon_property_change_modefunction radeon_get_monitor_bpcfunction radeon_connector_update_scratch_regsfunction drm_connector_for_each_possible_encoderfunction drm_connector_for_each_possible_encoderfunction radeon_connector_get_edidfunction radeon_ddc_get_modesfunction radeon_get_native_modefunction radeon_connector_analog_encoder_conflict_solvefunction list_for_each_entryfunction drm_connector_for_each_possible_encoderfunction radeon_add_common_modesfunction radeon_connector_set_propertyfunction radeon_fixup_lvds_native_modefunction list_for_each_entry_safefunction radeon_lvds_get_modesfunction radeon_lvds_mode_validfunction radeon_lvds_detectfunction radeon_connector_unregisterfunction radeon_connector_destroyfunction radeon_lvds_set_propertyfunction radeon_vga_get_modesfunction radeon_vga_mode_validfunction radeon_vga_detectfunction linefunction radeon_tv_get_modesfunction radeon_tv_mode_validfunction radeon_tv_detectfunction radeon_check_hpd_status_unchangedfunction elsefunction linefunction list_for_each_entryfunction drm_connector_for_each_possible_encoderfunction drm_connector_for_each_possible_encoderfunction radeon_dvi_forcefunction radeon_dvi_mode_validfunction radeon_dp_get_modesfunction radeon_connector_encoder_get_dp_bridge_encoder_idfunction drm_connector_for_each_possible_encoderfunction radeon_connector_encoder_is_hbr2function drm_connector_for_each_possible_encoderfunction radeon_connector_is_dp12_capablefunction radeon_dp_detectfunction radeon_dp_mode_validfunction radeon_connector_late_registerfunction radeon_add_atom_connector
Annotated Snippet
struct mode_size {
int w;
int h;
} common_modes[17] = {
{ 640, 480},
{ 720, 480},
{ 800, 600},
{ 848, 480},
{1024, 768},
{1152, 768},
{1280, 720},
{1280, 800},
{1280, 854},
{1280, 960},
{1280, 1024},
{1440, 900},
{1400, 1050},
{1680, 1050},
{1600, 1200},
{1920, 1080},
{1920, 1200}
};
for (i = 0; i < 17; i++) {
if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) {
if (common_modes[i].w > 1024 ||
common_modes[i].h > 768)
continue;
}
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
if (common_modes[i].w > native_mode->hdisplay ||
common_modes[i].h > native_mode->vdisplay ||
(common_modes[i].w == native_mode->hdisplay &&
common_modes[i].h == native_mode->vdisplay))
continue;
}
if (common_modes[i].w < 320 || common_modes[i].h < 200)
continue;
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, 60, false, false, false);
if (!mode)
continue;
drm_mode_probed_add(connector, mode);
}
}
static int radeon_connector_set_property(struct drm_connector *connector, struct drm_property *property,
uint64_t val)
{
struct drm_device *dev = connector->dev;
struct radeon_device *rdev = dev->dev_private;
struct drm_encoder *encoder;
struct radeon_encoder *radeon_encoder;
if (property == rdev->mode_info.coherent_mode_property) {
struct radeon_encoder_atom_dig *dig;
bool new_coherent_mode;
/* need to find digital encoder on connector */
encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);
if (!encoder)
return 0;
radeon_encoder = to_radeon_encoder(encoder);
if (!radeon_encoder->enc_priv)
return 0;
dig = radeon_encoder->enc_priv;
new_coherent_mode = val ? true : false;
if (dig->coherent_mode != new_coherent_mode) {
dig->coherent_mode = new_coherent_mode;
radeon_property_change_mode(&radeon_encoder->base);
}
}
if (property == rdev->mode_info.audio_property) {
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
/* need to find digital encoder on connector */
encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);
if (!encoder)
return 0;
radeon_encoder = to_radeon_encoder(encoder);
if (radeon_connector->audio != val) {
radeon_connector->audio = val;
radeon_property_change_mode(&radeon_encoder->base);
}
Annotation
- Immediate include surface: `drm/display/drm_dp_mst_helper.h`, `drm/drm_edid.h`, `drm/drm_crtc_helper.h`, `drm/drm_modeset_helper_vtables.h`, `drm/drm_probe_helper.h`, `drm/radeon_drm.h`, `radeon.h`, `radeon_audio.h`.
- Detected declarations: `struct mode_size`, `function files`, `function radeon_property_change_mode`, `function radeon_get_monitor_bpc`, `function radeon_connector_update_scratch_regs`, `function drm_connector_for_each_possible_encoder`, `function drm_connector_for_each_possible_encoder`, `function radeon_connector_get_edid`, `function radeon_ddc_get_modes`, `function radeon_get_native_mode`.
- 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.