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:
Mateusz Hoppe
2019-04-01 14:04:50 +02:00
committed by sys_ocldev
parent 11a7e68c0a
commit 5c0c1f77f9
26 changed files with 107 additions and 57 deletions

View File

@ -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;

View File

@ -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;