[PATCH] drm/amd/display: Don't ASSERT when total_planes == AMDGPU_MAX_PLANES

Michel Dänzer michel at daenzer.net
Tue Mar 5 17:40:21 UTC 2019


On 2019-03-05 6:24 p.m., Nicholas Kazlauskas wrote:
> [Why]
> Can happen on ASICs with 6 planes, but this isn't a bug since we haven't
> written outside the array.
> 
> [How]
> Use <= instead of <.
> 
> Cc: Leo Li <sunpeng.li at amd.com>
> Cc: Michel Dänzer <michel at daenzer.net>
> Reported-by: Michel Dänzer <michel at daenzer.net>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index bdbc8006d9ea..b1208883da1b 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1923,7 +1923,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
>  	primary_planes = dm->dc->caps.max_streams;
>  
>  	total_planes = primary_planes + overlay_planes;
> -	ASSERT(total_planes < AMDGPU_MAX_PLANES);
> +	ASSERT(total_planes <= AMDGPU_MAX_PLANES);
>  
>  	/*
>  	 * Initialize primary planes, implicit planes for legacy IOCTLS.
> 

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
Tested-by: Michel Dänzer <michel.daenzer at amd.com>

Thanks!


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the amd-gfx mailing list