Allocate command buffers with proper allocation type.

Change-Id: I912dd41cf68fa16ab481bb003c4f5ae63f1f04c4
This commit is contained in:
Mrozek, Michal
2019-02-20 12:43:37 +01:00
parent 65625e22bf
commit 4139e88982
10 changed files with 40 additions and 12 deletions

View File

@@ -211,7 +211,7 @@ LinearStream &CommandQueue::getCS(size_t minRequiredSize) {
minRequiredSize += CSRequirements::csOverfetchSize;
minRequiredSize = alignUp(minRequiredSize, MemoryConstants::pageSize64k);
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER;
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(minRequiredSize, allocationType).release();
if (!allocation) {

View File

@@ -130,7 +130,7 @@ LinearStream &CommandStreamReceiver::getCS(size_t minRequiredSize) {
// If not, allocate a new block. allocate full pages
minRequiredSize = alignUp(minRequiredSize, MemoryConstants::pageSize64k);
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER;
auto allocation = internalAllocationStorage->obtainReusableAllocation(minRequiredSize, allocationType).release();
if (!allocation) {
allocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({minRequiredSize, allocationType});

View File

@@ -59,7 +59,7 @@ void ExperimentalCommandBuffer::getCS(size_t minRequiredSize) {
auto requiredSize = minRequiredSize + CSRequirements::csOverfetchSize;
auto storageWithAllocations = commandStreamReceiver->getInternalAllocationStorage();
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER;
GraphicsAllocation *allocation = storageWithAllocations->obtainReusableAllocation(requiredSize, allocationType).release();
if (!allocation) {
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, allocationType});

View File

@@ -168,7 +168,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
return allocationType == AllocationType::LINEAR_STREAM ||
allocationType == AllocationType::KERNEL_ISA ||
allocationType == AllocationType::INTERNAL_HEAP ||
allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER;
allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER ||
allocationType == AllocationType::COMMAND_BUFFER;
}
protected:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -193,7 +193,8 @@ template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::kmDafLockAllocations(ResidencyContainer &allocationsForResidency) {
for (auto &graphicsAllocation : allocationsForResidency) {
if ((GraphicsAllocation::AllocationType::LINEAR_STREAM == graphicsAllocation->getAllocationType()) ||
(GraphicsAllocation::AllocationType::FILL_PATTERN == graphicsAllocation->getAllocationType())) {
(GraphicsAllocation::AllocationType::FILL_PATTERN == graphicsAllocation->getAllocationType()) ||
(GraphicsAllocation::AllocationType::COMMAND_BUFFER == graphicsAllocation->getAllocationType())) {
wddm->kmDafLock(static_cast<WddmAllocation *>(graphicsAllocation));
}
}