Lines Matching refs:context

42 to_v2_context(struct etnaviv_iommu_context *context)  in to_v2_context()  argument
44 return container_of(context, struct etnaviv_iommuv2_context, base); in to_v2_context()
47 static void etnaviv_iommuv2_free(struct etnaviv_iommu_context *context) in etnaviv_iommuv2_free() argument
49 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_free()
52 drm_mm_takedown(&context->mm); in etnaviv_iommuv2_free()
56 dma_free_wc(context->global->dev, SZ_4K, in etnaviv_iommuv2_free()
61 dma_free_wc(context->global->dev, SZ_4K, v2_context->mtlb_cpu, in etnaviv_iommuv2_free()
64 clear_bit(v2_context->id, context->global->v2.pta_alloc); in etnaviv_iommuv2_free()
92 static int etnaviv_iommuv2_map(struct etnaviv_iommu_context *context, in etnaviv_iommuv2_map() argument
96 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_map()
121 static size_t etnaviv_iommuv2_unmap(struct etnaviv_iommu_context *context, in etnaviv_iommuv2_unmap() argument
124 struct etnaviv_iommuv2_context *etnaviv_domain = to_v2_context(context); in etnaviv_iommuv2_unmap()
138 static size_t etnaviv_iommuv2_dump_size(struct etnaviv_iommu_context *context) in etnaviv_iommuv2_dump_size() argument
140 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_dump_size()
151 static void etnaviv_iommuv2_dump(struct etnaviv_iommu_context *context, void *buf) in etnaviv_iommuv2_dump() argument
153 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_dump()
166 struct etnaviv_iommu_context *context) in etnaviv_iommuv2_restore_nonsec() argument
168 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_restore_nonsec()
177 gpu->mmu_context = etnaviv_iommu_context_get(context); in etnaviv_iommuv2_restore_nonsec()
181 (u32)context->global->bad_page_dma); in etnaviv_iommuv2_restore_nonsec()
190 struct etnaviv_iommu_context *context) in etnaviv_iommuv2_restore_sec() argument
192 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_restore_sec()
201 gpu->mmu_context = etnaviv_iommu_context_get(context); in etnaviv_iommuv2_restore_sec()
204 lower_32_bits(context->global->v2.pta_dma)); in etnaviv_iommuv2_restore_sec()
206 upper_32_bits(context->global->v2.pta_dma)); in etnaviv_iommuv2_restore_sec()
210 lower_32_bits(context->global->bad_page_dma)); in etnaviv_iommuv2_restore_sec()
212 lower_32_bits(context->global->bad_page_dma)); in etnaviv_iommuv2_restore_sec()
215 upper_32_bits(context->global->bad_page_dma)) | in etnaviv_iommuv2_restore_sec()
217 upper_32_bits(context->global->bad_page_dma))); in etnaviv_iommuv2_restore_sec()
219 context->global->v2.pta_cpu[v2_context->id] = v2_context->mtlb_dma | in etnaviv_iommuv2_restore_sec()
231 u32 etnaviv_iommuv2_get_mtlb_addr(struct etnaviv_iommu_context *context) in etnaviv_iommuv2_get_mtlb_addr() argument
233 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_get_mtlb_addr()
238 unsigned short etnaviv_iommuv2_get_pta_id(struct etnaviv_iommu_context *context) in etnaviv_iommuv2_get_pta_id() argument
240 struct etnaviv_iommuv2_context *v2_context = to_v2_context(context); in etnaviv_iommuv2_get_pta_id()
245 struct etnaviv_iommu_context *context) in etnaviv_iommuv2_restore() argument
249 etnaviv_iommuv2_restore_nonsec(gpu, context); in etnaviv_iommuv2_restore()
252 etnaviv_iommuv2_restore_sec(gpu, context); in etnaviv_iommuv2_restore()
273 struct etnaviv_iommu_context *context; in etnaviv_iommuv2_context_alloc() local
300 context = &v2_context->base; in etnaviv_iommuv2_context_alloc()
301 context->global = global; in etnaviv_iommuv2_context_alloc()
302 kref_init(&context->refcount); in etnaviv_iommuv2_context_alloc()
303 mutex_init(&context->lock); in etnaviv_iommuv2_context_alloc()
304 INIT_LIST_HEAD(&context->mappings); in etnaviv_iommuv2_context_alloc()
305 drm_mm_init(&context->mm, SZ_4K, (u64)SZ_1G * 4 - SZ_4K); in etnaviv_iommuv2_context_alloc()
307 return context; in etnaviv_iommuv2_context_alloc()