On Tue, 2025-09-02 at 08:43 +0200, Christian König wrote:
> On 01.09.25 12:00, Timur Kristóf wrote:
> > To avoid confusion with dwords.
> > 
> > Signed-off-by: Timur Kristóf <timur.kris...@gmail.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > index 122a88294883..9ffadc029ef8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> > @@ -220,7 +220,7 @@ void amdgpu_bo_placement_from_domain(struct
> > amdgpu_bo *abo, u32 domain)
> >   * amdgpu_bo_create_reserved - create reserved BO for kernel use
> >   *
> >   * @adev: amdgpu device object
> > - * @size: size for the new BO
> > + * @size: size for the new BO in bytes
> 
> That is actually incorrect. The size is in arbitrary units.
> 
> For OA and GWS it is the number of HW engines they represent, for GDS
> it is in bytes and for VRAM and GTT it is in bytes but rounded up to
> a page size.
> 

Can you point me to the part of the code where this is actually
determined?

If it's that complicated, then I think the function could definitely
benefit from more documentation. All I could find was that both
ttm_resource::size and drm_gem_object::size are documented to be in
bytes.


> 
> >   * @align: alignment for the new BO
> >   * @domain: where to place it
> >   * @bo_ptr: used to initialize BOs in structures
> > @@ -317,7 +317,7 @@ int amdgpu_bo_create_reserved(struct
> > amdgpu_device *adev,
> >   * amdgpu_bo_create_kernel - create BO for kernel use
> >   *
> >   * @adev: amdgpu device object
> > - * @size: size for the new BO
> > + * @size: size for the new BO in bytes
> >   * @align: alignment for the new BO
> >   * @domain: where to place it
> >   * @bo_ptr:  used to initialize BOs in structures

Reply via email to