From: Gabe Teeger Date: Thu, 21 May 2026 15:06:22 +0000 (-0400) Subject: drm/amd/display: Handle aux_inst for connectors without DDC pin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d447370678c4c4d335fd0422341b76f8cf8f3b3;p=thirdparty%2Flinux.git drm/amd/display: Handle aux_inst for connectors without DDC pin [Why & How] Must use an alternative codepath to access AUX channel when link->no_ddc_pin is set. Reviewed-by: Harry Wentland Signed-off-by: Gabe Teeger Signed-off-by: Matthew Stewart Signed-off-by: Ray Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/modules/power/power.c b/drivers/gpu/drm/amd/display/modules/power/power.c index 1dd65bdf8cc90..5659a38b33663 100644 --- a/drivers/gpu/drm/amd/display/modules/power/power.c +++ b/drivers/gpu/drm/amd/display/modules/power/power.c @@ -464,6 +464,7 @@ bool mod_power_notify_mode_change(struct mod_power *mod_power, struct dc_link *link = NULL; struct dc *dc = NULL; unsigned int panel_inst = 0; + uint8_t aux_inst = 0; if ((mod_power == NULL) || (stream == NULL)) return false; @@ -482,8 +483,12 @@ bool mod_power_notify_mode_change(struct mod_power *mod_power, link = dc_stream_get_link(stream); if (link != NULL && dc_get_edp_link_panel_inst(dc, link, &panel_inst)) { - ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); - uint8_t aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + if (link->ctx->dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { + aux_inst = (uint8_t)link->aux_hw_inst; + } else { + ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); + aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + } mod_power_update_backlight_on_mode_change(core_power, link, panel_inst, aux_inst, is_hdr); diff --git a/drivers/gpu/drm/amd/display/modules/power/power_abm.c b/drivers/gpu/drm/amd/display/modules/power/power_abm.c index b94dbb9e64a73..a1a0563598b5c 100644 --- a/drivers/gpu/drm/amd/display/modules/power/power_abm.c +++ b/drivers/gpu/drm/amd/display/modules/power/power_abm.c @@ -849,8 +849,12 @@ bool mod_power_set_backlight_nits(struct mod_power *mod_power, core_power = MOD_POWER_TO_CORE(mod_power); link = dc_stream_get_link(stream); - ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); - aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + if (link->ctx->dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { + aux_inst = (uint8_t)link->aux_hw_inst; + } else { + ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); + aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + } if (!dc_get_edp_link_panel_inst(core_power->dc, stream->link, &panel_inst)) return false; @@ -937,8 +941,12 @@ bool mod_power_set_backlight_percent(struct mod_power *mod_power, core_power = MOD_POWER_TO_CORE(mod_power); link = dc_stream_get_link(stream); - ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); - aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + if (link->ctx->dc->config.dp_connector_no_native_i2c && link->no_ddc_pin) { + aux_inst = (uint8_t)link->aux_hw_inst; + } else { + ASSERT(link->ddc->ddc_pin->hw_info.ddc_channel <= 0xFF); + aux_inst = (uint8_t)link->ddc->ddc_pin->hw_info.ddc_channel; + } if (!dc_get_edp_link_panel_inst(core_power->dc, stream->link, &panel_inst)) return false;