[PATCH 2/2] amdgpu: add flag to support 32bit VA address v2
Emil Velikov
emil.l.velikov at gmail.com
Wed Aug 12 12:19:48 PDT 2015
Hi Jammy,
This patch will conflict with an earlier series that I'm planning to
merge shortly. Can you squash the following changes and check for errors
with $make check/distcheck.
On 10/08/15 13:26, Jammy Zhou wrote:
> The AMDGPU_VA_RANGE_32_BIT flag is added to request VA range in the
> 32bit address space for amdgpu_va_range_alloc.
>
> The 32bit address space is reserved at initialization time, and managed
> with a separate VAMGR as part of the global VAMGR. And if no enough VA
> space available in range above 4GB, this reserved range can be used as
> fallback.
>
> v2: add comment for AMDGPU_VA_RANGE_32_BIT, and add vamgr to va_range
>
> Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
> Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> amdgpu/amdgpu.h | 5 +++++
> amdgpu/amdgpu_device.c | 22 ++++++++++++++++++++++
> amdgpu/amdgpu_internal.h | 9 +++++++++
> amdgpu/amdgpu_vamgr.c | 35 ++++++++++++++++++++++++++++-------
> 4 files changed, 64 insertions(+), 7 deletions(-)
>
> diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
> index 526a93f..6e65642 100644
> --- a/amdgpu/amdgpu_internal.h
> +++ b/amdgpu/amdgpu_internal.h
> @@ -124,6 +128,11 @@ struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev);
>
> void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, struct amdgpu_bo_va_mgr *src);
>
> +void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> + uint64_t max, uint64_t alignment);
> +
> +void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr);
> +
Please prefix these two with the drm_private macro.
> uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
> uint64_t alignment, uint64_t base_required);
>
> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
> index e044dfa..04e09e2 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -42,7 +42,7 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
> return -EINVAL;
> }
>
> -static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> +void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> uint64_t max, uint64_t alignment)
Same here,
> {
> mgr->va_offset = start;
> @@ -53,7 +53,7 @@ static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> pthread_mutex_init(&mgr->bo_va_mutex, NULL);
> }
>
> -static void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
> +void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
and here.
You won't need to hunt the correct include as my earlier series adds it
in these two files.
Thanks
Emil
P.S. I'll take another look at the drmGetDevices patch in a few hours.
More information about the dri-devel
mailing list