amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org
Cc: "Timur Kristóf" <timur.kristof@gmail.com>
Subject: [PATCH 6/7] drm/amd/display: Don't print errors for nonexistent connectors
Date: Thu, 31 Jul 2025 11:43:51 +0200	[thread overview]
Message-ID: <20250731094352.29528-7-timur.kristof@gmail.com> (raw)
In-Reply-To: <20250731094352.29528-1-timur.kristof@gmail.com>

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>
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c |  5 +----
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
index 67f08495b7e6..154fd2c18e88 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index cf3893a2f8ce..33d6a5116aad 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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;
-- 
2.50.1


  parent reply	other threads:[~2025-07-31  9:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  9:43 [PATCH 0/7] DC: don't overclock DCE 6-10 and other fixes Timur Kristóf
2025-07-31  9:43 ` [PATCH 1/7] drm/amd/display: Don't overclock DCE 6 by 15% Timur Kristóf
2025-08-04 15:54   ` Alex Deucher
2025-08-12 22:11   ` Rodrigo Siqueira
2025-07-31  9:43 ` [PATCH 2/7] drm/amd/display: Adjust DCE 8-10 clock, don't overclock " Timur Kristóf
2025-08-04 15:56   ` Alex Deucher
2025-08-04 16:35     ` Timur Kristóf
2025-08-04 16:57       ` Alex Deucher
2025-08-12 22:18   ` Rodrigo Siqueira
2025-07-31  9:43 ` [PATCH 3/7] drm/amd/display: Find first CRTC and its line time in dce110_fill_display_configs Timur Kristóf
2025-08-04 15:57   ` Alex Deucher
2025-08-12 22:32   ` Rodrigo Siqueira
2025-07-31  9:43 ` [PATCH 4/7] drm/amd/display: Fill display clock and vblank " Timur Kristóf
2025-08-04 15:58   ` Alex Deucher
2025-08-12 22:39   ` Rodrigo Siqueira
2025-07-31  9:43 ` [PATCH 5/7] drm/amd/display: Don't warn when missing DCE encoder caps Timur Kristóf
2025-08-04 15:59   ` Alex Deucher
2025-08-12 22:47   ` Rodrigo Siqueira
2025-07-31  9:43 ` Timur Kristóf [this message]
2025-08-04 15:59   ` [PATCH 6/7] drm/amd/display: Don't print errors for nonexistent connectors Alex Deucher
2025-08-12 22:59   ` Rodrigo Siqueira
2025-07-31  9:43 ` [PATCH 7/7] drm/amd/display: Fix fractional fb divider in set_pixel_clock_v3 Timur Kristóf
2025-08-04 15:59   ` Alex Deucher
2025-08-12 23:46   ` Rodrigo Siqueira
2025-08-09 20:25 ` [PATCH 0/7] DC: don't overclock DCE 6-10 and other fixes Timur Kristóf
2025-08-18  3:01 ` Alex Hung
2025-08-18 14:44   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250731094352.29528-7-timur.kristof@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).