diff options
Diffstat (limited to 'mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h')
-rw-r--r-- | mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h b/mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h index 2c006d9..96f2b03 100644 --- a/mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h +++ b/mali_kbase/csf/mali_kbase_csf_tiler_heap_def.h @@ -56,12 +56,20 @@ ((CHUNK_HDR_NEXT_ADDR_MASK >> CHUNK_HDR_NEXT_ADDR_POS) << \ CHUNK_HDR_NEXT_ADDR_ENCODE_SHIFT) +/* The size of the area needed to be vmapped prior to handing the tiler heap + * over to the tiler, so that the shrinker could be invoked. + */ +#define NEXT_CHUNK_ADDR_SIZE (sizeof(u64)) + /** * struct kbase_csf_tiler_heap_chunk - A tiler heap chunk managed by the kernel * * @link: Link to this chunk in a list of chunks belonging to a * @kbase_csf_tiler_heap. * @region: Pointer to the GPU memory region allocated for the chunk. + * @map: Kernel VA mapping so that we would not need to use vmap in the + * shrinker callback, which can allocate. This maps only the header + * of the chunk, so it could be traversed. * @gpu_va: GPU virtual address of the start of the memory region. * This points to the header of the chunk and not to the low address * of free memory within it. @@ -75,9 +83,12 @@ struct kbase_csf_tiler_heap_chunk { struct list_head link; struct kbase_va_region *region; + struct kbase_vmap_struct map; u64 gpu_va; }; +#define HEAP_BUF_DESCRIPTOR_CHECKED (1 << 0) + /** * struct kbase_csf_tiler_heap - A tiler heap managed by the kernel * @@ -85,6 +96,20 @@ struct kbase_csf_tiler_heap_chunk { * associated. * @link: Link to this heap in a list of tiler heaps belonging to * the @kbase_csf_tiler_heap_context. + * @chunks_list: Linked list of allocated chunks. + * @gpu_va: The GPU virtual address of the heap context structure that + * was allocated for the firmware. This is also used to + * uniquely identify the heap. + * @heap_id: Unique id representing the heap, assigned during heap + * initialization. + * @buf_desc_va: Buffer descriptor GPU VA. Can be 0 for backward compatible + * to earlier version base interfaces. + * @buf_desc_reg: Pointer to the VA region that covers the provided buffer + * descriptor memory object pointed to by buf_desc_va. + * @gpu_va_map: Kernel VA mapping of the GPU VA region. + * @buf_desc_map: Kernel VA mapping of the buffer descriptor, read from + * during the tiler heap shrinker. Sync operations may need + * to be done before each read. * @chunk_size: Size of each chunk, in bytes. Must be page-aligned. * @chunk_count: The number of chunks currently allocated. Must not be * zero or greater than @max_chunks. @@ -93,22 +118,23 @@ struct kbase_csf_tiler_heap_chunk { * @target_in_flight: Number of render-passes that the driver should attempt * to keep in flight for which allocation of new chunks is * allowed. Must not be zero. - * @gpu_va: The GPU virtual address of the heap context structure that - * was allocated for the firmware. This is also used to - * uniquely identify the heap. - * @heap_id: Unique id representing the heap, assigned during heap - * initialization. - * @chunks_list: Linked list of allocated chunks. + * @buf_desc_checked: Indicates if runtime check on buffer descriptor has been done. */ struct kbase_csf_tiler_heap { struct kbase_context *kctx; struct list_head link; + struct list_head chunks_list; + u64 gpu_va; + u64 heap_id; + u64 buf_desc_va; + struct kbase_va_region *buf_desc_reg; + struct kbase_vmap_struct buf_desc_map; + struct kbase_vmap_struct gpu_va_map; u32 chunk_size; u32 chunk_count; u32 max_chunks; u16 target_in_flight; - u64 gpu_va; - u64 heap_id; - struct list_head chunks_list; + bool buf_desc_checked; }; + #endif /* !_KBASE_CSF_TILER_HEAP_DEF_H_ */ |