Skip to content

Commit f494028

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amd/display: Don't print errors for nonexistent connectors
[ Upstream commit f14ee2e ] 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: 60df562 ("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 249d4bc) Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d767b09 commit f494028

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,8 @@ static struct graphics_object_id bios_parser_get_connector_id(
174174
return object_id;
175175
}
176176

177-
if (tbl->ucNumberOfObjects <= i) {
178-
dm_error("Can't find connector id %d in connector table of size %d.\n",
179-
i, tbl->ucNumberOfObjects);
177+
if (tbl->ucNumberOfObjects <= i)
180178
return object_id;
181-
}
182179

183180
id = le16_to_cpu(tbl->asObjects[i].usObjectID);
184181
object_id = object_id_from_bios_object_id(id);

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,24 @@ static bool create_links(
217217
connectors_num,
218218
num_virtual_links);
219219

220-
// condition loop on link_count to allow skipping invalid indices
220+
/* When getting the number of connectors, the VBIOS reports the number of valid indices,
221+
* but it doesn't say which indices are valid, and not every index has an actual connector.
222+
* So, if we don't find a connector on an index, that is not an error.
223+
*
224+
* - There is no guarantee that the first N indices will be valid
225+
* - VBIOS may report a higher amount of valid indices than there are actual connectors
226+
* - Some VBIOS have valid configurations for more connectors than there actually are
227+
* on the card. This may be because the manufacturer used the same VBIOS for different
228+
* variants of the same card.
229+
*/
221230
for (i = 0; dc->link_count < connectors_num && i < MAX_LINKS; i++) {
231+
struct graphics_object_id connector_id = bios->funcs->get_connector_id(bios, i);
222232
struct link_init_data link_init_params = {0};
223233
struct dc_link *link;
224234

235+
if (connector_id.id == CONNECTOR_ID_UNKNOWN)
236+
continue;
237+
225238
DC_LOG_DC("BIOS object table - printing link object info for connector number: %d, link_index: %d", i, dc->link_count);
226239

227240
link_init_params.ctx = dc->ctx;

0 commit comments

Comments
 (0)