Extract distinct steps as dedicated functions, especially when the code
is duplicated. This eases analysis of the logic and highlights
differences between callers of a common code.
Related-To: NEO-7788
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
Related-To: LOCI-3871
- Relaxed the Virtual Memory Reservation to allow pStart and not fail if
the pStart value is not obtained.
- Moves checks on pStart to the user to check and determine if they want
to re-reserve or use the address allocated.
- Changed reserveGpuAddress to use unit64_t type to allow internal
address range structure assignment without cast.
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
Related-To: LOCI-3871
- Enabled allocation of specified base address in the targeted heap.
- Enabled virtual memory reservations to grow by allocating at the start
of the heap vs the end of the heap.
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
When one process had exported and then opened IPC handle
of memory, then close function was called twice for the
same BO handle. It caused debugBreak() and aborted
an application.
This change allows multiple separate BOs to share one
handle. The last shared handle owner calls close() function.
Related-To: NEO-7200
Signed-off-by: Wrobel, Patryk <patryk.wrobel@intel.com>
This to follow specification, which says:
zeMemOpenIpcHandle:
- Multiple calls to this function with the same IPC handle will return
unique pointers.
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
- Enable support for L0 Virtual Memory reservation on Linux and Windows.
- Excludes support for Linux to allow pStart option
Related-To: LOCI-3397, LOCI-1543
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This change replaces unneeded copying of std::vectors
with usage of const references. Furthermore, it adds
reserve() call before filling the container via push_back().
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This extension allows pairing two buffer objects so they can be
exported using a single dma-buf handle. When imported, a single
buffer object is created with a total size of the two buffer
objects.
Related-To: LOCI-3355
Sync to
https://github.com/intel-gpu/drm-uapi-helper/releases/tag/v2.0-rc15
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
Discarding RAII lock returned from function almost always
is a bug. This change introduces usage of [[no_discard]]
attribute from C++17 to prevent such misues.
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
When using implicit scaling, device allocations may have
more than one internal allocation created internally. In that case,
a separate dma-buf handle per internal allocation needs to be
exported.
So introduced two driver experimental extensions to export and
import more than one IPC handle:
- zexMemGetIpcHandles
- zexMemOpenIpcHandles
Related-To: LOCI-2919
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This feature is disabled by default, controlled with the knob
AppendMemoryPrefetchForKmdMigratedSharedAllocations
Related-To: NEO-6740
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
Group small allocations and reuse mapped memory in order to keep map
count small.
Related-To: NEO-6417
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
Related-To: LOCI-2502
This to be able to differentiate when a B0 comes from a shareable handle
and we need to know which device owns it. This is needed when inside
the same process we have more than one active P2P transaction.
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
Move out neoDevice dependent pieces of memory manager code into
separate methods. Those methods could be used for recreating a neoDevice
after a device reset is performed.
Related-To: LOCI-2615
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>