aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch
new file mode 100644
index 00000000..a96ce6b9
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2996-drm-amd-display-Print-type-if-we-get-wrong-ObjectID-.patch
@@ -0,0 +1,72 @@
+From adcd3a4cd158b23910d8812f8ab06fe39dcc408e Mon Sep 17 00:00:00 2001
+From: Harry Wentland <harry.wentland@amd.com>
+Date: Fri, 24 Nov 2017 09:11:23 -0500
+Subject: [PATCH 2996/4131] 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>
+---
+ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 14 +++++++++++---
+ 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 21fb78e..c00e405 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(
+ struct bios_parser *bp = BP_FROM_DCB(dcb);
+ struct graphics_object_id object_id = dal_graphics_object_id_init(
+ 0, ENUM_ID_UNKNOWN, OBJECT_TYPE_UNKNOWN);
++ uint16_t id;
+
+ uint32_t connector_table_offset = bp->object_info_tbl_offset
+ + le16_to_cpu(bp->object_info_tbl.v1_1->usConnectorObjectTableOffset);
+@@ -197,12 +198,19 @@ static struct graphics_object_id bios_parser_get_connector_id(
+ ATOM_OBJECT_TABLE *tbl =
+ GET_IMAGE(ATOM_OBJECT_TABLE, connector_table_offset);
+
+- if (tbl && tbl->ucNumberOfObjects > i) {
+- const uint16_t id = le16_to_cpu(tbl->asObjects[i].usObjectID);
++ if (!tbl) {
++ dm_error("Can't get connector table from atom bios.\n");
++ return object_id;
++ }
+
+- object_id = object_id_from_bios_object_id(id);
++ if (tbl->ucNumberOfObjects <= i) {
++ dm_error("Can't find connector id %d in connector table of size %d.\n",
++ i, tbl->ucNumberOfObjects);
++ return object_id;
+ }
+
++ id = le16_to_cpu(tbl->asObjects[i].usObjectID);
++ object_id = object_id_from_bios_object_id(id);
+ return object_id;
+ }
+
+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 0013015..da83412 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(
+ link->link_id = bios->funcs->get_connector_id(bios, init_params->connector_index);
+
+ if (link->link_id.type != OBJECT_TYPE_CONNECTOR) {
+- dm_error("%s: Invalid Connector ObjectID from Adapter Service for connector index:%d!\n",
+- __func__, init_params->connector_index);
++ dm_error("%s: Invalid Connector ObjectID from Adapter Service for connector index:%d! type %d expected %d\n",
++ __func__, init_params->connector_index,
++ link->link_id.type, OBJECT_TYPE_CONNECTOR);
+ goto create_fail;
+ }
+
+--
+2.7.4
+