mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-20 15:03:58 +00:00
560.28.03
This commit is contained in:
@@ -49,13 +49,6 @@ struct uvm_pmm_sysmem_mappings_struct
|
||||
uvm_mutex_t reverse_map_lock;
|
||||
};
|
||||
|
||||
// See comments in uvm_linux.h
|
||||
#ifdef NV_RADIX_TREE_REPLACE_SLOT_PRESENT
|
||||
#define uvm_pmm_sysmem_mappings_indirect_supported() true
|
||||
#else
|
||||
#define uvm_pmm_sysmem_mappings_indirect_supported() false
|
||||
#endif
|
||||
|
||||
// Global initialization/exit functions, that need to be called during driver
|
||||
// initialization/tear-down. These are needed to allocate/free global internal
|
||||
// data structures.
|
||||
@@ -78,35 +71,11 @@ NV_STATUS uvm_pmm_sysmem_mappings_add_gpu_mapping(uvm_pmm_sysmem_mappings_t *sys
|
||||
uvm_va_block_t *va_block,
|
||||
uvm_processor_id_t owner);
|
||||
|
||||
static NV_STATUS uvm_pmm_sysmem_mappings_add_gpu_chunk_mapping(uvm_pmm_sysmem_mappings_t *sysmem_mappings,
|
||||
NvU64 dma_addr,
|
||||
NvU64 virt_addr,
|
||||
NvU64 region_size,
|
||||
uvm_va_block_t *va_block,
|
||||
uvm_gpu_id_t owner)
|
||||
{
|
||||
if (!uvm_pmm_sysmem_mappings_indirect_supported())
|
||||
return NV_OK;
|
||||
|
||||
return uvm_pmm_sysmem_mappings_add_gpu_mapping(sysmem_mappings,
|
||||
dma_addr,
|
||||
virt_addr,
|
||||
region_size,
|
||||
va_block,
|
||||
owner);
|
||||
}
|
||||
|
||||
// If the GPU used to initialize sysmem_mappings supports access counters, the
|
||||
// entries for the physical region starting at dma_addr are removed from the
|
||||
// reverse map.
|
||||
void uvm_pmm_sysmem_mappings_remove_gpu_mapping(uvm_pmm_sysmem_mappings_t *sysmem_mappings, NvU64 dma_addr);
|
||||
|
||||
static void uvm_pmm_sysmem_mappings_remove_gpu_chunk_mapping(uvm_pmm_sysmem_mappings_t *sysmem_mappings, NvU64 dma_addr)
|
||||
{
|
||||
if (uvm_pmm_sysmem_mappings_indirect_supported())
|
||||
uvm_pmm_sysmem_mappings_remove_gpu_mapping(sysmem_mappings, dma_addr);
|
||||
}
|
||||
|
||||
// Like uvm_pmm_sysmem_mappings_remove_gpu_mapping but it doesn't assert if the
|
||||
// mapping doesn't exist. See uvm_va_block_evict_chunks for more information.
|
||||
void uvm_pmm_sysmem_mappings_remove_gpu_mapping_on_eviction(uvm_pmm_sysmem_mappings_t *sysmem_mappings, NvU64 dma_addr);
|
||||
@@ -118,14 +87,6 @@ void uvm_pmm_sysmem_mappings_reparent_gpu_mapping(uvm_pmm_sysmem_mappings_t *sys
|
||||
NvU64 dma_addr,
|
||||
uvm_va_block_t *va_block);
|
||||
|
||||
static void uvm_pmm_sysmem_mappings_reparent_gpu_chunk_mapping(uvm_pmm_sysmem_mappings_t *sysmem_mappings,
|
||||
NvU64 dma_addr,
|
||||
uvm_va_block_t *va_block)
|
||||
{
|
||||
if (uvm_pmm_sysmem_mappings_indirect_supported())
|
||||
uvm_pmm_sysmem_mappings_reparent_gpu_mapping(sysmem_mappings, dma_addr, va_block);
|
||||
}
|
||||
|
||||
// If the GPU used to initialize sysmem_mappings supports access counters, the
|
||||
// mapping for the region starting at dma_addr is split into regions of
|
||||
// new_region_size. new_region_size must be a power of two and smaller than the
|
||||
@@ -134,16 +95,6 @@ NV_STATUS uvm_pmm_sysmem_mappings_split_gpu_mappings(uvm_pmm_sysmem_mappings_t *
|
||||
NvU64 dma_addr,
|
||||
NvU64 new_region_size);
|
||||
|
||||
static NV_STATUS uvm_pmm_sysmem_mappings_split_gpu_chunk_mappings(uvm_pmm_sysmem_mappings_t *sysmem_mappings,
|
||||
NvU64 dma_addr,
|
||||
NvU64 new_region_size)
|
||||
{
|
||||
if (!uvm_pmm_sysmem_mappings_indirect_supported())
|
||||
return NV_OK;
|
||||
|
||||
return uvm_pmm_sysmem_mappings_split_gpu_mappings(sysmem_mappings, dma_addr, new_region_size);
|
||||
}
|
||||
|
||||
// If the GPU used to initialize sysmem_mappings supports access counters, all
|
||||
// the mappings within the region [dma_addr, dma_addr + new_region_size) are
|
||||
// merged into a single mapping. new_region_size must be a power of two. The
|
||||
@@ -153,14 +104,6 @@ void uvm_pmm_sysmem_mappings_merge_gpu_mappings(uvm_pmm_sysmem_mappings_t *sysme
|
||||
NvU64 dma_addr,
|
||||
NvU64 new_region_size);
|
||||
|
||||
static void uvm_pmm_sysmem_mappings_merge_gpu_chunk_mappings(uvm_pmm_sysmem_mappings_t *sysmem_mappings,
|
||||
NvU64 dma_addr,
|
||||
NvU64 new_region_size)
|
||||
{
|
||||
if (uvm_pmm_sysmem_mappings_indirect_supported())
|
||||
uvm_pmm_sysmem_mappings_merge_gpu_mappings(sysmem_mappings, dma_addr, new_region_size);
|
||||
}
|
||||
|
||||
// Obtain the {va_block, virt_addr} information for the mappings in the given
|
||||
// [dma_addr:dma_addr + region_size) range. dma_addr and region_size must be
|
||||
// page-aligned.
|
||||
|
||||
Reference in New Issue
Block a user