From e92f11e588edbc2967ab57aac139cee4a87c578a Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 9 Sep 2024 08:45:55 +0000 Subject: [PATCH] drm/amd/display: Stop amdgpu_dm initialize when stream nums greater than 6 From Hersen Wu 94cb77700fa4ae6200486bfa0ba2ac547534afd2 in linux-6.6.y/6.6.50 84723eb6068c50610c5c0893980d230d7afa2105 in mainline linux --- sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 6a3d1f46386..1c7289d05fe 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4361,7 +4361,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) /* There is one primary plane per CRTC */ primary_planes = dm->dc->caps.max_streams; - ASSERT(primary_planes <= AMDGPU_MAX_PLANES); + if (primary_planes > AMDGPU_MAX_PLANES) { + DRM_ERROR("DM: Plane nums out of 6 planes\n"); + return -EINVAL; + } /* * Initialize primary planes, implicit planes for legacy IOCTLS. -- 2.20.1