|
1 | 1 | /*
|
2 |
| - * Copyright (C) 2019-2024 Intel Corporation |
| 2 | + * Copyright (C) 2019-2025 Intel Corporation |
3 | 3 | *
|
4 | 4 | * SPDX-License-Identifier: MIT
|
5 | 5 | *
|
@@ -557,14 +557,20 @@ struct GfxPartitionOn57bTest : public ::testing::Test {
|
557 | 557 |
|
558 | 558 | gfxBase = alignUp(gfxBase, maxStandardHeapGranularity);
|
559 | 559 | uint64_t maxStandardHeapSize = alignDown((gfxTop - gfxBase) / numStandardHeaps, maxStandardHeapGranularity);
|
| 560 | + uint64_t maxStandard64HeapSize = maxStandardHeapSize; |
| 561 | + |
| 562 | + if (expectHeapExtendedInitialized) { |
| 563 | + maxStandardHeapSize *= 2; |
| 564 | + maxStandard64HeapSize /= 2; |
| 565 | + } |
560 | 566 |
|
561 | 567 | EXPECT_EQ(gfxBase, gfxPartition->getHeapBase(HeapIndex::heapStandard));
|
562 | 568 | EXPECT_EQ(gfxBase + maxStandardHeapSize - 1, gfxPartition->getHeapLimit(HeapIndex::heapStandard));
|
563 | 569 |
|
564 | 570 | gfxBase += maxStandardHeapSize;
|
565 | 571 |
|
566 | 572 | EXPECT_EQ(gfxBase, gfxPartition->getHeapBase(HeapIndex::heapStandard64KB));
|
567 |
| - EXPECT_EQ(gfxBase + maxStandardHeapSize - 1, gfxPartition->getHeapLimit(HeapIndex::heapStandard64KB)); |
| 573 | + EXPECT_EQ(gfxBase + maxStandard64HeapSize - 1, gfxPartition->getHeapLimit(HeapIndex::heapStandard64KB)); |
568 | 574 |
|
569 | 575 | if (expectHeapExtendedInitialized) {
|
570 | 576 | EXPECT_TRUE(gfxPartition->heapInitialized(HeapIndex::heapExtended));
|
@@ -832,6 +838,23 @@ TEST_F(GfxPartitionOn57bTest, given57bitCpuAddressWidthAndLa57IsPresentWhenIniti
|
832 | 838 | EXPECT_FALSE(gfxPartition->init(maxNBitValue(gpuAddressSpace), 0, 0, 1, false, 0u, gfxTop));
|
833 | 839 | }
|
834 | 840 |
|
| 841 | +TEST_F(GfxPartitionOn57bTest, whenInitGfxPartitionThenDoubleHeapStandardAtTheCostOfStandard64AndStandard2MB) { |
| 842 | + if (is32bit) { |
| 843 | + GTEST_SKIP(); |
| 844 | + } |
| 845 | + |
| 846 | + auto gpuAddressSpace = 57; |
| 847 | + uint64_t gfxTop = maxNBitValue(gpuAddressSpace) + 1; |
| 848 | + OSMemory::ReservedCpuAddressRange reservedCpuAddressRange; |
| 849 | + std::vector<std::unique_ptr<MockGfxPartition>> gfxPartitions; |
| 850 | + gfxPartitions.push_back(std::make_unique<MockGfxPartition>(reservedCpuAddressRange)); |
| 851 | + gfxPartitions[0]->osMemory.reset(new MockOsMemory); |
| 852 | + EXPECT_TRUE(gfxPartitions[0]->init(maxNBitValue(gpuAddressSpace), 0, 0, 1, false, 0u, gfxTop)); |
| 853 | + |
| 854 | + EXPECT_EQ(gfxPartitions[0]->getHeapSize(HeapIndex::heapStandard), 4 * gfxPartitions[0]->getHeapSize(HeapIndex::heapStandard64KB)); |
| 855 | + EXPECT_EQ(gfxPartitions[0]->getHeapSize(HeapIndex::heapStandard), 4 * gfxPartitions[0]->getHeapSize(HeapIndex::heapStandard2MB)); |
| 856 | +} |
| 857 | + |
835 | 858 | TEST_F(GfxPartitionOn57bTest, given48bitGpuAddressSpaceAnd57bitCpuAddressWidthWhenInitializingMultipleGfxPartitionsThenReserveSpaceForSvmHeapOnlyOnce) {
|
836 | 859 | if (is32bit) {
|
837 | 860 | GTEST_SKIP();
|
|
0 commit comments