From b93b6389736be4c5d3b1371fc019cfb5286eafa9 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 20 Mar 2024 02:56:49 +0000 Subject: [PATCH] enable io_mapping paths for lmem --- sys/dev/pci/drm/i915/gem/i915_gem_lmem.c | 4 ---- sys/dev/pci/drm/i915/gem/i915_gem_object.c | 3 --- sys/dev/pci/drm/ttm/ttm_resource.c | 16 ---------------- 3 files changed, 23 deletions(-) diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_lmem.c b/sys/dev/pci/drm/i915/gem/i915_gem_lmem.c index 1181249d8fe..3198b64ad7d 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_lmem.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_lmem.c @@ -15,9 +15,6 @@ i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj, unsigned long n, unsigned long size) { - STUB(); - return NULL; -#ifdef notyet resource_size_t offset; GEM_BUG_ON(!i915_gem_object_is_contiguous(obj)); @@ -26,7 +23,6 @@ i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj, offset -= obj->mm.region->region.start; return io_mapping_map_wc(&obj->mm.region->iomap, offset, size); -#endif } /** diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_object.c b/sys/dev/pci/drm/i915/gem/i915_gem_object.c index 3e8e604ea4e..5453c51a0fd 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_object.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_object.c @@ -521,8 +521,6 @@ i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64 offset, static void i915_gem_object_read_from_page_iomap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size) { - STUB(); -#ifdef notyet pgoff_t idx = offset >> PAGE_SHIFT; dma_addr_t dma = i915_gem_object_get_dma_address(obj, idx); void __iomem *src_map; @@ -537,7 +535,6 @@ i915_gem_object_read_from_page_iomap(struct drm_i915_gem_object *obj, u64 offset memcpy_fromio(dst, src_ptr, size); io_mapping_unmap(src_map); -#endif } static bool object_has_mappable_iomem(struct drm_i915_gem_object *obj) diff --git a/sys/dev/pci/drm/ttm/ttm_resource.c b/sys/dev/pci/drm/ttm/ttm_resource.c index 521f52d8fd4..c651273e6c3 100644 --- a/sys/dev/pci/drm/ttm/ttm_resource.c +++ b/sys/dev/pci/drm/ttm/ttm_resource.c @@ -564,32 +564,16 @@ retry: goto retry; } -#ifdef __linux__ addr = io_mapping_map_local_wc(iter_io->iomap, iter_io->cache.offs + (((resource_size_t)i - iter_io->cache.i) << PAGE_SHIFT)); -#else - if (bus_space_map(bst, iter_io->cache.offs + - (((resource_size_t)i - iter_io->cache.i) << PAGE_SHIFT), - PAGE_SIZE, BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, - &dmap->bsh)) { - printf("%s bus_space_map failed\n", __func__); - addr = 0; - } else { - addr = bus_space_vaddr(bst, dmap->bsh); - } -#endif iosys_map_set_vaddr_iomem(dmap, addr); } static void ttm_kmap_iter_iomap_unmap_local(struct ttm_kmap_iter *iter, struct iosys_map *map, bus_space_tag_t bst) { -#ifdef notyet io_mapping_unmap_local(map->vaddr_iomem); -#else - bus_space_unmap(bst, map->bsh, PAGE_SIZE); -#endif } static const struct ttm_kmap_iter_ops ttm_kmap_iter_io_ops = { -- 2.20.1