mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Add IPC events support
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3f068eeca2
commit
5e29dccddc
@@ -45,7 +45,7 @@ class D3DBuffer : public D3DSharing<D3D> {
|
||||
GraphicsAllocation::AllocationType::SHARED_BUFFER,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true);
|
||||
auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), properties, true, false);
|
||||
|
||||
auto d3dBufferObj = new D3DBuffer<D3D>(context, d3dBuffer, bufferStaging, sharedResource);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(toOsHandle(surfaceInfo->shared_handle), allocProperties,
|
||||
false);
|
||||
false, false);
|
||||
updateImgInfoAndDesc(alloc->getDefaultGmm(), imgInfo, imagePlane, 0u);
|
||||
} else {
|
||||
lockable = !(surfaceDesc.Usage & D3DResourceFlags::USAGE_RENDERTARGET) || imagePlane != ImagePlane::NO_PLANE;
|
||||
|
||||
@@ -90,7 +90,7 @@ Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false);
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false, false);
|
||||
} else {
|
||||
err.set(CL_INVALID_D3D11_RESOURCE_KHR);
|
||||
return nullptr;
|
||||
@@ -181,7 +181,7 @@ Image *D3DTexture<D3D>::create3d(Context *context, D3DTexture3d *d3dTexture, cl_
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(rootDeviceIndex));
|
||||
if (memoryManager->verifyHandle(toOsHandle(sharedHandle), rootDeviceIndex, false)) {
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false);
|
||||
alloc = memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(sharedHandle), allocProperties, false, false);
|
||||
} else {
|
||||
err.set(CL_INVALID_D3D11_RESOURCE_KHR);
|
||||
return nullptr;
|
||||
|
||||
@@ -151,7 +151,7 @@ GraphicsAllocation *GlBuffer::createGraphicsAllocation(Context *context, unsigne
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
// couldn't find allocation for reuse - create new
|
||||
graphicsAllocation =
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(bufferInfo.globalShareHandle, properties, true);
|
||||
context->getMemoryManager()->createGraphicsAllocationFromSharedHandle(bufferInfo.globalShareHandle, properties, true, false);
|
||||
}
|
||||
|
||||
if (!graphicsAllocation) {
|
||||
|
||||
@@ -56,7 +56,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
|
||||
GraphicsAllocation::AllocationType::SHARED_IMAGE,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false);
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandle, allocProperties, false, false);
|
||||
|
||||
if (alloc == nullptr) {
|
||||
errorCode.set(CL_INVALID_GL_OBJECT);
|
||||
@@ -125,7 +125,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(context->getDevice(0)->getRootDeviceIndex()));
|
||||
mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandleMCS, allocProperties, false);
|
||||
mcsAlloc = memoryManager->createGraphicsAllocationFromSharedHandle(texInfo.globalShareHandleMCS, allocProperties, false, false);
|
||||
if (texInfo.pGmmResInfoMCS) {
|
||||
DEBUG_BREAK_IF(mcsAlloc->getDefaultGmm() != nullptr);
|
||||
mcsAlloc->setDefaultGmm(new Gmm(clientContext, texInfo.pGmmResInfoMCS));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -46,7 +46,7 @@ GraphicsAllocation *UnifiedSharing::createGraphicsAllocation(Context *context, U
|
||||
allocationType,
|
||||
false, // isMultiStorageAllocation
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex())};
|
||||
return memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(description.handle), properties, false);
|
||||
return memoryManager->createGraphicsAllocationFromSharedHandle(toOsHandle(description.handle), properties, false, false);
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
|
||||
@@ -116,7 +116,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
|
||||
imgInfo, GraphicsAllocation::AllocationType::SHARED_IMAGE,
|
||||
context->getDeviceBitfieldForAllocation(context->getDevice(0)->getRootDeviceIndex()));
|
||||
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false);
|
||||
auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, properties, false, false);
|
||||
|
||||
memoryManager->closeSharedHandle(alloc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user