diff options
author | Harry Wentland <harry.wentland@amd.com> | 2017-11-24 09:11:23 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-20 14:45:40 -0500 |
commit | 63b371ec5464a69187661a87212d00c06fbdf5de (patch) | |
tree | 1aebe6ad1c936b071b20d32985312ce1d782cdc9 | |
parent | 0cadc8651d1b3d54b021560fea1b04d7bc6e1105 (diff) |
drm/amd/display: Print type if we get wrong ObjectID from bios
We've seen a bunch of issues where we can't get the connector from vbios
for what we think should be a valid connector id. Print some more info
when this happens.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link.c | 5 |
2 files changed, 14 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 21fb78e8048d..c00e405b63e8 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | |||
@@ -190,6 +190,7 @@ static struct graphics_object_id bios_parser_get_connector_id( | |||
190 | struct bios_parser *bp = BP_FROM_DCB(dcb); | 190 | struct bios_parser *bp = BP_FROM_DCB(dcb); |
191 | struct graphics_object_id object_id = dal_graphics_object_id_init( | 191 | struct graphics_object_id object_id = dal_graphics_object_id_init( |
192 | 0, ENUM_ID_UNKNOWN, OBJECT_TYPE_UNKNOWN); | 192 | 0, ENUM_ID_UNKNOWN, OBJECT_TYPE_UNKNOWN); |
193 | uint16_t id; | ||
193 | 194 | ||
194 | uint32_t connector_table_offset = bp->object_info_tbl_offset | 195 | uint32_t connector_table_offset = bp->object_info_tbl_offset |
195 | + le16_to_cpu(bp->object_info_tbl.v1_1->usConnectorObjectTableOffset); | 196 | + le16_to_cpu(bp->object_info_tbl.v1_1->usConnectorObjectTableOffset); |
@@ -197,12 +198,19 @@ static struct graphics_object_id bios_parser_get_connector_id( | |||
197 | ATOM_OBJECT_TABLE *tbl = | 198 | ATOM_OBJECT_TABLE *tbl = |
198 | GET_IMAGE(ATOM_OBJECT_TABLE, connector_table_offset); | 199 | GET_IMAGE(ATOM_OBJECT_TABLE, connector_table_offset); |
199 | 200 | ||
200 | if (tbl && tbl->ucNumberOfObjects > i) { | 201 | if (!tbl) { |
201 | const uint16_t id = le16_to_cpu(tbl->asObjects[i].usObjectID); | 202 | dm_error("Can't get connector table from atom bios.\n"); |
203 | return object_id; | ||
204 | } | ||
202 | 205 | ||
203 | object_id = object_id_from_bios_object_id(id); | 206 | if (tbl->ucNumberOfObjects <= i) { |
207 | dm_error("Can't find connector id %d in connector table of size %d.\n", | ||
208 | i, tbl->ucNumberOfObjects); | ||
209 | return object_id; | ||
204 | } | 210 | } |
205 | 211 | ||
212 | id = le16_to_cpu(tbl->asObjects[i].usObjectID); | ||
213 | object_id = object_id_from_bios_object_id(id); | ||
206 | return object_id; | 214 | return object_id; |
207 | } | 215 | } |
208 | 216 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 00130152f366..da83412af306 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c | |||
@@ -938,8 +938,9 @@ static bool construct( | |||
938 | link->link_id = bios->funcs->get_connector_id(bios, init_params->connector_index); | 938 | link->link_id = bios->funcs->get_connector_id(bios, init_params->connector_index); |
939 | 939 | ||
940 | if (link->link_id.type != OBJECT_TYPE_CONNECTOR) { | 940 | if (link->link_id.type != OBJECT_TYPE_CONNECTOR) { |
941 | dm_error("%s: Invalid Connector ObjectID from Adapter Service for connector index:%d!\n", | 941 | dm_error("%s: Invalid Connector ObjectID from Adapter Service for connector index:%d! type %d expected %d\n", |
942 | __func__, init_params->connector_index); | 942 | __func__, init_params->connector_index, |
943 | link->link_id.type, OBJECT_TYPE_CONNECTOR); | ||
943 | goto create_fail; | 944 | goto create_fail; |
944 | } | 945 | } |
945 | 946 | ||