mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move getNumHandles method to GraphicsAllocation class
Change-Id: Id03e93d1f2558b0c2b740e199e335c8e6f00842a Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
@ -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 = {};
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user