From 29cc82844e03b6f9f0e6801169b6fa0e72d56628 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 25 Apr 2017 15:56:12 -0700 Subject: gpu: nvgpu: Split vm_area management into vm code The vm_reserve_va_node struct is essentially a special VM area that can be used for sparse mappings and fixed mappings. The name of this struct is somewhat confusing (as node is typically used for list items). Though this struct is a part of a list it doesn't really make sense to call this a list item since it's much more. Based on that the struct has been renamed to nvgpu_vm_area to capture the actual use of the struct more accurately. This also moves all of the management code of vm areas to a new file devoted solely to vm_area management. Also add a brief overview of the VM architecture. This should help other people follow along the hierachy of ownership and lifetimes in the rather complex MM code. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: If85e1cf868031d0dc265e7bed50b58a2aed2602e Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1477744 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 357962c7..6ddf842a 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -140,22 +140,6 @@ struct priv_cmd_entry { u32 size; /* in words */ }; -struct vm_reserved_va_node { - struct nvgpu_list_node reserved_va_list; - struct nvgpu_list_node buffer_list_head; - u32 pgsz_idx; - u64 vaddr_start; - u64 size; - bool sparse; -}; - -static inline struct vm_reserved_va_node * -vm_reserved_va_node_from_reserved_va_list(struct nvgpu_list_node *node) -{ - return (struct vm_reserved_va_node *) - ((uintptr_t)node - offsetof(struct vm_reserved_va_node, reserved_va_list)); -}; - struct gk20a; struct channel_gk20a; @@ -442,10 +426,6 @@ struct nvgpu_as_free_space_args; int gk20a_vm_alloc_share(struct gk20a_as_share *as_share, u32 big_page_size, u32 flags); int gk20a_vm_release_share(struct gk20a_as_share *as_share); -int gk20a_vm_alloc_space(struct gk20a_as_share *as_share, - struct nvgpu_as_alloc_space_args *args); -int gk20a_vm_free_space(struct gk20a_as_share *as_share, - struct nvgpu_as_free_space_args *args); int gk20a_vm_bind_channel(struct gk20a_as_share *as_share, struct channel_gk20a *ch); int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch); @@ -491,5 +471,6 @@ extern const struct gk20a_mmu_level gk20a_mm_levels_128k[]; int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, u64 *buffer_id, u64 *buffer_len); +void gk20a_vm_unmap_locked_kref(struct kref *ref); #endif /* MM_GK20A_H */ -- cgit v1.2.2