Lines Matching refs:iter_io
546 struct ttm_kmap_iter_iomap *iter_io = in ttm_kmap_iter_iomap_map_local() local
547 container_of(iter, typeof(*iter_io), base); in ttm_kmap_iter_iomap_map_local()
551 while (i >= iter_io->cache.end) { in ttm_kmap_iter_iomap_map_local()
552 iter_io->cache.sg = iter_io->cache.sg ? in ttm_kmap_iter_iomap_map_local()
553 sg_next(iter_io->cache.sg) : iter_io->st->sgl; in ttm_kmap_iter_iomap_map_local()
554 iter_io->cache.i = iter_io->cache.end; in ttm_kmap_iter_iomap_map_local()
555 iter_io->cache.end += sg_dma_len(iter_io->cache.sg) >> in ttm_kmap_iter_iomap_map_local()
557 iter_io->cache.offs = sg_dma_address(iter_io->cache.sg) - in ttm_kmap_iter_iomap_map_local()
558 iter_io->start; in ttm_kmap_iter_iomap_map_local()
561 if (i < iter_io->cache.i) { in ttm_kmap_iter_iomap_map_local()
562 iter_io->cache.end = 0; in ttm_kmap_iter_iomap_map_local()
563 iter_io->cache.sg = NULL; in ttm_kmap_iter_iomap_map_local()
567 addr = io_mapping_map_local_wc(iter_io->iomap, iter_io->cache.offs + in ttm_kmap_iter_iomap_map_local()
568 (((resource_size_t)i - iter_io->cache.i) in ttm_kmap_iter_iomap_map_local()
597 ttm_kmap_iter_iomap_init(struct ttm_kmap_iter_iomap *iter_io, in ttm_kmap_iter_iomap_init() argument
602 iter_io->base.ops = &ttm_kmap_iter_io_ops; in ttm_kmap_iter_iomap_init()
603 iter_io->iomap = iomap; in ttm_kmap_iter_iomap_init()
604 iter_io->st = st; in ttm_kmap_iter_iomap_init()
605 iter_io->start = start; in ttm_kmap_iter_iomap_init()
606 memset(&iter_io->cache, 0, sizeof(iter_io->cache)); in ttm_kmap_iter_iomap_init()
608 return &iter_io->base; in ttm_kmap_iter_iomap_init()
628 struct ttm_kmap_iter_linear_io *iter_io = in ttm_kmap_iter_linear_io_map_local() local
629 container_of(iter, typeof(*iter_io), base); in ttm_kmap_iter_linear_io_map_local()
631 *dmap = iter_io->dmap; in ttm_kmap_iter_linear_io_map_local()
653 ttm_kmap_iter_linear_io_init(struct ttm_kmap_iter_linear_io *iter_io, in ttm_kmap_iter_linear_io_init() argument
668 iosys_map_set_vaddr(&iter_io->dmap, mem->bus.addr); in ttm_kmap_iter_linear_io_init()
669 iter_io->needs_unmap = false; in ttm_kmap_iter_linear_io_init()
671 iter_io->needs_unmap = true; in ttm_kmap_iter_linear_io_init()
672 memset(&iter_io->dmap, 0, sizeof(iter_io->dmap)); in ttm_kmap_iter_linear_io_init()
674 iosys_map_set_vaddr_iomem(&iter_io->dmap, in ttm_kmap_iter_linear_io_init()
678 iosys_map_set_vaddr(&iter_io->dmap, in ttm_kmap_iter_linear_io_init()
685 if (iosys_map_is_null(&iter_io->dmap)) in ttm_kmap_iter_linear_io_init()
686 iosys_map_set_vaddr_iomem(&iter_io->dmap, in ttm_kmap_iter_linear_io_init()
690 if (iosys_map_is_null(&iter_io->dmap)) { in ttm_kmap_iter_linear_io_init()
696 iter_io->base.ops = &ttm_kmap_iter_linear_io_ops; in ttm_kmap_iter_linear_io_init()
697 return &iter_io->base; in ttm_kmap_iter_linear_io_init()
715 ttm_kmap_iter_linear_io_fini(struct ttm_kmap_iter_linear_io *iter_io, in ttm_kmap_iter_linear_io_fini() argument
719 if (iter_io->needs_unmap && iosys_map_is_set(&iter_io->dmap)) { in ttm_kmap_iter_linear_io_fini()
720 if (iter_io->dmap.is_iomem) in ttm_kmap_iter_linear_io_fini()
721 iounmap(iter_io->dmap.vaddr_iomem); in ttm_kmap_iter_linear_io_fini()
723 memunmap(iter_io->dmap.vaddr); in ttm_kmap_iter_linear_io_fini()