Skip to content

Commit af9742e

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 97fc94c commit af9742e

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
@@ -215,11 +215,24 @@ static bool create_links(
215215
connectors_num,
216216
num_virtual_links);
217217

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

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

225238
link_init_params.ctx = dc->ctx;

0 commit comments

Comments
 (0)