]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: increase max link count and fix link->enc NULL pointer access
authorCharlene Liu <Charlene.Liu@amd.com>
Tue, 30 Sep 2025 00:29:30 +0000 (20:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:08:57 +0000 (14:08 +0100)
commit bec947cbe9a65783adb475a5fb47980d7b4f4796 upstream.

[why]
1.) dc->links[MAX_LINKS] array size smaller than actual requested.
max_connector + max_dpia + 4 virtual = 14.
increase from 12 to 14.

2.) hw_init() access null LINK_ENC for dpia non display_endpoint.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Reviewed-by: Chris Park <chris.park@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d7f5a61e1b04ed87b008c8d327649d184dc5bb45)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h

index 3279f347660cb60380c2677cc41ce960f58d0cb8..bcb296a954f2b48f52e62bcce5e2408ab15e21d6 100644 (file)
@@ -287,6 +287,9 @@ void dcn401_init_hw(struct dc *dc)
                 */
                struct dc_link *link = dc->links[i];
 
+               if (link->ep_type != DISPLAY_ENDPOINT_PHY)
+                       continue;
+
                link->link_enc->funcs->hw_init(link->link_enc);
 
                /* Check for enabled DIG to identify enabled display */
index 41c76ba9ba569d3aaec05c116b021687d5411d21..62a39204fe0b7df3c93f2ae355c102181cb2b9ef 100644 (file)
  */
 #define MAX_PIPES 6
 #define MAX_PHANTOM_PIPES (MAX_PIPES / 2)
-#define MAX_LINKS (MAX_PIPES * 2 +2)
+
+#define MAX_DPIA 6
+#define MAX_CONNECTOR 6
+#define MAX_VIRTUAL_LINKS 4
+
+#define MAX_LINKS (MAX_DPIA + MAX_CONNECTOR + MAX_VIRTUAL_LINKS)
+
 #define MAX_DIG_LINK_ENCODERS 7
 #define MAX_DWB_PIPES  1
 #define MAX_HPO_DP2_ENCODERS   4