[PATCH 1/2] amdgpu: improve amdgpu_vamgr_init

Alex Deucher alexdeucher at gmail.com
Mon Aug 10 13:31:15 PDT 2015


On Mon, Aug 10, 2015 at 8:26 AM, 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>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

If there are not additional comments, I'll push this in the next couple of days.

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 ced4f4f..e044dfa 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -42,11 +42,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);
> @@ -68,7 +69,9 @@ struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev)
>         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