Lines Matching full:global

29 		unmapped_page = context->global->ops->unmap(context, iova,  in etnaviv_context_unmap()
55 ret = context->global->ops->map(context, iova, paddr, pgsize, in etnaviv_context_map()
284 if (context->global->version == ETNAVIV_IOMMU_V1 && in etnaviv_iommu_map_gem()
355 context->global->ops->free(context); in etnaviv_iommu_context_free()
363 etnaviv_iommu_context_init(struct etnaviv_iommu_global *global, in etnaviv_iommu_context_init() argument
369 if (global->version == ETNAVIV_IOMMU_V1) in etnaviv_iommu_context_init()
370 ctx = etnaviv_iommuv1_context_alloc(global); in etnaviv_iommu_context_init()
372 ctx = etnaviv_iommuv2_context_alloc(global); in etnaviv_iommu_context_init()
378 global->memory_base); in etnaviv_iommu_context_init()
382 if (global->version == ETNAVIV_IOMMU_V1 && in etnaviv_iommu_context_init()
384 dev_err(global->dev, in etnaviv_iommu_context_init()
394 global->ops->free(ctx); in etnaviv_iommu_context_init()
401 context->global->ops->restore(gpu, context); in etnaviv_iommu_restore()
423 if (context->global->version == ETNAVIV_IOMMU_V1) { in etnaviv_iommu_get_suballoc_va()
463 if (mapping->use > 0 || context->global->version == ETNAVIV_IOMMU_V1) { in etnaviv_iommu_put_suballoc_va()
475 return context->global->ops->dump_size(context); in etnaviv_iommu_dump_size()
480 context->global->ops->dump(context, buf); in etnaviv_iommu_dump()
487 struct etnaviv_iommu_global *global; in etnaviv_iommu_global_init() local
496 "MMU version doesn't match global version\n"); in etnaviv_iommu_global_init()
504 global = kzalloc(sizeof(*global), GFP_KERNEL); in etnaviv_iommu_global_init()
505 if (!global) in etnaviv_iommu_global_init()
508 global->bad_page_cpu = dma_alloc_wc(dev, SZ_4K, &global->bad_page_dma, in etnaviv_iommu_global_init()
510 if (!global->bad_page_cpu) in etnaviv_iommu_global_init()
513 memset32(global->bad_page_cpu, 0xdead55aa, SZ_4K / sizeof(u32)); in etnaviv_iommu_global_init()
516 global->v2.pta_cpu = dma_alloc_wc(dev, ETNAVIV_PTA_SIZE, in etnaviv_iommu_global_init()
517 &global->v2.pta_dma, GFP_KERNEL); in etnaviv_iommu_global_init()
518 if (!global->v2.pta_cpu) in etnaviv_iommu_global_init()
522 global->dev = dev; in etnaviv_iommu_global_init()
523 global->version = version; in etnaviv_iommu_global_init()
524 global->use = 1; in etnaviv_iommu_global_init()
525 mutex_init(&global->lock); in etnaviv_iommu_global_init()
528 global->ops = &etnaviv_iommuv1_ops; in etnaviv_iommu_global_init()
530 global->ops = &etnaviv_iommuv2_ops; in etnaviv_iommu_global_init()
532 priv->mmu_global = global; in etnaviv_iommu_global_init()
537 dma_free_wc(dev, SZ_4K, global->bad_page_cpu, global->bad_page_dma); in etnaviv_iommu_global_init()
539 kfree(global); in etnaviv_iommu_global_init()
547 struct etnaviv_iommu_global *global = priv->mmu_global; in etnaviv_iommu_global_fini() local
549 if (--global->use > 0) in etnaviv_iommu_global_fini()
552 if (global->v2.pta_cpu) in etnaviv_iommu_global_fini()
553 dma_free_wc(global->dev, ETNAVIV_PTA_SIZE, in etnaviv_iommu_global_fini()
554 global->v2.pta_cpu, global->v2.pta_dma); in etnaviv_iommu_global_fini()
556 if (global->bad_page_cpu) in etnaviv_iommu_global_fini()
557 dma_free_wc(global->dev, SZ_4K, in etnaviv_iommu_global_fini()
558 global->bad_page_cpu, global->bad_page_dma); in etnaviv_iommu_global_fini()
560 mutex_destroy(&global->lock); in etnaviv_iommu_global_fini()
561 kfree(global); in etnaviv_iommu_global_fini()