summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-01-14 11:54:26 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:08:16 -0400
commitf3a920cb01d1517db5432c8062b660d6b60eb4de (patch)
treebc366a7df51745ea2d6b740395403cf2add2ebef /drivers/gpu/nvgpu/gk20a/gk20a.h
parent8d1ab756ed8a7f4d3138dc5da9d2de9f52915261 (diff)
gpu: nvgpu: Refactor page mapping code
Pass always the directory structure to mm functions instead of pointers to members to it. Also split update_gmmu_ptes_locked() into smaller functions, and turn the hard coded MMU levels (PDE, PTE) into run-time parameters. Change-Id: I315ef7aebbea1e61156705361f2e2a63b5fb7bf1 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/672485 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index fa80f010..ef8068e5 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -296,8 +296,7 @@ struct gpu_ops {
296 bool (*is_fw_defined)(void); 296 bool (*is_fw_defined)(void);
297 } gr_ctx; 297 } gr_ctx;
298 struct { 298 struct {
299 int (*set_sparse)(struct vm_gk20a *vm, u64 vaddr, 299 bool (*support_sparse)(struct gk20a *g);
300 u32 num_pages, u32 pgsz_idx, bool refplus);
301 bool (*is_debug_mode_enabled)(struct gk20a *g); 300 bool (*is_debug_mode_enabled)(struct gk20a *g);
302 u64 (*gmmu_map)(struct vm_gk20a *vm, 301 u64 (*gmmu_map)(struct vm_gk20a *vm,
303 u64 map_offset, 302 u64 map_offset,
@@ -309,13 +308,15 @@ struct gpu_ops {
309 u32 ctag_offset, 308 u32 ctag_offset,
310 u32 flags, 309 u32 flags,
311 int rw_flag, 310 int rw_flag,
312 bool clear_ctags); 311 bool clear_ctags,
312 bool sparse);
313 void (*gmmu_unmap)(struct vm_gk20a *vm, 313 void (*gmmu_unmap)(struct vm_gk20a *vm,
314 u64 vaddr, 314 u64 vaddr,
315 u64 size, 315 u64 size,
316 int pgsz_idx, 316 int pgsz_idx,
317 bool va_allocated, 317 bool va_allocated,
318 int rw_flag); 318 int rw_flag,
319 bool sparse);
319 void (*vm_remove)(struct vm_gk20a *vm); 320 void (*vm_remove)(struct vm_gk20a *vm);
320 int (*vm_alloc_share)(struct gk20a_as_share *as_share, 321 int (*vm_alloc_share)(struct gk20a_as_share *as_share,
321 u32 flags); 322 u32 flags);
@@ -331,6 +332,9 @@ struct gpu_ops {
331 u32 (*get_physical_addr_bits)(struct gk20a *g); 332 u32 (*get_physical_addr_bits)(struct gk20a *g);
332 int (*init_bar2_vm)(struct gk20a *g); 333 int (*init_bar2_vm)(struct gk20a *g);
333 int (*init_bar2_mm_hw_setup)(struct gk20a *g); 334 int (*init_bar2_mm_hw_setup)(struct gk20a *g);
335 const struct gk20a_mmu_level *
336 (*get_mmu_levels)(struct gk20a *g, u32 big_page_size);
337 void (*init_pdb)(struct gk20a *g, void *inst_ptr, u64 pdb_addr);
334 } mm; 338 } mm;
335 struct { 339 struct {
336 int (*prepare_ucode)(struct gk20a *g); 340 int (*prepare_ucode)(struct gk20a *g);