Commit Graph

90 Commits

Author SHA1 Message Date
Jaime Arteaga b98b51b0d9 Move ptr.h to core folder
Change-Id: Icf0db7c767b2b1ea44fccc02b135f0f6c1f78c8f
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2019-05-29 00:11:34 -07:00
Mrozek, Michal 4f0c58003c Remove redundant code.
Change-Id: Ia037d05484d3ee70e5f915346884fde9eb7df180
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
2019-05-06 15:13:29 +02:00
Venevtsev, Igor 188c0797b6 Revert "[2/n] Use GfxPartition for 32-bit allocations - DrmMemoryManager"
This reverts commit 1ce2f9564a.

Related-To: NEO-2877

Change-Id: Id17e0bce560ed1d934412067f9e41d39c529018f
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-04-25 10:34:32 +02:00
Venevtsev, Igor 1ce2f9564a [2/n] Use GfxPartition for 32-bit allocations - DrmMemoryManager
Related-To: NEO-2877

Change-Id: Ic57d1e2cfb2629f50c6fd16e71861e8ee47f2b10
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-04-23 14:05:17 +02:00
Venevtsev, Igor 2ca97d3881 Introduce MemoryManager::getExternalHeapBaseAddress()
Related-To: NEO-2877

Change-Id: I4307224c3be9609f7fc60d7fcb4f91ccdc8a9883
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-04-16 13:30:10 +02:00
Mateusz Hoppe b13bd16665 Add support for tiling mode selection to VA sharing
Change-Id: I459c472a4b8d74dba70df54c9da29865672114eb
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2019-04-03 10:06:42 +02:00
Mateusz Hoppe 5c0c1f77f9 Pass AllocationProperties to createGraphicsAllocationFromSharedHandle()
- only extends interface to MemoryManager

Change-Id: I585d91be95abd50e11eedb53e2acfa3f66491d44
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2019-04-02 08:55:38 +02:00
Maciej Plewka 9e52684f5b Change namespace from OCLRT to NEO
Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2019-03-26 15:48:19 +01:00
Jobczyk, Lukasz e42e952d21 Reverse logic of creating Memory Manager - part 5
-Remove a Drm* parameter from the DrmMemoryManager constructor

Change-Id: Idb6faccdbb512691a8b14f86cdd935d1a8374a23
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-03-26 10:47:03 +01:00
Jobczyk, Lukasz 9ecb3193af Reverse logic of creating Memory Manager - part 3
-Move a Device::getEnabled64kbPages method's logic
 to the Memory Manager constructor

Change-Id: Ide88898000e5817a79f9a6ad5dfc9d680bec0533
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-03-25 14:42:16 +01:00
Mateusz Jablonski ee9eb8df83 Release all Gmms
Change-Id: I2227b6a1014fea59053893c9d6330f1c386bbcd2
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-03-22 12:19:44 +01:00
Zbigniew Zdanowicz cdb52400c4 Add new functions reserving address range to Memory Manager
Change-Id: I947203c24495c9e5a206b95bb0c69440824586b6
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2019-03-14 15:06:11 +01:00
Dongwon Kim 8cc90014a6 realAllocationSize for keeping actual GPU allocation Size
Change-Id: I3e00a556f25d3c147335420d887d7dcee737dbac
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
2019-03-14 09:51:40 +01:00
Mateusz Jablonski 395e79fee8 Add support for many GMMs in Graphics Allocation
Change-Id: I955b8dd50b502f91700c5529d0a0a291632aa157
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-03-13 15:44:45 +01:00
Mateusz Hoppe 573d2e0eec Add enableLocalMemory param to DrmMemoryManager ctor
- add linux dll tests for createMemoryManager()

Change-Id: I6e111e7a480d895a8520507af6b6a699f9dca160
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2019-03-12 22:22:37 +01:00
Piotr Fusik ec72787b98 Remove MemoryManager::allocateGraphicsMemoryForHostPtr.
Change-Id: I629f2299a183fc135135dbaff89216b966554a95
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
2019-03-12 15:51:32 +01:00
Venevtsev, Igor 74f1896c03 Expose GfxPartition to shared MemoryManager
Change-Id: I039e463f90e88c0ed8e9505cc770c373420ff567
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-03-12 09:25:50 +01:00
Maciej Dziuban 79d0878e64 Wait for resource not being used in freeGraphicsMemory
Change-Id: I201d914569fc0cf6f9eb616d456a670b0b8741ab
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
2019-03-11 12:18:38 +01:00
Piotr Fusik 8e49c8f67a Improve readability of getMaxApplicationAddress.
Change-Id: I92bba124746b4d16bf4cdae294e24c4667e03aef
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
2019-03-08 13:30:22 +01:00
Dunajski, Bartosz 86dabbf6d5 Improve OsContext construction
Change-Id: Ibf9293344cc5c0ae1b2cc011e87d9e3626f3a066
2019-03-01 08:35:38 +01:00
Piotr Fusik 426a7b6efe Pass by const reference.
Change-Id: I68dc9d2a77da8cc7f81759c4e72d32e2e7f71a1d
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
2019-02-28 14:12:13 +01:00
Mateusz Jablonski 6fb28dd828 Refactor GraphicsAllocation class
move most of members to protected section
merge related members into structs

Change-Id: Ief2e092aa5e61ca6f13308f9d9b1937ea6c913b4
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-02-28 14:09:11 +01:00
Hazubski e75e5808cc Manifest update
Change-Id: I8124a5b82a663953137dd4e71f8504b9becec92a
Signed-off-by: Hazubski <filip.hazubski@intel.com>
2019-02-28 14:02:33 +01:00
Piotr Fusik 8febabfbd6 DrmAllocation constructor accepts allocationType.
Change-Id: I6a6457948ada7eb59537d17b966278d114f802c6
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
2019-02-27 16:58:22 +01:00
Filip Hazubski 8b57d28116 clang-format: enable sorting includes
Include files are now grouped and sorted in following order:
1. Header file of the class the current file implements
2. Project files
3. Third party files
4. Standard library

Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2019-02-27 11:50:07 +01:00
Piotr Fusik 378bd28bab Change the signature of MemoryManager::createGraphicsAllocation.
Change-Id: Ia82235ff2831fd5b3436d488a5946bb49d63ce91
2019-02-25 16:08:35 +01:00
dongwonk b44d434a89 limited GPU range is used for external 32bit allocation
Change-Id: I494ad97fb1ddfa7b3c6b2e7cef2ae04fba571ba0
Signed-off-by: dongwonk <dongwon.kim@intel.com>
2019-02-21 16:26:49 -08:00
dongwonk 56972935ad graphic memory allocation with alignment in limited Range heap
Change-Id: Iccfb0fdc2f161e30bfdd26154110185277f176f5
Signed-off-by: dongwonk <dongwon.kim@intel.com>
2019-02-21 10:10:47 -08:00
Piotr Fusik 4ec5be0c99 Simplify code by removing AllocationOrigin.
Change-Id: Ie73cefc1ae1ee846fb9a5ef1054af01cd1867a4d
2019-02-21 16:29:05 +01:00
Mrozek, Michal a1d4c07f45 Simplify DRM allocation constructors.
Change-Id: I2c477ce85f4748f0637451a405f7949aa829ba81
2019-02-21 12:06:01 +01:00
Mrozek, Michal 45a0ceecfb Clean drm interfaces.
- all driver allocations are using SoftPin
- remove unneeded methods.
- remove unneeded members.
- remove unneeded code paths.

Change-Id: I3369c0a4d37727210b5a26271d25537ca5218bd4
2019-02-20 16:11:19 +01:00
Piotr Fusik 75edea81bb Virtual address space partitioning on Linux [2/n]
Move selectHeap from Wddm to MemoryManager.
Set DrmAllocation::origin.

Change-Id: I5d412e35d524d1f31174893b9ce1d3b1e98eee96
2019-02-20 14:43:08 +01:00
dongwonk fb993d6107 limited range and internal 32bit allocators with correct base and size
correct add 1 to the current size, gpuRange as gpuRange
only specifies the end address of the pool, not the actual
size, which causes alignment issue of all the offsets of
allocated objects. Also, a page was added in the beginning
of the limited range memory pool to avoid the base address
of it to be 0x0 that is interpreted as invalid address by
heap allocator (This makes the size reduced by pageSize)

Internal 32bit allocator is also initialized in proper way
with corrected base address.

v2: added 'givenMemoryManagerLimimedRangeAllocator' unit
    test
v3: adjust size to be freed when DrmMemoryManager instance
    is destroyed to 4GB
v4: - defined external 32bit allocator for limited Range
    allocation case.
    - softpinning object on the correct GPU address

Change-Id: Idaa0206d4133a1476cceb5a48ff8c8528742c76a
Signed-off-by: dongwonk <dongwon.kim@intel.com>
2019-02-17 19:19:52 +01:00
dongwonk c2f5fccfd0 DrmAllocation with correct pair of cpu address and gpu address
correct mapping of cpu and gpu address in memory allocation
in case of NonSVM. Also, used only aligned address since offset
is already calculated and written to "allocationOffset".
gpuBaseAddress is programmed with 0 instead of base address of
heap because it represents GPU's address space.

v2: add allocationOffset to the aligned address in allocation
    data to point to exact starting address of buffer in two
    NonSVM allocation unit tests

Change-Id: I32ef512de64a13459b7c132672f837c5cb210ada
Signed-off-by: dongwonk <dongwon.kim@intel.com>
2019-02-15 19:03:26 +01:00
Dunajski, Bartosz 12da1b0616 Remove osContextCount parameter from GraphicsAllocation
Change-Id: I23b650e97f107008b1122a1ecea48722fe129863
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2019-02-11 15:44:37 +01:00
Mateusz Jablonski f157943610 Allocate internal allocations through preferred pool
Change-Id: Ib17431ceefc1eb72f86625e0998f679baaa7cb0d
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-01-30 11:18:15 +01:00
Hoppe, Mateusz d7ce6ef8d1 Allocate images through preferred pool call
Change-Id: I79c9c1a0a95a8a3e26ed690530b71ef504cc7ff8
2019-01-25 09:05:25 +01:00
Mateusz Jablonski f332bf369e Set allocation's lock state only in lockResource and unlockResource methods
Change-Id: I60f35801287166f5bdb0dfcd31ff0118c56ec22a
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-01-24 15:15:27 +01:00
Piotr Fusik 30dd15144c Add debug variable to disable host ptr tracking.
Change-Id: Ifc866e06a4519e7590d40d8ad136147ecc80225d
2019-01-11 12:06:52 +01:00
Mateusz Jablonski aee69779fa Minor renaming in a scope of multi os context allocations:
shareable -> multiOsContextCapable
resetTaskCount -> releaseUsageInOsContext
resetResidencyTaskCount -> releaseResidencyInOsContext
isUsedByContext -> isUsedByOsContext

Change-Id: If824246a0e393b962bd12f8c63d429a0fcfcda25
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-01-07 11:42:43 +01:00
Kai Chen 1251ccc3c6 Allocate CPU address for Linux internal 32bit allocator base
The internal 32bit allocator sometimes need CPU address to access
or store data when it is in reduced address space scenario.

Change-Id: I6c0b3f9703ae3e124249b41ad7d81f03ad93ad17
Signed-off-by: Kai Chen <kai.chen@intel.com>
2018-12-21 07:11:48 +01:00
Mateusz Jablonski 1e011f9a08 Allow to allocate shareable graphics allocation
Change-Id: I284b03b001e5b67c344d46f34048803ef9a57314
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-20 20:14:57 +01:00
Hoppe, Mateusz f6790c42cf Refactor Graphics Allocation paths for Images
Change-Id: Ifa3084b18cac95289bbceeaf3669dd31567fbd3e
2018-12-19 13:49:53 +01:00
Mateusz Jablonski 8ec072d39c Simplify Memory Manager API [3/4]
- remove method allocateGraphicsMemory(size_t size)
- pass allocation type in allocation properties
- set allocation type in allocateGraphicsMemoryInPreferredPool

Change-Id: Ia9296d0ab2f711b7d78aff615cb56b3a246b60ec
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-17 10:42:16 +01:00
Dunajski, Bartosz cfafe943eb Use different DRM Context for each OsContext on Linux
Change-Id: I543df4accdeba6c69b7dcf86d4238d12dafe92fe
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2018-12-12 15:08:23 +01:00
Mateusz Jablonski a6be6533ea Simplify Memory Manager API [2/n]
- make AllocationData a protected structure
- use AllocationProperties instead of AllocationFlags
- refactor methods: allocateGraphicsMemory64kb, allocateGraphicsMemoryForSVM
- call AllocateGraphicsMemoryInPreferredPool in AllocateGraphicsMemory
  where there is no host ptr

Change-Id: Ie9ca47b1bccacd00f8486e7d1bf6fb3985e5cb12
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-11 13:12:00 +01:00
Mateusz Jablonski c8748b77a0 Simplify memory manager API [1/n]
pass struct with properties to allocate graphics memory methods:
for protected methods use AllocationData
for public methods use AllocationProperties

Change-Id: Ie1c3cb6b5e330bc4adac2ca8b0bf02d30ec76065
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-06 15:09:25 +01:00
Mateusz Jablonski 352450adaa Pass number of os contexts to Graphics Allocation constructor
Mark unshareable allocations

Change-Id: Ie745dc639d8c6b01e2275d29ee1fb4c6343df2bc
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-11-21 17:38:02 +01:00
Kai Chen 85b60dff0f Linux GPU address allocator for devices with reduced address space
Code implementation of GPU address allocator for devices with reduced
address space.

Change-Id: Ieb0412c5930fdd71f90741055cf89c0338b01133
Signed-off-by: Kai Chen <kai.chen@intel.com>
2018-11-19 10:20:25 +01:00
Mateusz Jablonski 129380c1a6 Cleanup host ptr manager
Change-Id: I0fc9df41a08255eef8072666c1c5c16806e0f7cf
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-10-26 08:26:38 +02:00