From 1f5fda8329d15db15249bcb850f1d72506bc4abf Mon Sep 17 00:00:00 2001 From: Harry Wentland Date: Fri, 21 Dec 2018 11:02:29 -0500 Subject: [PATCH] drm/amd/display: Limit number of links to num_ddc [Why] If BIOS reports more connectors than the number of DDC lines we allocate for an ASIC we'll create too many AUX devices in blow up in dc_link_aux_transfer due to lack of a DDC line. [How] Limit number of links to num_ddc. Signed-off-by: Harry Wentland --- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 9045e6fa0780..09ec1245f8c2 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -90,6 +90,9 @@ static bool create_links( connectors_num = bios->funcs->get_connectors_number(bios); + if (connectors_num > dc->res_pool->res_cap->num_ddc) + connectors_num = dc->res_pool->res_cap->num_ddc; + if (connectors_num > ENUM_ID_COUNT) { dm_error( "DC: Number of connectors %d exceeds maximum of %d!\n", -- 2.19.1