[PATCH 2/4] amdgpu: improve amdgpu_vamgr_init

Zhou, Jammy Jammy.Zhou at amd.com
Mon Aug 17 19:08:33 PDT 2015


Excellent. Thanks Alex.

Regards,
Jammy

-----Original Message-----
From: Alex Deucher [mailto:alexdeucher at gmail.com] 
Sent: Tuesday, August 18, 2015 4:36 AM
To: Zhou, Jammy
Cc: Maling list - DRI developers; Emil Velikov
Subject: Re: [PATCH 2/4] amdgpu: improve amdgpu_vamgr_init

On Sun, Aug 16, 2015 at 11:09 PM, Jammy Zhou <Jammy.Zhou at amd.com> wrote:
> Make it a generic function independent of the device info.
>
> Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
> Reviewed-by: Christian König <christian.koenig at amd.com>
> ---

I pushed patches 2-4.

Alex


>  amdgpu/amdgpu_vamgr.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c index 
> cc4a1c4..71fd2b1 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -46,11 +46,12 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
>         return -EINVAL;
>  }
>
> -static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, struct 
> amdgpu_device *dev)
> +static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> +                             uint64_t max, uint64_t alignment)
>  {
> -       mgr->va_offset = dev->dev_info.virtual_address_offset;
> -       mgr->va_max = dev->dev_info.virtual_address_max;
> -       mgr->va_alignment = dev->dev_info.virtual_address_alignment;
> +       mgr->va_offset = start;
> +       mgr->va_max = max;
> +       mgr->va_alignment = alignment;
>
>         list_inithead(&mgr->va_holes);
>         pthread_mutex_init(&mgr->bo_va_mutex, NULL); @@ -72,7 +73,9 @@ 
> drm_private struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_devi
>         ref = atomic_inc_return(&vamgr.refcount);
>
>         if (ref == 1)
> -               amdgpu_vamgr_init(&vamgr, dev);
> +               amdgpu_vamgr_init(&vamgr, dev->dev_info.virtual_address_offset,
> +                                 dev->dev_info.virtual_address_max,
> +                                 
> + dev->dev_info.virtual_address_alignment);
>         return &vamgr;
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list