UM-KM data refactor for Windows

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
Jaroslaw Chodor
2021-05-02 22:41:01 +02:00
committed by Compute-Runtime-Automation
parent dd6653892e
commit 70f8fe1c01
33 changed files with 522 additions and 113 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -75,7 +75,11 @@ class MockGmmResourceInfo : public GmmResourceInfo {
bool is64KBPageSuitable() const override { return is64KBPageSuitableValue; }
GMM_RESOURCE_INFO *peekHandle() const override { return mockResourceInfoHandle; }
GMM_RESOURCE_INFO *peekGmmResourceInfo() const override { return mockResourceInfoHandle; }
void *peekHandle() const override { return mockResourceInfoHandle; }
size_t peekHandleSize() const override { return sizeof(GMM_RESOURCE_INFO); }
GMM_RESOURCE_INFO *mockResourceInfoHandle = (GMM_RESOURCE_INFO *)this;
GMM_RESCREATE_PARAMS mockResourceCreateParams = {};
@ -90,6 +94,9 @@ class MockGmmResourceInfo : public GmmResourceInfo {
void setAuxQPitch(uint32_t value);
void setMipTailStartLod(uint32_t newMipTailStartLod) { mipTailStartLod = newMipTailStartLod; }
using GmmResourceInfo::clientContext;
using GmmResourceInfo::createResourceInfo;
uint32_t getOffsetCalled = 0u;
uint32_t arrayIndexPassedToGetOffset = 0;
SurfaceFormatInfo tempSurface{};

View File

@ -26,7 +26,7 @@ struct mockHwDeviceId : public HwDeviceId {
using HwDeviceId::osEnvironment;
};
WddmMock::WddmMock(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::make_unique<HwDeviceId>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get()), rootDeviceEnvironment) {
WddmMock::WddmMock(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::make_unique<HwDeviceId>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get(), std::make_unique<UmKmDataTranslator>()), rootDeviceEnvironment) {
if (!rootDeviceEnvironment.executionEnvironment.osEnvironment.get()) {
rootDeviceEnvironment.executionEnvironment.osEnvironment = std::make_unique<OsEnvironmentWin>();
}