diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vm_priv.h')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vm_priv.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vm_priv.h b/drivers/gpu/nvgpu/common/linux/vm_priv.h index 4f6b10bb..1eadf1d0 100644 --- a/drivers/gpu/nvgpu/common/linux/vm_priv.h +++ b/drivers/gpu/nvgpu/common/linux/vm_priv.h | |||
@@ -34,7 +34,9 @@ struct buffer_attrs { | |||
34 | u32 ctag_allocated_lines; | 34 | u32 ctag_allocated_lines; |
35 | int pgsz_idx; | 35 | int pgsz_idx; |
36 | u8 kind_v; | 36 | u8 kind_v; |
37 | bool use_kind_v; | ||
37 | u8 uc_kind_v; | 38 | u8 uc_kind_v; |
39 | bool use_uc_kind_v; | ||
38 | bool ctag_user_mappable; | 40 | bool ctag_user_mappable; |
39 | }; | 41 | }; |
40 | 42 | ||
@@ -42,19 +44,43 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm, | |||
42 | struct dma_buf *dmabuf, | 44 | struct dma_buf *dmabuf, |
43 | u64 offset_align, | 45 | u64 offset_align, |
44 | u32 flags, | 46 | u32 flags, |
45 | int kind, | 47 | |
48 | /* | ||
49 | * compressible kind if | ||
50 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
51 | * specified, otherwise just the kind | ||
52 | */ | ||
53 | s16 compr_kind, | ||
54 | |||
55 | /* | ||
56 | * incompressible kind if | ||
57 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
58 | * specified, otherwise ignored | ||
59 | */ | ||
60 | s16 incompr_kind, | ||
61 | |||
46 | bool user_mapped, | 62 | bool user_mapped, |
47 | int rw_flag, | 63 | int rw_flag, |
48 | u64 buffer_offset, | 64 | u64 buffer_offset, |
49 | u64 mapping_size, | 65 | u64 mapping_size, |
50 | struct vm_gk20a_mapping_batch *mapping_batch); | 66 | struct vm_gk20a_mapping_batch *mapping_batch); |
51 | 67 | ||
52 | /* Note: batch may be NULL if map op is not part of a batch */ | 68 | /* |
69 | * Notes: | ||
70 | * - Batch may be NULL if map op is not part of a batch. | ||
71 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is set, | ||
72 | * compr_kind and incompr_kind work as explained in nvgpu.h. | ||
73 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is NOT set, | ||
74 | * compr_kind holds the kind and kernel will figure out whether | ||
75 | * it is a compressible or incompressible kind. If compressible, kernel will | ||
76 | * also figure out the incompressible counterpart or return an error. | ||
77 | */ | ||
53 | int nvgpu_vm_map_buffer(struct vm_gk20a *vm, | 78 | int nvgpu_vm_map_buffer(struct vm_gk20a *vm, |
54 | int dmabuf_fd, | 79 | int dmabuf_fd, |
55 | u64 *offset_align, | 80 | u64 *offset_align, |
56 | u32 flags, /* NVGPU_AS_MAP_BUFFER_FLAGS_ */ | 81 | u32 flags, /* NVGPU_AS_MAP_BUFFER_FLAGS_ */ |
57 | int kind, | 82 | s16 compr_kind, |
83 | s16 incompr_kind, | ||
58 | u64 buffer_offset, | 84 | u64 buffer_offset, |
59 | u64 mapping_size, | 85 | u64 mapping_size, |
60 | struct vm_gk20a_mapping_batch *batch); | 86 | struct vm_gk20a_mapping_batch *batch); |