mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Allocate command buffers with proper allocation type.
Change-Id: I912dd41cf68fa16ab481bb003c4f5ae63f1f04c4
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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});
|
||||
|
||||
@@ -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});
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user