RE: drm/amdgpu: implement cgs gpu memory callbacks

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

 



Inline...[DZ]

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Tuesday, August 25, 2015 3:51 AM
> To: Zhou, David(ChunMing)
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: drm/amdgpu: implement cgs gpu memory callbacks
> 
> On Mon, Aug 24, 2015 at 07:09:15AM +0000, Zhou, David(ChunMing) wrote:
> > Hi Dan,
> > Thanks for figuring out that.
> > >    274          min_offset = obj->placements[0].fpfn << PAGE_SHIFT;
> > >    275          max_offset = obj->placements[0].lpfn << PAGE_SHIFT;
> > Maybe should be:
> > 	min_offset = obj->placements[0].fpfn;
> > 	min_offset <<= PAGE_SHIFT;
> > 	max_offset = obj->placements[0].lpfn;
> > 	max_offset <<= PAGE_SHIFT;
> 
> 
> It's probably just simpler to be:
> 
> 	min_offset = (u64)obj->placements[0].fpfn << PAGE_SHIFT;
> 	max_offset = (u64)obj->placements[0].lpfn << PAGE_SHIFT;
> 
> But the larger questions aer why is min_offset a u64,
[DZ] max/min_offset is memory size.
 
>and can the shift actually
> wrap? 
[DZ] of course, adding shift wrap is better. fpfn/lpfn is page number, so <<PAGE_SHIFT is to convert to memory size.

Regards,
  David Zhou
> I'm just looking at static checker warnings, and I'm not very familiar
> with this code so I don't know the answers.
> 
> regards,
> dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[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