summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2014-07-17 19:31:44 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:40 -0400
commitc60a300c4ac903dd7e0b53f2542a081fa4c334cb (patch)
tree1bcabef727d5a319d011c57a610c5aa59655aad6 /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parentbcf60a22c3e8671468517d34aa37548272455c1f (diff)
gpu: nvgpu: Attach compression state to dma-buf
Bug 1509620 Change-Id: I694fe43ef5d1f4f329d997a3d60e006785374cc3 Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Reviewed-on: http://git-master/r/439849 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
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);