Commit Graph

48 Commits

Author SHA1 Message Date
Venevtsev, Igor 4403796f58 Use GfxPartition for GPU address range allocations
[4/n] - Remove allocator32Bit

Related-To: NEO-2877

Change-Id: I0772a7fe1fda19daa12699c546587bd3cdd84f2c
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
2019-07-08 12:09:07 +02:00
Igor Venevtsev 10799ea0ed Use GfxPartition for GPU address range allocations
[3/n] - DrmMemoryManager

Related-To: NEO-2877

Change-Id: If7aa5f7e0d774f0c8b1c01cf6b14ee22374987d3
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2019-07-04 12:14:00 +02:00
Mrozek, Michal 5244030e31 Call ioctl to obtain file handle from prime bo
Related-To: NEO-3252

Change-Id: I8d976ae29875db83dd75802e0309cb4438d1332b
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
2019-06-10 09:06:59 +02: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 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
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
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
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 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
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
Mateusz Hoppe d5d177dd58 Override AllocateGraphicsMemoryInDevicePool in DrmMemoryManager
Change-Id: I54da682ecb055e71af0968872ddb0ec7726c3adc
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2019-02-27 10:05:46 +01:00
Piotr Fusik 378bd28bab Change the signature of MemoryManager::createGraphicsAllocation.
Change-Id: Ia82235ff2831fd5b3436d488a5946bb49d63ce91
2019-02-25 16:08:35 +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
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
Mateusz Jablonski c9e667d601 Simplify Memory Manager API [4/4]
- fill AllocationData in one place
- remove allocateGraphicsMemoryForSVM function
- refactor SVM manager tests

Change-Id: I6f4ecd70503da8031cced50ea98a54162fd8e5d3
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-20 09:01:33 +01:00
Hoppe, Mateusz f6790c42cf Refactor Graphics Allocation paths for Images
Change-Id: Ifa3084b18cac95289bbceeaf3669dd31567fbd3e
2018-12-19 13:49:53 +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
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 b602cd2bb8 Pass execution environment to memory manager
Change-Id: If43cf9d1353b4cbc02ea269fb9105c01cc4e0876
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-10-03 22:12:26 +02:00
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00
Pawel Wilma 4a12deea2b Add support for reduced GPU address space
Change-Id: I9ebbc8c51039bb533b44c6b80e717e1489a20a43
Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
2018-09-03 13:51:36 +02:00
Venevtsev, Igor f6743ced2a Remove reuseBO from createGraphicsAllocationFromSharedHandle
Change-Id: Ia7af1cdd8e3986b8af7c542032d2767303865382
2018-09-03 13:38:19 +02:00
Hoppe, Mateusz e1eaf3ded0 Fix bug in VA sharing multithreaded scenario
- createGraphicsAllocationFromSharedHandle was not threadsafe,
instead of reusing BufferObject for a single handle when
multiple threads were creating memory objects from a single VASurface,
new BO could be created and placed in container with BOs for reuse.
This was leading to errors in ioctl calls.

- add lock for following set of operations:
 1. find BufferObject with a given handle in container
 2. create shared BO when not found
 3. add shared BO to container
 prevents creating multiple BOs for a single handle

- replace recursive mutex with regular mutex as mutex shouldn't
be locked recursively

Change-Id: I0937e2abf3bf1c672c6d77422d46e441f7216a68
2018-08-02 12:55:05 +02:00
Dunajski, Bartosz 512978768e Pass renderCompressed information to GMM for 64kb allocations
Change-Id: I56302055c028e919bceeb3333557cab7451e1d09
2018-07-23 11:28:43 +02:00
Hoppe, Mateusz 55a045ebe1 Refactor graphics memory allocation scheme
- replace createGraphicsAllocationWithRequiredBitness with more general
methodallocateGraphicsMemoryInPreferredPool based on passed
 AllocationData
- proper flags for allocation selected based on AllocationType

- remove allocateGraphicsMemory(size_t size, size_t alignment)
and use allocateGraphicsMemory(size_t size) instead where default
alignment is sufficient, otherwise use full options version:
allocateGraphicsMemory(size_t size, size_t alignment,
 bool forcePin, bool uncacheable)

Change-Id: I2da891f372ee181253cb840568a61b33c0d71fc9
2018-07-11 15:48:05 +02:00
Koska, Andrzej fe56c57318 Tracking the internal allocation when creating a buffer
This fix prevents the creation of a buffer from the pointer
obtained from clEnqueueMapBuffer

Change-Id: I203f2d5263eeb02fe0d73bc9db159438af3cf1fc
2018-06-08 07:33:07 +02:00
Mrozek, Michal d2817427af Remove createInternalGraphicsAllocation function.
- Route directly to allocate32BitGraphicsMemory

Change-Id: Ia6872bae655c530ff06b0ec270f419ca91d005ce
2018-05-21 04:11:43 +02:00
Hoppe, Mateusz baa7640c90 Rename MemoryType enum to AllocationOrigin
- better describes the meaning of INTERNAL and
EXTERNAL allocation types

Change-Id: Iacb97f5a9d63f45b60bc404cc6dd32c7ebd72ab3
2018-05-14 12:38:52 +02:00
Mrozek, Michal cec056f3c4 Turn ON DrmGemCloseWorker.
- For every command buffer that we submit, pass it to gem close worker.
- Gem close worker will do asynchronous cleanup if this resource is meant to
be destroyed.
- if the resource is not meant to be destroyed we will call IOCTL wait for
this batch buffer.
- This will result in bumping up GPU clocks and better performance.

Change-Id: If9f181e411d7748573f31682e875a97c5355abe5
2018-05-11 10:54:09 +02:00
Mrozek, Michal 06287af541 DrmGemCloseWorker - remove not used modes of operation.
Change-Id: Ie8524a8411f1022785536a523aad3e4ebea3a349
2018-05-10 15:34:20 +02:00
Hoppe, Mateusz a1a20a3b34 Service read only memory passed as host_ptr
- read only memory cannot be used for allocation,
Oses cannot create graphics alocation for such memory
- if memory allocation fails for host_ptr passed
to enqueueWrite calls, then try doing new allocation
and copy host_ptr on cpu

Change-Id: I415a4673ae1319ea8f77e53bd8fba7489fe85218
2018-03-14 13:16:36 +01:00
Mrozek, Michal 2119d5db08 [13/n] Internal 4GB allocator.
- Add common function for all memory managers to obtain internal heap base.

Change-Id: Iacdaaf598e8786dad046b3f4550f9c80ce3f15d9
2018-03-12 16:19:24 +01:00
Slawomir Milczarek f217c9198c Add support for resource lock / unlock on Linux OS
This commit fixes the issue with image contents writes
in the configuration of CSR HW with AUB dump.

Change-Id: Id0c4f36d4f9eee5175267384d42cb75bf41062f3
2018-03-01 15:01:49 +01:00
Mrozek, Michal 0b8234117b Add support for createInternalGraphicsAllocation in DRM
Change-Id: I84090dfc4774506dee993e9c0c78c336367c43fd
2018-03-01 11:30:38 +01:00
Mrozek, Michal 0e3f2bf361 [4/n] Internal 4GB allocator
-Allocate internal 4GB allocator when DRM memory manager is created.

Change-Id: I072e81de219415a6c02ab1fd1b41b6a8338ee67c
2018-02-28 12:52:31 +01:00
Mrozek, Michal 19c68a608f [1/n] Internal 4GB allocator
- Add new entry point in memory manager for internal allocations.
- Route to allocate32BitGraphicsMemory
- Add new enum to control memory region
- Change mm to memoryManager

Change-Id: I2ee069aa9baf7f69f652022e026569ec4fdb9d77
2018-02-27 16:35:12 +01:00
Zdanowicz, Zbigniew 21f92d8258 Add preemption WA to make CSR surface uncacheable
Change-Id: Ia468c6f5df16522c3bc9aae22802895f2badc431
2018-01-05 22:44:26 +01:00
Brandon Fliflet 7e9ad41290 Initial commit
Change-Id: I4bf1707bd3dfeadf2c17b0a7daff372b1925ebbd
2017-12-21 00:45:38 +01:00