mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00
Pass AllocationProperties to createGraphicsAllocationFromSharedHandle()
- only extends interface to MemoryManager Change-Id: I585d91be95abd50e11eedb53e2acfa3f66491d44 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
11a7e68c0a
commit
5c0c1f77f9
@ -41,15 +41,16 @@ class D3D9Tests : public PlatformFixture, public ::testing::Test {
|
||||
class MockMM : public OsAgnosticMemoryManager {
|
||||
public:
|
||||
MockMM(const ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(const_cast<ExecutionEnvironment &>(executionEnvironment)){};
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override {
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness);
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) override {
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness);
|
||||
alloc->setDefaultGmm(forceGmm);
|
||||
gmmOwnershipPassed = true;
|
||||
return alloc;
|
||||
}
|
||||
GraphicsAllocation *allocateGraphicsMemoryForImage(const AllocationData &allocationData) override {
|
||||
auto gmm = std::make_unique<Gmm>(*allocationData.imgInfo);
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, false);
|
||||
AllocationProperties properties(allocationData.imgInfo, false, GraphicsAllocation::AllocationType::SHARED_IMAGE);
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, properties, false);
|
||||
alloc->setDefaultGmm(forceGmm);
|
||||
gmmOwnershipPassed = true;
|
||||
return alloc;
|
||||
|
@ -59,14 +59,15 @@ class D3DTests : public PlatformFixture, public ::testing::Test {
|
||||
class MockMM : public OsAgnosticMemoryManager {
|
||||
public:
|
||||
using OsAgnosticMemoryManager::OsAgnosticMemoryManager;
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override {
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness);
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) override {
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness);
|
||||
alloc->setDefaultGmm(forceGmm);
|
||||
gmmOwnershipPassed = true;
|
||||
return alloc;
|
||||
}
|
||||
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override {
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)handle), false);
|
||||
AllocationProperties properties(0, GraphicsAllocation::AllocationType::UNDECIDED);
|
||||
auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)handle), properties, false);
|
||||
alloc->setDefaultGmm(forceGmm);
|
||||
gmmOwnershipPassed = true;
|
||||
return alloc;
|
||||
|
Reference in New Issue
Block a user