From 35ae4194a05d47aa6d79353428f81f2ca47ce90f Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 16 Nov 2017 12:56:53 -0800 Subject: gpu: nvgpu: Add translation for NVGPU MM flags Add a translation layer to convert from the NVGPU_AS_* flags to to new set of NVGPU_VM_MAP_* and NVGPU_VM_AREA_ALLOC_* flags. This allows the common MM code to not depend on the UAPI header defined for Linux. In addition to this change a couple of other small changes were made: 1. Deprecate, print a warning, and ignore usage of the NVGPU_AS_MAP_BUFFER_FLAGS_MAPPABLE_COMPBITS flag. 2. Move the t19x IO coherence flag from the t19x UAPI header to the regular UAPI header. JIRA NVGPU-293 Change-Id: I146402b0e8617294374e63e78f8826c57cd3b291 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1599802 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vm.h | 12 ++++++++++++ drivers/gpu/nvgpu/include/nvgpu/vm_area.h | 6 ++++++ 2 files changed, 18 insertions(+) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index 7009ddf4..e091f181 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -199,6 +199,18 @@ struct vm_gk20a { u64 syncpt_ro_map_gpu_va; }; +/* + * Mapping flags. + */ +#define NVGPU_VM_MAP_FIXED_OFFSET (1 << 0) +#define NVGPU_VM_MAP_CACHEABLE (1 << 1) +#define NVGPU_VM_MAP_IO_COHERENT (1 << 2) +#define NVGPU_VM_MAP_UNMAPPED_PTE (1 << 3) +#define NVGPU_VM_MAP_DIRECT_KIND_CTRL (1 << 4) +#define NVGPU_VM_MAP_L3_ALLOC (1 << 5) + +#define NVGPU_KIND_INVALID -1 + void nvgpu_vm_get(struct vm_gk20a *vm); void nvgpu_vm_put(struct vm_gk20a *vm); diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm_area.h b/drivers/gpu/nvgpu/include/nvgpu/vm_area.h index 7fc77b29..92852633 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm_area.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm_area.h @@ -57,6 +57,12 @@ nvgpu_vm_area_from_vm_area_list(struct nvgpu_list_node *node) vm_area_list)); }; +/* + * Alloc space flags. + */ +#define NVGPU_VM_AREA_ALLOC_FIXED_OFFSET (1 << 0) +#define NVGPU_VM_AREA_ALLOC_SPARSE (1 << 1) + int nvgpu_vm_area_alloc(struct vm_gk20a *vm, u32 pages, u32 page_size, u64 *addr, u32 flags); int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr); -- cgit v1.2.2