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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 07, 2023 at 01:22:56AM +0200, Konrad Dybcio wrote:
> 
> On 6.07.2023 23:10, Rob Clark wrote:
> > From: Rob Clark <robdclark@xxxxxxxxxxxx>
> > 
> > Even in the ocmem case, the allocated ocmem buffer size should match the
> > requested size.
> > 
> > Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
> > ---
> [...]
> 
> > +
> > +	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.

No, the worst case scenarios are subtle bugs like random corruptions,
pagefaults etc which you debug for months. ;)

-Akhil.

> 
> 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;



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux