drm/amdgpu: expose the max virtual address
authorJammy Zhou <Jammy.Zhou@amd.com>
Tue, 12 May 2015 14:46:45 +0000 (22:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2015 01:03:34 +0000 (21:03 -0400)
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h

index 02c450d0be1a05625f43347ad1de1212b32dc0ce..35185d6b7d46bbfc72b61c38a0e90196c738118e 100644 (file)
@@ -428,6 +428,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
                if (adev->flags & AMDGPU_IS_APU)
                        dev_info.ids_flags |= AMDGPU_IDS_FLAGS_FUSION;
                dev_info.virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
+               dev_info.virtual_address_max = (uint64_t)adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
                dev_info.virtual_address_alignment = max(PAGE_SIZE, 0x10000UL);
                dev_info.pte_fragment_size = (1 << AMDGPU_LOG2_PAGES_PER_FRAG) *
                                             AMDGPU_GPU_PAGE_SIZE;
index fb428fe54186e24431cd8c87ef8c2bb9617e6de4..65da7cd16c0f2f8725f3887d7e4f4dc699578ad9 100644 (file)
@@ -560,6 +560,8 @@ struct drm_amdgpu_info_device {
        uint64_t ids_flags;
        /** Starting virtual address for UMDs. */
        uint64_t virtual_address_offset;
+       /** The maximum virtual address */
+       uint64_t virtual_address_max;
        /** Required alignment of virtual addresses. */
        uint32_t virtual_address_alignment;
        /** Page table entry - fragment size */