Remove alignedSize from WddmAllocation.

Change-Id: I3b610515e4d5db16ce6a604e7e2f4b85b657bef2
This commit is contained in:
Mrozek, Michal
2018-10-30 13:14:07 +01:00
committed by sys_ocldev
parent 4a8f4aa47b
commit 5b2e16651f
6 changed files with 26 additions and 28 deletions

View File

@@ -7,6 +7,7 @@
#pragma once
#define UMDF_USING_NTSTATUS
#include "runtime/helpers/aligned_memory.h"
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/os_interface/windows/windows_wrapper.h"
#include <d3dkmthk.h>
@@ -30,12 +31,11 @@ class WddmAllocation : public GraphicsAllocation {
D3DKMT_HANDLE resourceHandle = 0u; // used by shared resources
D3DGPU_VIRTUAL_ADDRESS gpuPtr; // set by mapGpuVA
WddmAllocation(void *cpuPtrIn, size_t sizeIn, void *alignedCpuPtr, size_t alignedSize, void *reservedAddr, MemoryPool::Type pool, size_t osContextsCount)
WddmAllocation(void *cpuPtrIn, size_t sizeIn, void *alignedCpuPtr, void *reservedAddr, MemoryPool::Type pool, size_t osContextsCount)
: GraphicsAllocation(cpuPtrIn, sizeIn),
handle(0),
gpuPtr(0),
alignedCpuPtr(alignedCpuPtr),
alignedSize(alignedSize),
trimCandidateListPositions(osContextsCount, trimListUnusedPosition) {
reservedAddressSpace = reservedAddr;
this->memoryPool = pool;
@@ -46,14 +46,13 @@ class WddmAllocation : public GraphicsAllocation {
handle(0),
gpuPtr(0),
alignedCpuPtr(nullptr),
alignedSize(sizeIn),
trimCandidateListPositions(osContextsCount, trimListUnusedPosition) {
reservedAddressSpace = nullptr;
this->memoryPool = pool;
}
WddmAllocation(void *alignedCpuPtr, size_t sizeIn, void *reservedAddress, MemoryPool::Type pool, size_t osContextsCount)
: WddmAllocation(alignedCpuPtr, sizeIn, alignedCpuPtr, sizeIn, reservedAddress, pool, osContextsCount) {
: WddmAllocation(alignedCpuPtr, sizeIn, alignedCpuPtr, reservedAddress, pool, osContextsCount) {
}
void *getAlignedCpuPtr() const {
@@ -61,7 +60,7 @@ class WddmAllocation : public GraphicsAllocation {
}
size_t getAlignedSize() const {
return this->alignedSize;
return alignSizeWholePage(this->cpuPtr, this->size);
}
ResidencyData &getResidencyData() {
@@ -90,7 +89,6 @@ class WddmAllocation : public GraphicsAllocation {
protected:
void *alignedCpuPtr;
size_t alignedSize;
ResidencyData residency;
std::vector<size_t> trimCandidateListPositions;
void *reservedAddressSpace;