]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Handle aux_inst for connectors without DDC pin
authorGabe Teeger <gabe.teeger@amd.com>
Thu, 21 May 2026 15:06:22 +0000 (11:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jun 2026 17:43:42 +0000 (13:43 -0400)
[Why & How]
Must use an alternative codepath to access AUX channel when
link->no_ddc_pin is set.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Gabe Teeger <gabe.teeger@amd.com>
Signed-off-by: Matthew Stewart <Matthew.Stewart2@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/power/power.c
drivers/gpu/drm/amd/display/modules/power/power_abm.c

index 1dd65bdf8cc90ee1f003a12052ce5906e3b10ff8..5659a38b336637123c2a771ca36e66014b426078 100644 (file)
@@ -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);
 
index b94dbb9e64a73229db4c01856d083de83f472f82..a1a0563598b5c3f6a4d74fa44e297b9a215c07b7 100644 (file)
@@ -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;