From c60a300c4ac903dd7e0b53f2542a081fa4c334cb Mon Sep 17 00:00:00 2001 From: Lauri Peltonen Date: Fri, 18 Jul 2014 02:31:44 +0300 Subject: gpu: nvgpu: Attach compression state to dma-buf Bug 1509620 Change-Id: I694fe43ef5d1f4f329d997a3d60e006785374cc3 Signed-off-by: Lauri Peltonen Reviewed-on: http://git-master/r/439849 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Arto Merilainen Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (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 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 { u64 base_iova; }; +struct gk20a_buffer_state { + struct list_head list; + + /* The valid compbits and the fence must be changed atomically. */ + struct mutex lock; + + /* Offset of the surface within the dma-buf whose state is + * described by this struct (one dma-buf can contain multiple + * surfaces with different states). */ + size_t offset; + + /* A bitmask of valid sets of compbits (0 = uncompressed). */ + u32 valid_compbits; + + /* This struct reflects the state of the buffer when this + * fence signals. */ + struct gk20a_fence *fence; +}; + struct page_table_gk20a { /* backing for */ /* 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); int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); +int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct device *dev, + u64 offset, struct gk20a_buffer_state **state); + int map_gmmu_pages(void *handle, struct sg_table *sgt, void **va, size_t size); void unmap_gmmu_pages(void *handle, struct sg_table *sgt, void *va); -- cgit v1.2.2