mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Use HEAP_STANDARD64Kb when cpu access is required
Change-Id: I3a451b618f1b72836cd640ed510e874cf2d60624 Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
aa587b3bc5
commit
ed6381a66a
@@ -112,3 +112,19 @@ TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidency
|
||||
EXPECT_TRUE(graphicsAllocation.isResident(0u));
|
||||
EXPECT_TRUE(graphicsAllocation.isResidencyTaskCountBelow(currentResidencyTaskCount + 1u, 0u));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, whenAllocationTypeIsLinearStreamThenCpuAccessIsRequired) {
|
||||
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::LINEAR_STREAM));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaThenCpuAccessIsRequired) {
|
||||
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::KERNEL_ISA));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, whenAllocationTypeIsInternalHeapThenCpuAccessIsRequired) {
|
||||
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::INTERNAL_HEAP));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, whenAllocationTypeIsTimestampPacketThenCpuAccessIsRequired) {
|
||||
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -27,6 +27,8 @@ BOOLEAN WINAPI DllMain(IN HINSTANCE hDllHandle,
|
||||
case DLL_PROCESS_ATTACH:
|
||||
gAdapterInfo.GfxPartition.Standard.Base = 0x0000800400000000;
|
||||
gAdapterInfo.GfxPartition.Standard.Limit = 0x0000eeffffffffff;
|
||||
gAdapterInfo.GfxPartition.Standard64KB.Base = 0x0000b80200000000;
|
||||
gAdapterInfo.GfxPartition.Standard64KB.Limit = 0x0000efffffffffff;
|
||||
gAdapterInfo.GfxPartition.SVM.Base = 0;
|
||||
gAdapterInfo.GfxPartition.SVM.Limit = 0x00007fffffffffff;
|
||||
gAdapterInfo.GfxPartition.Heap32[0].Base = 0x0000800000000000;
|
||||
@@ -287,6 +289,8 @@ NTSTATUS __stdcall D3DKMTQueryAdapterInfo(IN CONST D3DKMT_QUERYADAPTERINFO *quer
|
||||
|
||||
adapterInfo->GfxPartition.Standard.Base = gAdapterInfo.GfxPartition.Standard.Base;
|
||||
adapterInfo->GfxPartition.Standard.Limit = gAdapterInfo.GfxPartition.Standard.Limit;
|
||||
adapterInfo->GfxPartition.Standard64KB.Base = gAdapterInfo.GfxPartition.Standard64KB.Base;
|
||||
adapterInfo->GfxPartition.Standard64KB.Limit = gAdapterInfo.GfxPartition.Standard64KB.Limit;
|
||||
|
||||
adapterInfo->GfxPartition.SVM.Base = gAdapterInfo.GfxPartition.SVM.Base;
|
||||
adapterInfo->GfxPartition.SVM.Limit = gAdapterInfo.GfxPartition.SVM.Limit;
|
||||
|
||||
@@ -1030,9 +1030,24 @@ TEST_F(WddmHeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAl
|
||||
}
|
||||
EXPECT_EQ(HeapIndex::HEAP_SVM, wddm->selectHeap(&allocation, &allocation));
|
||||
}
|
||||
TEST_F(WddmHeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrThenStandardHeapIsUsed) {
|
||||
TEST_F(WddmHeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndCpuAccessIsRequiredThenStandard64kHeapIsUsed) {
|
||||
WddmAllocation allocation{nullptr, 0, nullptr, MemoryPool::MemoryNull, false};
|
||||
EXPECT_EQ(AllocationOrigin::EXTERNAL_ALLOCATION, allocation.origin);
|
||||
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
|
||||
allocation.setAllocationType(allocationType);
|
||||
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(allocationType));
|
||||
if (hardwareInfoTable[wddm->getGfxPlatform()->eProductFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max48BitAddress) {
|
||||
return;
|
||||
}
|
||||
EXPECT_EQ(HeapIndex::HEAP_STANDARD64Kb, wddm->selectHeap(&allocation, nullptr));
|
||||
}
|
||||
|
||||
TEST_F(WddmHeapSelectorTest, givenFullAddressSpaceWhenSelectingHeapForExternalAllocationWithoutPtrAndCpuAccessIsNotRequiredThenStandardHeapIsUsed) {
|
||||
WddmAllocation allocation{nullptr, 0, nullptr, MemoryPool::MemoryNull, false};
|
||||
EXPECT_EQ(AllocationOrigin::EXTERNAL_ALLOCATION, allocation.origin);
|
||||
auto allocationType = GraphicsAllocation::AllocationType::UNDECIDED;
|
||||
allocation.setAllocationType(allocationType);
|
||||
EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(allocationType));
|
||||
if (hardwareInfoTable[wddm->getGfxPlatform()->eProductFamily]->capabilityTable.gpuAddressSpace != MemoryConstants::max48BitAddress) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user