Skip to content

Commit bec947c

Browse files
charliu-AMDENGalexdeucher
authored andcommitted
drm/amd/display: increase max link count and fix link->enc NULL pointer access
[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 <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Meenakshikumar Somasundaram <[email protected]> Reviewed-by: Chris Park <[email protected]> Signed-off-by: Charlene Liu <[email protected]> Signed-off-by: Aurabindo Pillai <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit d7f5a61e1b04ed87b008c8d327649d184dc5bb45) Cc: [email protected]
1 parent 89939cf commit bec947c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ void dcn401_init_hw(struct dc *dc)
200200
*/
201201
struct dc_link *link = dc->links[i];
202202

203+
if (link->ep_type != DISPLAY_ENDPOINT_PHY)
204+
continue;
205+
203206
link->link_enc->funcs->hw_init(link->link_enc);
204207

205208
/* Check for enabled DIG to identify enabled display */

drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444
*/
4545
#define MAX_PIPES 6
4646
#define MAX_PHANTOM_PIPES (MAX_PIPES / 2)
47-
#define MAX_LINKS (MAX_PIPES * 2 +2)
47+
48+
#define MAX_DPIA 6
49+
#define MAX_CONNECTOR 6
50+
#define MAX_VIRTUAL_LINKS 4
51+
52+
#define MAX_LINKS (MAX_DPIA + MAX_CONNECTOR + MAX_VIRTUAL_LINKS)
53+
4854
#define MAX_DIG_LINK_ENCODERS 7
4955
#define MAX_DWB_PIPES 1
5056
#define MAX_HPO_DP2_ENCODERS 4

0 commit comments

Comments
 (0)