[PATCH 02/12] drm/msm/adreno: Remove redundant gmem size param

Konrad Dybcio konrad.dybcio at linaro.org
Thu Jul 6 23:22:56 UTC 2023


On 6.07.2023 23:10, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>
> 
> Even in the ocmem case, the allocated ocmem buffer size should match the
> requested size.
> 
> Signed-off-by: Rob Clark <robdclark at chromium.org>
> ---
[...]

> +
> +	WARN_ON(ocmem_hdl->len != adreno_gpu->info->gmem);
I believe this should be an error condition. If the sizes are mismatched,
best case scenario you get suboptimal perf and worst case scenario your
system explodes.

Very nice cleanup though!

Konrad
>  
>  	return 0;
>  }
> @@ -1097,7 +1098,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  
>  	adreno_gpu->funcs = funcs;
>  	adreno_gpu->info = adreno_info(config->rev);
> -	adreno_gpu->gmem = adreno_gpu->info->gmem;
>  	adreno_gpu->revn = adreno_gpu->info->revn;
>  	adreno_gpu->rev = *rev;
>  
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> index 6830c3776c2d..aaf09c642dc6 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> @@ -77,7 +77,6 @@ struct adreno_gpu {
>  	struct msm_gpu base;
>  	struct adreno_rev rev;
>  	const struct adreno_info *info;
> -	uint32_t gmem;  /* actual gmem size */
>  	uint32_t revn;  /* numeric revision name */
>  	uint16_t speedbin;
>  	const struct adreno_gpu_funcs *funcs;


More information about the dri-devel mailing list