Move getNumHandles method to GraphicsAllocation class

Change-Id: Id03e93d1f2558b0c2b740e199e335c8e6f00842a
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-03-26 14:40:43 +01:00
parent 6cf2a8a53b
commit 31e6005fa3
3 changed files with 6 additions and 1 deletions

View File

@ -189,6 +189,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
void setGmm(Gmm *gmm, uint32_t handleId) {
gmms[handleId] = gmm;
}
uint32_t getNumHandles() const { return storageInfo.getNumHandles(); }
OsHandleStorage fragmentsStorage;
StorageInfo storageInfo = {};

View File

@ -54,7 +54,6 @@ class WddmAllocation : public GraphicsAllocation {
void setDefaultHandle(D3DKMT_HANDLE handle) {
handles[0] = handle;
}
uint32_t getNumHandles() const { return storageInfo.getNumHandles(); }
void setTrimCandidateListPosition(uint32_t osContextId, size_t position) {
trimCandidateListPositions[osContextId] = position;

View File

@ -133,3 +133,8 @@ TEST(GraphicsAllocationTest, whenAllocationTypeIsTimestampPacketThenCpuAccessIsR
TEST(GraphicsAllocationTest, whenAllocationTypeIsCommandBufferThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::COMMAND_BUFFER));
}
TEST(GraphicsAllocationTest, givenDefaultAllocationWhenGettingNumHandlesThenOneIsReturned) {
MockGraphicsAllocation graphicsAllocation;
EXPECT_EQ(1u, graphicsAllocation.getNumHandles());
}