]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amd/display: Don't print errors for nonexistent connectors
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 31 Jul 2025 09:43:51 +0000 (11:43 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 Aug 2025 22:00:20 +0000 (18:00 -0400)
When getting the number of connectors, the VBIOS reports
the number of valid indices, but it doesn't say which indices
are valid, and not every valid index has an actual connector.
If we don't find a connector on an index, that is not an error.

Considering these are not actual errors, don't litter the logs.

Fixes: 60df5628144b ("drm/amd/display: handle invalid connector indices")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 249d4bc5f1935f04bb45b3b63c0f8922565124f7)

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
drivers/gpu/drm/amd/display/dc/core/dc.c

index 67f08495b7e6e2127d02cfe0367c5a148f3bf383..154fd2c18e88485cb5789b022f70e4a6f038d90f 100644 (file)
@@ -174,11 +174,8 @@ static struct graphics_object_id bios_parser_get_connector_id(
                return object_id;
        }
 
-       if (tbl->ucNumberOfObjects <= i) {
-               dm_error("Can't find connector id %d in connector table of size %d.\n",
-                        i, tbl->ucNumberOfObjects);
+       if (tbl->ucNumberOfObjects <= i)
                return object_id;
-       }
 
        id = le16_to_cpu(tbl->asObjects[i].usObjectID);
        object_id = object_id_from_bios_object_id(id);
index 9ab0ee20ca6fe2c10e91f7a7981166abaf0e120e..dcc48b5238e5309d548a7e05f02fec74a8bd84eb 100644 (file)
@@ -217,11 +217,24 @@ static bool create_links(
                connectors_num,
                num_virtual_links);
 
-       // condition loop on link_count to allow skipping invalid indices
+       /* When getting the number of connectors, the VBIOS reports the number of valid indices,
+        * but it doesn't say which indices are valid, and not every index has an actual connector.
+        * So, if we don't find a connector on an index, that is not an error.
+        *
+        * - There is no guarantee that the first N indices will be valid
+        * - VBIOS may report a higher amount of valid indices than there are actual connectors
+        * - Some VBIOS have valid configurations for more connectors than there actually are
+        *   on the card. This may be because the manufacturer used the same VBIOS for different
+        *   variants of the same card.
+        */
        for (i = 0; dc->link_count < connectors_num && i < MAX_LINKS; i++) {
+               struct graphics_object_id connector_id = bios->funcs->get_connector_id(bios, i);
                struct link_init_data link_init_params = {0};
                struct dc_link *link;
 
+               if (connector_id.id == CONNECTOR_ID_UNKNOWN)
+                       continue;
+
                DC_LOG_DC("BIOS object table - printing link object info for connector number: %d, link_index: %d", i, dc->link_count);
 
                link_init_params.ctx = dc->ctx;