Lines Matching refs:context
28 to_v1_context(struct etnaviv_iommu_context *context) in to_v1_context() argument
30 return container_of(context, struct etnaviv_iommuv1_context, base); in to_v1_context()
33 static void etnaviv_iommuv1_free(struct etnaviv_iommu_context *context) in etnaviv_iommuv1_free() argument
35 struct etnaviv_iommuv1_context *v1_context = to_v1_context(context); in etnaviv_iommuv1_free()
37 drm_mm_takedown(&context->mm); in etnaviv_iommuv1_free()
39 dma_free_wc(context->global->dev, PT_SIZE, v1_context->pgtable_cpu, in etnaviv_iommuv1_free()
42 context->global->v1.shared_context = NULL; in etnaviv_iommuv1_free()
47 static int etnaviv_iommuv1_map(struct etnaviv_iommu_context *context, in etnaviv_iommuv1_map() argument
51 struct etnaviv_iommuv1_context *v1_context = to_v1_context(context); in etnaviv_iommuv1_map()
62 static size_t etnaviv_iommuv1_unmap(struct etnaviv_iommu_context *context, in etnaviv_iommuv1_unmap() argument
65 struct etnaviv_iommuv1_context *v1_context = to_v1_context(context); in etnaviv_iommuv1_unmap()
71 v1_context->pgtable_cpu[index] = context->global->bad_page_dma; in etnaviv_iommuv1_unmap()
76 static size_t etnaviv_iommuv1_dump_size(struct etnaviv_iommu_context *context) in etnaviv_iommuv1_dump_size() argument
81 static void etnaviv_iommuv1_dump(struct etnaviv_iommu_context *context, in etnaviv_iommuv1_dump() argument
84 struct etnaviv_iommuv1_context *v1_context = to_v1_context(context); in etnaviv_iommuv1_dump()
90 struct etnaviv_iommu_context *context) in etnaviv_iommuv1_restore() argument
92 struct etnaviv_iommuv1_context *v1_context = to_v1_context(context); in etnaviv_iommuv1_restore()
97 gpu->mmu_context = etnaviv_iommu_context_get(context); in etnaviv_iommuv1_restore()
100 gpu_write(gpu, VIVS_MC_MEMORY_BASE_ADDR_RA, context->global->memory_base); in etnaviv_iommuv1_restore()
101 gpu_write(gpu, VIVS_MC_MEMORY_BASE_ADDR_FE, context->global->memory_base); in etnaviv_iommuv1_restore()
102 gpu_write(gpu, VIVS_MC_MEMORY_BASE_ADDR_TX, context->global->memory_base); in etnaviv_iommuv1_restore()
103 gpu_write(gpu, VIVS_MC_MEMORY_BASE_ADDR_PEZ, context->global->memory_base); in etnaviv_iommuv1_restore()
104 gpu_write(gpu, VIVS_MC_MEMORY_BASE_ADDR_PE, context->global->memory_base); in etnaviv_iommuv1_restore()
130 struct etnaviv_iommu_context *context; in etnaviv_iommuv1_context_alloc() local
140 context = global->v1.shared_context; in etnaviv_iommuv1_context_alloc()
141 etnaviv_iommu_context_get(context); in etnaviv_iommuv1_context_alloc()
143 return context; in etnaviv_iommuv1_context_alloc()
160 context = &v1_context->base; in etnaviv_iommuv1_context_alloc()
161 context->global = global; in etnaviv_iommuv1_context_alloc()
162 kref_init(&context->refcount); in etnaviv_iommuv1_context_alloc()
163 mutex_init(&context->lock); in etnaviv_iommuv1_context_alloc()
164 INIT_LIST_HEAD(&context->mappings); in etnaviv_iommuv1_context_alloc()
165 drm_mm_init(&context->mm, GPU_MEM_START, PT_ENTRIES * SZ_4K); in etnaviv_iommuv1_context_alloc()
166 context->global->v1.shared_context = context; in etnaviv_iommuv1_context_alloc()
170 return context; in etnaviv_iommuv1_context_alloc()