⬢ DragonFlyBSD Kernel Audit
DF-5075 / fix.diff
← back to finding ↓ download raw
# DF-5075 fix -- generated with git diff --no-index; verify: git apply --check (passes)
# Authored against the read-only sys/ tree; NEVER applied there.
diff --git a/sys/dev/drm/amd/display/dc/bios/command_table_helper.c b/sys/dev/drm/amd/display/dc/bios/command_table_helper.c
index 253bbb1..db3307c 100644
--- a/sys/dev/drm/amd/display/dc/bios/command_table_helper.c
+++ b/sys/dev/drm/amd/display/dc/bios/command_table_helper.c
@@ -30,6 +30,7 @@
 #include "include/bios_parser_types.h"
 
 #include "command_table_helper.h"
+#include "dce112/command_table_helper2_dce112.h"
 
 bool dal_bios_parser_init_cmd_tbl_helper(
 	const struct command_table_helper **h,
@@ -55,6 +56,16 @@ bool dal_bios_parser_init_cmd_tbl_helper(
 		*h = dal_cmd_tbl_helper_dce112_get_table();
 		return true;
 
+#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
+	case DCN_VERSION_1_0:
+#endif
+#if defined(CONFIG_DRM_AMD_DC_DCN1_01)
+	case DCN_VERSION_1_01:
+#endif
+	case DCE_VERSION_12_0:
+		*h = dal_cmd_tbl_helper_dce112_get_table2();
+		return true;
+
 	default:
 		/* Unsupported DCE */
 		BREAK_TO_DEBUGGER();
diff --git a/sys/dev/drm/amd/display/dc/bios/bios_parser.c b/sys/dev/drm/amd/display/dc/bios/bios_parser.c
index 83b477c..f54531e 100644
--- a/sys/dev/drm/amd/display/dc/bios/bios_parser.c
+++ b/sys/dev/drm/amd/display/dc/bios/bios_parser.c
@@ -2933,7 +2933,10 @@ static bool bios_parser_construct(
 		return false;
 
 	dal_bios_parser_init_cmd_tbl(bp);
-	dal_bios_parser_init_cmd_tbl_helper(&bp->cmd_helper, dce_version);
+	if (!dal_bios_parser_init_cmd_tbl_helper(&bp->cmd_helper, dce_version)) {
+		/* no command-table helper for this ASIC generation */
+		return false;
+	}
 
 	bp->base.integrated_info = bios_parser_create_integrated_info(&bp->base);