Create map for deviceBitfields per rootDeviceIndex

Pass rootDeviceIndex to getDeviceBitfieldForAllocation

Related-To: NEO-4589
Change-Id: Ib325a8bf822351ba36b225d94d4173fd725e8766
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-09-28 13:11:58 +02:00
committed by sys_ocldev
parent e28f937683
commit 214342f405
24 changed files with 104 additions and 48 deletions

View File

@@ -44,7 +44,7 @@ class D3DBuffer : public D3DSharing<D3D> {
0, // size
GraphicsAllocation::AllocationType::SHARED_BUFFER,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation()};
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true);
auto d3dBufferObj = new D3DBuffer<D3D>(context, d3dBuffer, bufferStaging, sharedResource);

View File

@@ -86,7 +86,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo
0u, // size
GraphicsAllocation::AllocationType::SHARED_IMAGE,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(surfaceInfo->shared_handle), allocProperties,
false);
updateImgInfoAndDesc(alloc->getDefaultGmm(), imgInfo, imagePlane, 0u);
@@ -104,7 +104,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo,
true, // allocateMemory
memoryProperties, context->getDevice(0)->getHardwareInfo(),
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
allocProperties.allocationType = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY;
alloc = context->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);

View File

@@ -82,7 +82,7 @@ Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_
0u, // size
GraphicsAllocation::AllocationType::SHARED_IMAGE,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false);
} else {
@@ -167,7 +167,7 @@ Image *D3DTexture<D3D>::create3d(Context *context, D3DTexture3d *d3dTexture, cl_
0u, // size
GraphicsAllocation::AllocationType::SHARED_IMAGE,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false);
} else {

View File

@@ -148,7 +148,7 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne
0u, // size
GraphicsAllocation::AllocationType::SHARED_BUFFER,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation()};
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
// couldn't find allocation for reuse - create new
graphicsAllocation =
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(bufferInfo.globalShareHandle, properties, true);

View File

@@ -55,7 +55,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
0u, // size
GraphicsAllocation::AllocationType::SHARED_IMAGE,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false);
if (alloc == nullptr) {
@@ -124,7 +124,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
GraphicsAllocation *mcsAlloc = nullptr;
if (texInfo.globalShareHandleMCS) {
AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, GraphicsAllocation::AllocationType::MCS, context->getDeviceBitfieldForAllocation());
AllocationProperties allocProperties(context->getDevice(0)->getRootDeviceIndex(), 0, GraphicsAllocation::AllocationType::MCS, context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandleMCS, allocProperties, false);
if (texInfo.pGmmResInfoMCS) {
DEBUG_BREAK_IF(mcsAlloc->getDefaultGmm() != nullptr);

View File

@@ -45,7 +45,7 @@ GraphicsAllocation *UnifiedSharing::createGraphicsAllocation(Context *context, U
0u, // size
allocationType,
false, // isMultiStorageAllocation
context->getDeviceBitfieldForAllocation()};
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
return memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(description.handle), properties, false);
}
default:

View File

@@ -109,7 +109,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
AllocationProperties properties(context->getDevice(0)->getRootDeviceIndex(),
false, // allocateMemory
imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE,
context->getDeviceBitfieldForAllocation());
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false);