drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c- Extension
.c- Size
- 39588 bytes
- Lines
- 1307
- 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
link_edp_panel_control.hlink_dpcd.hlink_dp_capability.hdm_helpers.hdal_asic_id.hlink_dp_phy.hdce/dmub_psr.hdc/dc_dmub_srv.hdce/dmub_replay.habm.hresource.hlink_dp_panel_replay.h
Detected Declarations
function dp_set_panel_modefunction dp_get_panel_modefunction edp_set_backlight_level_nitsfunction edp_get_backlight_level_nitsfunction edp_backlight_enable_auxfunction read_default_bl_auxfunction set_default_brightness_auxfunction edp_is_ilr_optimization_enabledfunction get_max_edp_link_ratefunction edp_is_ilr_optimization_requiredfunction edp_panel_backlight_power_onfunction edp_set_panel_powerfunction edp_wait_for_t12function edp_add_delay_for_T9function edp_receiver_ready_T9function edp_receiver_ready_T7function edp_power_alpm_dpcd_enablefunction edp_set_backlight_levelfunction edp_set_psr_allow_activefunction edp_get_psr_statefunction transmitter_to_phy_idfunction edp_setup_psrfunction edp_get_psr_residencyfunction edp_set_sink_vtotal_in_psr_activefunction edp_set_replay_allow_activefunction edp_get_replay_statefunction edp_setup_freesync_replayfunction edp_send_replay_cmdfunction edp_set_coasting_vtotalfunction edp_replay_residencyfunction edp_set_replay_power_opt_and_coasting_vtotalfunction edp_get_backlight_levelfunction edp_get_target_backlight_pwmfunction is_smartmux_suportedfunction edp_set_assr_enablefunction edp_set_panel_assr
Annotated Snippet
switch (link->dpcd_caps.branch_dev_id) {
case DP_BRANCH_DEVICE_ID_0022B9:
/* alternate scrambler reset is required for Travis
* for the case when external chip does not
* provide sink device id, alternate scrambler
* scheme will be overriden later by querying
* Encoder features
*/
if (strncmp(
link->dpcd_caps.branch_dev_name,
DP_VGA_LVDS_CONVERTER_ID_2,
sizeof(
link->dpcd_caps.
branch_dev_name)) == 0) {
return DP_PANEL_MODE_SPECIAL;
}
break;
case DP_BRANCH_DEVICE_ID_00001A:
/* alternate scrambler reset is required for NUTMEG
* for the case when external chip does not provide
* sink device id, alternate scrambler scheme will
* be overriden later by querying Encoder feature
*/
if (strncmp(link->dpcd_caps.branch_dev_name,
DP_VGA_LVDS_CONVERTER_ID_3,
sizeof(
link->dpcd_caps.
branch_dev_name)) == 0) {
return DP_PANEL_MODE_SPECIAL;
}
break;
default:
break;
}
}
if (link->dpcd_caps.panel_mode_edp &&
(link->connector_signal == SIGNAL_TYPE_EDP ||
(link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
link->is_internal_display))) {
return DP_PANEL_MODE_EDP;
}
return DP_PANEL_MODE_DEFAULT;
}
bool edp_set_backlight_level_nits(struct dc_link *link,
bool isHDR,
uint32_t backlight_millinits,
uint32_t transition_time_in_ms)
{
if (!link || (link->connector_signal != SIGNAL_TYPE_EDP &&
link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT))
return false;
if (link->is_dds && !link->dpcd_caps.panel_luminance_control)
return true;
// use internal backlight control if dmub capabilities are not present
if (link->backlight_control_type == BACKLIGHT_CONTROL_VESA_AUX &&
!link->dc->caps.dmub_caps.aux_backlight_support) {
uint8_t backlight_enable = 0;
struct target_luminance_value *target_luminance = NULL;
//if target luminance value is greater than 24 bits, clip the value to 24 bits
if (backlight_millinits > 0xFFFFFF)
backlight_millinits = 0xFFFFFF;
target_luminance = (struct target_luminance_value *)&backlight_millinits;
//make sure we disable AMD ABC first.
core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_CONTROL,
&backlight_enable, sizeof(uint8_t));
if (backlight_enable) {
backlight_enable = 0;
core_link_write_dpcd(link, DP_SOURCE_BACKLIGHT_CONTROL,
&backlight_enable, 1);
}
core_link_read_dpcd(link, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
&backlight_enable, sizeof(uint8_t));
backlight_enable |= DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE;
if (core_link_write_dpcd(link, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
&backlight_enable,
sizeof(backlight_enable)) != DC_OK)
return false;
if (core_link_write_dpcd(link, DP_EDP_PANEL_TARGET_LUMINANCE_VALUE,
Annotation
- Immediate include surface: `link_edp_panel_control.h`, `link_dpcd.h`, `link_dp_capability.h`, `dm_helpers.h`, `dal_asic_id.h`, `link_dp_phy.h`, `dce/dmub_psr.h`, `dc/dc_dmub_srv.h`.
- Detected declarations: `function dp_set_panel_mode`, `function dp_get_panel_mode`, `function edp_set_backlight_level_nits`, `function edp_get_backlight_level_nits`, `function edp_backlight_enable_aux`, `function read_default_bl_aux`, `function set_default_brightness_aux`, `function edp_is_ilr_optimization_enabled`, `function get_max_edp_link_rate`, `function edp_is_ilr_optimization_required`.
- 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.