| /kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ |
| D | mem.c | 23 #include "mem.h" 35 struct page **mem; member 45 return nvkm_mem(memory)->target; in nvkm_mem_target() 57 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_addr() local 58 if (mem->pages == 1 && mem->mem) in nvkm_mem_addr() 59 return mem->dma[0]; in nvkm_mem_addr() 66 return nvkm_mem(memory)->pages << PAGE_SHIFT; in nvkm_mem_size() 73 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_map_dma() local 75 .memory = &mem->memory, in nvkm_mem_map_dma() 77 .dma = mem->dma, in nvkm_mem_map_dma() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ |
| D | mem.c | 23 #include "mem.h" 35 struct page **mem; member 45 return nvkm_mem(memory)->target; in nvkm_mem_target() 57 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_addr() local 58 if (mem->pages == 1 && mem->mem) in nvkm_mem_addr() 59 return mem->dma[0]; in nvkm_mem_addr() 66 return nvkm_mem(memory)->pages << PAGE_SHIFT; in nvkm_mem_size() 73 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_map_dma() local 75 .memory = &mem->memory, in nvkm_mem_map_dma() 77 .dma = mem->dma, in nvkm_mem_map_dma() [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/i915/ |
| D | intel_memory_region.c | 1 // SPDX-License-Identifier: MIT 36 static int __iopagetest(struct intel_memory_region *mem, in __iopagetest() argument 49 result[2] = ioread8(va + pagesize - 1); in __iopagetest() 51 dev_err(mem->i915->drm.dev, in __iopagetest() 53 &mem->region, &mem->io_start, &offset, caller, in __iopagetest() 55 return -EINVAL; in __iopagetest() 61 static int iopagetest(struct intel_memory_region *mem, in iopagetest() argument 70 va = ioremap_wc(mem->io_start + offset, PAGE_SIZE); in iopagetest() 72 dev_err(mem->i915->drm.dev, in iopagetest() 74 &mem->io_start, &offset, caller); in iopagetest() [all …]
|
| D | intel_region_ttm.c | 1 // SPDX-License-Identifier: MIT 26 * intel_region_ttm_device_init - Initialize a TTM device 33 struct drm_device *drm = &dev_priv->drm; in intel_region_ttm_device_init() 35 return ttm_device_init(&dev_priv->bdev, i915_ttm_driver(), in intel_region_ttm_device_init() 36 drm->dev, drm->anon_inode->i_mapping, in intel_region_ttm_device_init() 37 drm->vma_offset_manager, false, false); in intel_region_ttm_device_init() 41 * intel_region_ttm_device_fini - Finalize a TTM device 46 ttm_device_fini(&dev_priv->bdev); in intel_region_ttm_device_fini() 51 * driver-private types for now, reserving TTM_PL_VRAM for stolen 54 int intel_region_to_ttm_type(const struct intel_memory_region *mem) in intel_region_to_ttm_type() argument [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/i915/ |
| D | intel_memory_region.c | 1 // SPDX-License-Identifier: MIT 10 #define REGION_MAP(type, inst) \ argument 11 BIT((type) + INTEL_MEMORY_TYPE_SHIFT) | BIT(inst) 27 if (mr->type == mem_type) in intel_memory_region_by_type() 34 intel_memory_region_free_pages(struct intel_memory_region *mem, in intel_memory_region_free_pages() argument 41 size += i915_buddy_block_size(&mem->mm, block); in intel_memory_region_free_pages() 42 i915_buddy_free(&mem->mm, block); in intel_memory_region_free_pages() 50 __intel_memory_region_put_pages_buddy(struct intel_memory_region *mem, in __intel_memory_region_put_pages_buddy() argument 53 mutex_lock(&mem->mm_lock); in __intel_memory_region_put_pages_buddy() 54 mem->avail += intel_memory_region_free_pages(mem, blocks); in __intel_memory_region_put_pages_buddy() [all …]
|
| D | intel_memory_region.h | 1 /* SPDX-License-Identifier: MIT */ 12 #include <linux/io-mapping.h> 23 * Base memory type 51 for (id = 0; id < ARRAY_SIZE((i915)->mm.regions); id++) \ 52 for_each_if((mr) = (i915)->mm.regions[id]) 55 * Memory regions encoded as type | instance 62 int (*init)(struct intel_memory_region *mem); 63 void (*release)(struct intel_memory_region *mem); 66 (*create_object)(struct intel_memory_region *mem, 92 unsigned int type; member [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/ |
| D | nouveau_mem.c | 36 nouveau_mem_map(struct nouveau_mem *mem, in nouveau_mem_map() argument 47 switch (vmm->object.oclass) { in nouveau_mem_map() 54 args.nv50.kind = mem->kind; in nouveau_mem_map() 55 args.nv50.comp = mem->comp; in nouveau_mem_map() 62 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map() 68 args.gf100.kind = mem->kind; in nouveau_mem_map() 73 return -ENOSYS; in nouveau_mem_map() 76 super = vmm->object.client->super; in nouveau_mem_map() 77 vmm->object.client->super = true; in nouveau_mem_map() 78 ret = nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, in nouveau_mem_map() [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/ |
| D | nouveau_mem.c | 37 nouveau_mem_map(struct nouveau_mem *mem, in nouveau_mem_map() argument 46 switch (vmm->object.oclass) { in nouveau_mem_map() 53 args.nv50.kind = mem->kind; in nouveau_mem_map() 54 args.nv50.comp = mem->comp; in nouveau_mem_map() 61 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map() 67 args.gf100.kind = mem->kind; in nouveau_mem_map() 72 return -ENOSYS; in nouveau_mem_map() 75 return nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, &mem->mem, 0); in nouveau_mem_map() 79 nouveau_mem_fini(struct nouveau_mem *mem) in nouveau_mem_fini() argument 81 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[1]); in nouveau_mem_fini() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvif/ |
| D | mem.c | 22 #include <nvif/mem.h> 28 nvif_mem_ctor_map(struct nvif_mmu *mmu, const char *name, u8 type, u64 size, in nvif_mem_ctor_map() argument 29 struct nvif_mem *mem) in nvif_mem_ctor_map() argument 31 int ret = nvif_mem_ctor(mmu, name, mmu->mem, NVIF_MEM_MAPPABLE | type, in nvif_mem_ctor_map() 32 0, size, NULL, 0, mem); in nvif_mem_ctor_map() 34 ret = nvif_object_map(&mem->object, NULL, 0); in nvif_mem_ctor_map() 36 nvif_mem_dtor(mem); in nvif_mem_ctor_map() 42 nvif_mem_dtor(struct nvif_mem *mem) in nvif_mem_dtor() argument 44 nvif_object_dtor(&mem->object); in nvif_mem_dtor() 49 int type, u8 page, u64 size, void *argv, u32 argc, in nvif_mem_ctor_type() argument [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvif/ |
| D | mem.c | 22 #include <nvif/mem.h> 28 nvif_mem_ctor_map(struct nvif_mmu *mmu, const char *name, u8 type, u64 size, in nvif_mem_ctor_map() argument 29 struct nvif_mem *mem) in nvif_mem_ctor_map() argument 31 int ret = nvif_mem_ctor(mmu, name, mmu->mem, NVIF_MEM_MAPPABLE | type, in nvif_mem_ctor_map() 32 0, size, NULL, 0, mem); in nvif_mem_ctor_map() 34 ret = nvif_object_map(&mem->object, NULL, 0); in nvif_mem_ctor_map() 36 nvif_mem_dtor(mem); in nvif_mem_ctor_map() 42 nvif_mem_dtor(struct nvif_mem *mem) in nvif_mem_dtor() argument 44 nvif_object_dtor(&mem->object); in nvif_mem_dtor() 49 int type, u8 page, u64 size, void *argv, u32 argc, in nvif_mem_ctor_type() argument [all …]
|
| /kernel/linux/linux-5.10/net/core/ |
| D | xdp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 41 BUILD_BUG_ON(sizeof_field(struct xdp_mem_allocator, mem.id) in xdp_mem_id_hashfn() 52 u32 mem_id = *(u32 *)arg->key; in xdp_mem_id_cmp() 54 return xa->mem.id != mem_id; in xdp_mem_id_cmp() 60 .key_offset = offsetof(struct xdp_mem_allocator, mem.id), 61 .key_len = sizeof_field(struct xdp_mem_allocator, mem.id), 76 ida_simple_remove(&mem_id_pool, xa->mem.id); in __xdp_mem_allocator_rcu_free() 85 if (!rhashtable_remove_fast(mem_id_ht, &xa->node, mem_id_rht_params)) in mem_xa_remove() 86 call_rcu(&xa->rcu, __xdp_mem_allocator_rcu_free); in mem_xa_remove() 101 if (xa->allocator == allocator) in mem_allocator_disconnect() [all …]
|
| /kernel/linux/linux-6.6/net/core/ |
| D | xdp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 43 BUILD_BUG_ON(sizeof_field(struct xdp_mem_allocator, mem.id) in xdp_mem_id_hashfn() 54 u32 mem_id = *(u32 *)arg->key; in xdp_mem_id_cmp() 56 return xa->mem.id != mem_id; in xdp_mem_id_cmp() 62 .key_offset = offsetof(struct xdp_mem_allocator, mem.id), 63 .key_len = sizeof_field(struct xdp_mem_allocator, mem.id), 78 ida_simple_remove(&mem_id_pool, xa->mem.id); in __xdp_mem_allocator_rcu_free() 87 if (!rhashtable_remove_fast(mem_id_ht, &xa->node, mem_id_rht_params)) in mem_xa_remove() 88 call_rcu(&xa->rcu, __xdp_mem_allocator_rcu_free); in mem_xa_remove() 103 if (xa->allocator == allocator) in mem_allocator_disconnect() [all …]
|
| /kernel/linux/linux-5.10/drivers/infiniband/sw/rxe/ |
| D | rxe_mr.c | 1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB 27 int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length) in mem_check_range() argument 29 switch (mem->type) { in mem_check_range() 35 if (iova < mem->iova || in mem_check_range() 36 length > mem->length || in mem_check_range() 37 iova > mem->iova + mem->length - length) in mem_check_range() 38 return -EFAULT; in mem_check_range() 42 return -EFAULT; in mem_check_range() 50 static void rxe_mem_init(int access, struct rxe_mem *mem) in rxe_mem_init() argument 52 u32 lkey = mem->pelem.index << 8 | rxe_get_key(); in rxe_mem_init() [all …]
|
| /kernel/linux/linux-6.6/crypto/ |
| D | api.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 43 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get() 49 struct module *module = alg->cra_module; in crypto_mod_put() 56 static struct crypto_alg *__crypto_alg_lookup(const char *name, u32 type, in __crypto_alg_lookup() argument 60 int best = -2; in __crypto_alg_lookup() 68 if ((q->cra_flags ^ type) & mask) in __crypto_alg_lookup() 73 ((struct crypto_larval *)q)->mask != mask) in __crypto_alg_lookup() 76 exact = !strcmp(q->cra_driver_name, name); in __crypto_alg_lookup() 77 fuzzy = !strcmp(q->cra_name, name); in __crypto_alg_lookup() 78 if (!exact && !(fuzzy && q->cra_priority > best)) in __crypto_alg_lookup() [all …]
|
| /kernel/linux/linux-6.6/drivers/char/agp/ |
| D | i460-agp.c | 8 * Clean up & simplification by David Mosberger-Tang <davidm@hpl.hp.com> 41 #define I460_KPAGES_PER_IOPAGE (1 << (I460_IO_PAGE_SHIFT - PAGE_SHIFT)) 47 /* Control bits for Out-Of-GART coherency and Burst Write Combining */ 52 * gatt_table entries are 32-bits wide on the i460; the generic code ought to declare the 64 dma_addr_t addr, int type); 77 unsigned long *alloced_map; /* bitmap of kernel-pages in use */ 100 .type = 0 111 pci_read_config_byte(agp_bridge->dev, INTEL_I460_GXBCTL, &temp); in i460_fetch_size() 117 "I/O (GART) page-size %luKB doesn't match expected " in i460_fetch_size() 119 1UL << (i460.io_page_shift - 10), in i460_fetch_size() [all …]
|
| D | parisc-agp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2006, Kyle McMartin <kyle@parisc-linux.org> 7 * Based on drivers/char/agpgart/hp-agp.c which is 8 * (c) Copyright 2002, 2003 Hewlett-Packard Development Company, L.P. 20 #include <asm/parisc-device.h> 33 int type); 55 .type = 0 71 agp_bridge->current_size = (void *) &parisc_agp_sizes[0]; in parisc_agp_fetch_size() 81 agp_bridge->gart_bus_addr = info->gart_base; in parisc_agp_configure() 82 agp_bridge->capndx = info->lba_cap_offset; in parisc_agp_configure() [all …]
|
| /kernel/linux/linux-5.10/drivers/char/agp/ |
| D | i460-agp.c | 8 * Clean up & simplification by David Mosberger-Tang <davidm@hpl.hp.com> 41 #define I460_KPAGES_PER_IOPAGE (1 << (I460_IO_PAGE_SHIFT - PAGE_SHIFT)) 47 /* Control bits for Out-Of-GART coherency and Burst Write Combining */ 52 * gatt_table entries are 32-bits wide on the i460; the generic code ought to declare the 64 dma_addr_t addr, int type); 77 unsigned long *alloced_map; /* bitmap of kernel-pages in use */ 100 .type = 0 111 pci_read_config_byte(agp_bridge->dev, INTEL_I460_GXBCTL, &temp); in i460_fetch_size() 117 "I/O (GART) page-size %luKB doesn't match expected " in i460_fetch_size() 119 1UL << (i460.io_page_shift - 10), in i460_fetch_size() [all …]
|
| D | parisc-agp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2006, Kyle McMartin <kyle@parisc-linux.org> 7 * Based on drivers/char/agpgart/hp-agp.c which is 8 * (c) Copyright 2002, 2003 Hewlett-Packard Development Company, L.P. 20 #include <asm/parisc-device.h> 33 int type); 55 .type = 0 71 agp_bridge->current_size = (void *) &parisc_agp_sizes[0]; in parisc_agp_fetch_size() 81 agp_bridge->gart_bus_addr = info->gart_base; in parisc_agp_configure() 82 agp_bridge->capndx = info->lba_cap_offset; in parisc_agp_configure() [all …]
|
| /kernel/linux/linux-6.6/kernel/module/ |
| D | tree_lookup.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 14 * Use a latched RB-tree for __module_address(); this allows us to use 15 * RCU-sched lookups of the address from any context. 26 return (unsigned long)mod_mem->base; in __mod_tree_val() 33 return (unsigned long)mod_mem->size; in __mod_tree_size() 50 return -1; in mod_tree_comp() 66 latch_tree_insert(&node->node, &tree->root, &mod_tree_ops); in __mod_tree_insert() 71 latch_tree_erase(&node->node, &tree->root, &mod_tree_ops); in __mod_tree_remove() 80 for_each_mod_mem_type(type) { in mod_tree_insert() 81 mod->mem[type].mtn.mod = mod; in mod_tree_insert() [all …]
|
| /kernel/linux/linux-5.10/drivers/pci/hotplug/ |
| D | ibmphp_res.c | 1 // SPDX-License-Identifier: GPL-2.0+ 7 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) 25 static void update_resources(struct bus_node *bus_cur, int type, int rangeno); 29 static int add_bus_range(int type, struct range_node *, struct bus_node *); 49 newbus->busno = busno; in alloc_error_bus() 51 newbus->busno = curr->bus_num; in alloc_error_bus() 52 list_add_tail(&newbus->bus_list, &gbuses); in alloc_error_bus() 69 rs->busno = curr->bus_num; in alloc_resources() 70 rs->devfunc = curr->dev_fun; in alloc_resources() 71 rs->start = curr->start_addr; in alloc_resources() [all …]
|
| /kernel/linux/linux-6.6/drivers/pci/hotplug/ |
| D | ibmphp_res.c | 1 // SPDX-License-Identifier: GPL-2.0+ 7 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) 25 static void update_resources(struct bus_node *bus_cur, int type, int rangeno); 29 static int add_bus_range(int type, struct range_node *, struct bus_node *); 49 newbus->busno = busno; in alloc_error_bus() 51 newbus->busno = curr->bus_num; in alloc_error_bus() 52 list_add_tail(&newbus->bus_list, &gbuses); in alloc_error_bus() 69 rs->busno = curr->bus_num; in alloc_resources() 70 rs->devfunc = curr->dev_fun; in alloc_resources() 71 rs->start = curr->start_addr; in alloc_resources() [all …]
|
| /kernel/linux/linux-5.10/include/drm/ttm/ |
| D | ttm_resource.h | 30 #include <linux/dma-fence.h> 45 * @man: Pointer to a memory type manager. 49 * @mem: Pointer to a struct ttm_resource to be filled in. 51 * This function should allocate space in the memory type managed 54 * @mem::mm_node should be set to a non-null value, and 55 * @mem::start should be set to a value identifying the beginning 57 * If the memory region accommodate the buffer object, @mem::mm_node 62 * Note that @mem::mm_node will only be dereferenced by 64 * which has knowledge of the underlying type. 73 struct ttm_resource *mem); [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/via/ |
| D | via_mm.c | 18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 25 * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com> 38 #define VIA_MM_ALIGN_MASK ((1 << VIA_MM_ALIGN_SHIFT) - 1) 48 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private; in via_agp_init() 50 mutex_lock(&dev->struct_mutex); in via_agp_init() 51 drm_mm_init(&dev_priv->agp_mm, 0, agp->size >> VIA_MM_ALIGN_SHIFT); in via_agp_init() 53 dev_priv->agp_initialized = 1; in via_agp_init() 54 dev_priv->agp_offset = agp->offset; in via_agp_init() 55 mutex_unlock(&dev->struct_mutex); in via_agp_init() 57 DRM_DEBUG("offset = %u, size = %u\n", agp->offset, agp->size); in via_agp_init() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/ttm/ |
| D | ttm_bo.c | 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 4 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA 21 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 29 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> 44 #include <linux/dma-resv.h> 49 * ttm_global_mutex - protecting the global BO state 75 bo, bo->mem.num_pages, bo->mem.size >> 10, in ttm_bo_mem_space_debug() 76 bo->mem.size >> 20); in ttm_bo_mem_space_debug() 77 for (i = 0; i < placement->num_placement; i++) { in ttm_bo_mem_space_debug() 78 mem_type = placement->placement[i].mem_type; in ttm_bo_mem_space_debug() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/vmwgfx/ |
| D | vmwgfx_gmrid_manager.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 4 * Copyright 2007-2010 VMware, Inc., Palo Alto, CA., USA 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 28 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> 56 struct ttm_resource *mem) in vmw_gmrid_man_get_node() argument 61 id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL); in vmw_gmrid_man_get_node() 65 spin_lock(&gman->lock); in vmw_gmrid_man_get_node() 67 if (gman->max_gmr_pages > 0) { in vmw_gmrid_man_get_node() 68 gman->used_gmr_pages += bo->num_pages; in vmw_gmrid_man_get_node() 69 if (unlikely(gman->used_gmr_pages > gman->max_gmr_pages)) in vmw_gmrid_man_get_node() [all …]
|