]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Add ability for HWSS to prepare the DDC before use
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 26 Jan 2026 21:08:31 +0000 (22:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Feb 2026 19:28:32 +0000 (14:28 -0500)
Make it possible to add a HWSS function to prepare the DDC
before trying to use it. This is going to be necessary for
external DP bridge encoders.

This commit just adds the function to common DC code.
The actual implementation of this function for DCE is
done in a subsequent commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
drivers/gpu/drm/amd/display/dc/link/link_detection.c

index a09761f9882d1235ceebb599997a5e2bec766245..71cfc623bc2d4fdcb8165f0f251395238bc8fb18 100644 (file)
@@ -1016,6 +1016,9 @@ enum dc_edid_status dm_helpers_read_local_edid(
        else
                ddc = &aconnector->i2c->base;
 
+       if (link->dc->hwss.prepare_ddc)
+               link->dc->hwss.prepare_ddc(link);
+
        /* some dongles read edid incorrectly the first time,
         * do check sum and retry to make sure read correct edid.
         */
index d3d35912349d8f1cd94f87ad674bfff5f0499d1b..d1796e07ab1a3de1a201651b4c9e5daa12e6aec2 100644 (file)
@@ -1190,6 +1190,7 @@ struct hw_sequencer_funcs {
                        const struct link_resource *link_res,
                        enum signal_type signal);
        bool (*dac_load_detect)(struct dc_link *link);
+       void (*prepare_ddc)(struct dc_link *link);
 
        void (*get_dcc_en_bits)(struct dc *dc, int *dcc_en_bits);
 
index 8fd796d987b634f71ac1ab48aefb8c5c22b65048..2d1f3d13c1773b92636dc18df911835c003efcea 100644 (file)
@@ -912,6 +912,9 @@ static bool link_detect_ddc_probe(struct dc_link *link)
        if (!link->ddc)
                return false;
 
+       if (link->dc->hwss.prepare_ddc)
+               link->dc->hwss.prepare_ddc(link);
+
        set_ddc_transaction_type(link->ddc, transaction_type);
 
        ddc_probed = link_query_ddc_data(link->ddc, 0x50, &zero, 1, edid_header, sizeof(edid_header));