summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 30f9e50b..df64d2ca 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -174,6 +174,25 @@ struct compbit_store_desc {
174 u64 base_iova; 174 u64 base_iova;
175}; 175};
176 176
177struct gk20a_buffer_state {
178 struct list_head list;
179
180 /* The valid compbits and the fence must be changed atomically. */
181 struct mutex lock;
182
183 /* Offset of the surface within the dma-buf whose state is
184 * described by this struct (one dma-buf can contain multiple
185 * surfaces with different states). */
186 size_t offset;
187
188 /* A bitmask of valid sets of compbits (0 = uncompressed). */
189 u32 valid_compbits;
190
191 /* This struct reflects the state of the buffer when this
192 * fence signals. */
193 struct gk20a_fence *fence;
194};
195
177struct page_table_gk20a { 196struct page_table_gk20a {
178 /* backing for */ 197 /* backing for */
179 /* Either a *page or a *mem_handle */ 198 /* Either a *page or a *mem_handle */
@@ -484,6 +503,9 @@ dma_addr_t gk20a_mm_gpuva_to_iova(struct vm_gk20a *vm, u64 gpu_vaddr);
484 503
485int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); 504int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev);
486 505
506int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct device *dev,
507 u64 offset, struct gk20a_buffer_state **state);
508
487int map_gmmu_pages(void *handle, struct sg_table *sgt, 509int map_gmmu_pages(void *handle, struct sg_table *sgt,
488 void **va, size_t size); 510 void **va, size_t size);
489void unmap_gmmu_pages(void *handle, struct sg_table *sgt, void *va); 511void unmap_gmmu_pages(void *handle, struct sg_table *sgt, void *va);