Make Timestamp allocations OneTimeAubWritable

Change-Id: I22e973714e4df1b3a07d8fb45cdab37b28a6433e
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2018-11-14 15:26:23 +01:00 committed by sys_ocldev
parent 08424d798f
commit bd4ea652ec
6 changed files with 12 additions and 4 deletions

View File

@ -19,6 +19,7 @@ class AubHelper : public NonCopyableOrMovableClass {
case GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY:
case GraphicsAllocation::AllocationType::BUFFER_COMPRESSED:
case GraphicsAllocation::AllocationType::IMAGE:
case GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER:
return true;
default:
return false;

View File

@ -60,7 +60,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
LINEAR_STREAM,
FILL_PATTERN,
PIPE,
EVENT_TAG_BUFFER,
TIMESTAMP_TAG_BUFFER,
COMMAND_BUFFER,
PRINTF_SURFACE,
GLOBAL_SURFACE,

View File

@ -126,6 +126,7 @@ class TagAllocator {
size_t allocationSizeRequired = tagCount * tagSize;
GraphicsAllocation *graphicsAllocation = memoryManager->allocateGraphicsMemory(allocationSizeRequired);
graphicsAllocation->setAllocationType(GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER);
gfxAllocations.push_back(graphicsAllocation);
uintptr_t Size = graphicsAllocation->getUnderlyingBufferSize();

View File

@ -601,7 +601,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe
GraphicsAllocation::AllocationType::BUFFER,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
GraphicsAllocation::AllocationType::BUFFER_COMPRESSED,
GraphicsAllocation::AllocationType::IMAGE};
GraphicsAllocation::AllocationType::IMAGE,
GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER};
for (size_t i = 0; i < arrayCount(onlyOneTimeAubWritableTypes); i++) {
gfxAllocation->setAubWritable(true);

View File

@ -158,7 +158,7 @@ INSTANTIATE_TEST_CASE_P(Allow32BitAnd64kbPagesTypes,
static const GraphicsAllocation::AllocationType allocationTypesWith32BitAnd64KbPagesNotAllowed[] = {GraphicsAllocation::AllocationType::COMMAND_BUFFER,
GraphicsAllocation::AllocationType::DYNAMIC_STATE_HEAP,
GraphicsAllocation::AllocationType::EVENT_TAG_BUFFER,
GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER,
GraphicsAllocation::AllocationType::IMAGE,
GraphicsAllocation::AllocationType::INSTRUCTION_HEAP,
GraphicsAllocation::AllocationType::SHARED_RESOURCE};

View File

@ -335,3 +335,8 @@ TEST_F(TagAllocatorTest, givenTagsOnDeferredListWhenReleasingItThenMoveReadyTags
EXPECT_TRUE(tagAllocator.deferredTags.peekIsEmpty());
EXPECT_FALSE(tagAllocator.getFreeTags().peekIsEmpty());
}
TEST_F(TagAllocatorTest, givenTagAllocatorWhenGraphicsAllocationIsCreatedThenSetTimestampTagBufferAllocationType) {
MockTagAllocator mockAllocator(memoryManager, 1, 1);
EXPECT_EQ(GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER, mockAllocator.getGraphicsAllocation()->getAllocationType());
}