mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
Ftr/Wa table separation
Change-Id: I21034f6ec09d8b91dd6cd16135fbe5a19298dcad
This commit is contained in:
committed by
sys_ocldev
parent
c74cabbb9e
commit
97021d74a8
@@ -471,8 +471,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
endif()
|
||||
|
||||
# Project-wide include paths
|
||||
set(SKU_INFO_SRCS_DIR_SUFFIX "/")
|
||||
include_directories(${IGDRCL_SOURCE_DIR})
|
||||
include_directories(${IGDRCL_BUILD_DIR})
|
||||
include_directories(${IGDRCL_SOURCE_DIR}/runtime/sku_info/definitions${SKU_INFO_SRCS_DIR_SUFFIX})
|
||||
|
||||
# Define where to put binaries
|
||||
if(MSVC)
|
||||
|
||||
@@ -458,6 +458,20 @@ list (APPEND RUNTIME_SRCS_SCHEDULER
|
||||
scheduler/CMakeLists.txt
|
||||
)
|
||||
|
||||
set (RUNTIME_SRCS_SKU_INFO
|
||||
sku_info/sku_info_base.h
|
||||
sku_info/operations/sku_info_transfer.h
|
||||
sku_info/definitions${SKU_INFO_SRCS_DIR_SUFFIX}/sku_info.h
|
||||
sku_info/operations${SKU_INFO_SRCS_DIR_SUFFIX}/sku_info_transfer.cpp
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND RUNTIME_SRCS_SKU_INFO
|
||||
sku_info/operations/sku_info_receiver.h
|
||||
sku_info/operations${SKU_INFO_SRCS_DIR_SUFFIX}/sku_info_receiver.cpp
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
set (RUNTIME_SRCS_SHARINGS
|
||||
sharings/sharing.h
|
||||
sharings/sharing.cpp
|
||||
@@ -628,6 +642,7 @@ set (RUNTIME_SRCS
|
||||
${RUNTIME_SRCS_PROGRAM}
|
||||
${RUNTIME_SRCS_SAMPLER}
|
||||
${RUNTIME_SRCS_SCHEDULER}
|
||||
${RUNTIME_SRCS_SKU_INFO}
|
||||
${RUNTIME_SRCS_SHARINGS}
|
||||
${RUNTIME_SRCS_TBX}
|
||||
${RUNTIME_SRCS_UTILITIES}
|
||||
@@ -900,6 +915,7 @@ if (WIN32)
|
||||
source_group("source files\\program" FILES ${RUNTIME_SRCS_PROGRAM})
|
||||
source_group("source files\\sampler" FILES ${RUNTIME_SRCS_SAMPLER})
|
||||
source_group("source files\\scheduler" FILES ${RUNTIME_SRCS_SCHEDULER})
|
||||
source_group("source files\\sku_info" FILES ${RUNTIME_SRCS_SKU_INFO})
|
||||
source_group("source files\\sharings" FILES ${RUNTIME_SRCS_SHARINGS})
|
||||
source_group("source files\\tbx" FILES ${RUNTIME_SRCS_TBX})
|
||||
source_group("source files\\utilities" FILES ${RUNTIME_SRCS_UTILITIES})
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/sku_info/operations/sku_info_transfer.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -53,28 +54,6 @@ PGFX_DEBUG_CONTROL pDebugControl;
|
||||
}
|
||||
|
||||
namespace OCLRT {
|
||||
void fillWaTable(_WA_TABLE *dstWaTable, const OCLRT::WorkaroundTable *srcWaTable) {
|
||||
dstWaTable->WaFbcLinearSurfaceStride = srcWaTable->waFbcLinearSurfaceStride;
|
||||
dstWaTable->WaDisableEdramForDisplayRT = srcWaTable->waDisableEdramForDisplayRT;
|
||||
dstWaTable->WaEncryptedEdramOnlyPartials = srcWaTable->waEncryptedEdramOnlyPartials;
|
||||
}
|
||||
|
||||
void fillFtrTable(_SKU_FEATURE_TABLE *dstFtrTable, const OCLRT::FeatureTable *srcFtrTable) {
|
||||
dstFtrTable->FtrStandardMipTailFormat = srcFtrTable->ftrStandardMipTailFormat;
|
||||
dstFtrTable->FtrULT = srcFtrTable->ftrULT;
|
||||
dstFtrTable->FtrEDram = srcFtrTable->ftrEDram;
|
||||
dstFtrTable->FtrFrameBufferLLC = srcFtrTable->ftrFrameBufferLLC;
|
||||
dstFtrTable->FtrCrystalwell = srcFtrTable->ftrCrystalwell;
|
||||
dstFtrTable->FtrDisplayEngineS3d = srcFtrTable->ftrDisplayEngineS3d;
|
||||
dstFtrTable->FtrDisplayYTiling = srcFtrTable->ftrDisplayYTiling;
|
||||
dstFtrTable->FtrFbc = srcFtrTable->ftrFbc;
|
||||
dstFtrTable->FtrVERing = srcFtrTable->ftrVERing;
|
||||
dstFtrTable->FtrVcs2 = srcFtrTable->ftrVcs2;
|
||||
dstFtrTable->FtrLCIA = srcFtrTable->ftrLCIA;
|
||||
dstFtrTable->FtrIA32eGfxPTEs = srcFtrTable->ftrIA32eGfxPTEs;
|
||||
dstFtrTable->FtrWddm2GpuMmu = srcFtrTable->ftrWddm2GpuMmu;
|
||||
}
|
||||
|
||||
void Gmm::create() {
|
||||
if (resourceParams.BaseWidth >= maxPossiblePitch) {
|
||||
resourceParams.Flags.Gpu.NoRestriction = 1;
|
||||
@@ -90,8 +69,8 @@ bool Gmm::initContext(const PLATFORM *pPlatform,
|
||||
// fill values Gmmlib requested
|
||||
_SKU_FEATURE_TABLE gmmFtrTable = {};
|
||||
_WA_TABLE gmmWaTable = {};
|
||||
fillFtrTable(&gmmFtrTable, pSkuTable);
|
||||
fillWaTable(&gmmWaTable, pWaTable);
|
||||
SkuInfoTransfer::transferFtrTableForGmm(&gmmFtrTable, pSkuTable);
|
||||
SkuInfoTransfer::transferWaTableForGmm(&gmmWaTable, pWaTable);
|
||||
|
||||
bool success = GMM_SUCCESS == GmmInitGlobalContext(*pPlatform, &gmmFtrTable, &gmmWaTable, pGtSysInfo, GMM_OGL_VISTA);
|
||||
DEBUG_BREAK_IF(!success);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#pragma once
|
||||
#include "igfxfmid.h"
|
||||
#include "gtsysinfo.h"
|
||||
#include "sku_info.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
@@ -66,100 +67,6 @@ struct RuntimeCapabilityTable {
|
||||
int32_t nodeOrdinal;
|
||||
};
|
||||
|
||||
struct FeatureTable {
|
||||
bool ftrDesktop = false;
|
||||
bool ftrChannelSwizzlingXOREnabled = false;
|
||||
|
||||
bool ftrGtBigDie = false;
|
||||
bool ftrGtMediumDie = false;
|
||||
bool ftrGtSmallDie = false;
|
||||
|
||||
bool ftrGT1 = false;
|
||||
bool ftrGT1_5 = false;
|
||||
bool ftrGT2 = false;
|
||||
bool ftrGT2_5 = false;
|
||||
bool ftrGT3 = false;
|
||||
bool ftrGT4 = false;
|
||||
|
||||
bool ftrIVBM0M1Platform = false;
|
||||
bool ftrSGTPVSKUStrapPresent = false;
|
||||
bool ftrGTA = false;
|
||||
bool ftrGTC = false;
|
||||
bool ftrGTX = false;
|
||||
bool ftr5Slice = false;
|
||||
|
||||
bool ftrGpGpuMidBatchPreempt = false;
|
||||
bool ftrGpGpuThreadGroupLevelPreempt = false;
|
||||
bool ftrGpGpuMidThreadLevelPreempt = false;
|
||||
|
||||
bool ftrIoMmuPageFaulting = false;
|
||||
bool ftrWddm2Svm = false;
|
||||
bool ftrPooledEuEnabled = false;
|
||||
|
||||
bool ftrResourceStreamer = false;
|
||||
|
||||
bool ftrPPGTT = false;
|
||||
bool ftrSVM = false;
|
||||
bool ftrEDram = false;
|
||||
bool ftrL3IACoherency = false;
|
||||
bool ftrIA32eGfxPTEs = false;
|
||||
|
||||
bool ftr3dMidBatchPreempt = false;
|
||||
bool ftr3dObjectLevelPreempt = false;
|
||||
bool ftrPerCtxtPreemptionGranularityControl = false;
|
||||
|
||||
bool ftrDisplayYTiling = false;
|
||||
bool ftrTranslationTable = false;
|
||||
bool ftrUserModeTranslationTable = false;
|
||||
|
||||
bool ftrEnableGuC = false;
|
||||
|
||||
bool ftrFbc = false;
|
||||
bool ftrFbc2AddressTranslation = false;
|
||||
bool ftrFbcBlitterTracking = false;
|
||||
bool ftrFbcCpuTracking = false;
|
||||
|
||||
bool ftrVcs2 = false;
|
||||
bool ftrVEBOX = false;
|
||||
bool ftrSingleVeboxSlice = false;
|
||||
bool ftrULT = false;
|
||||
bool ftrLCIA = false;
|
||||
bool ftrGttCacheInvalidation = false;
|
||||
bool ftrTileMappedResource = false;
|
||||
bool ftrAstcHdr2D = false;
|
||||
bool ftrAstcLdr2D = false;
|
||||
|
||||
bool ftrStandardMipTailFormat = false; // Gmmlib
|
||||
bool ftrFrameBufferLLC = false; // Gmmlib
|
||||
bool ftrCrystalwell = false; // Gmmlib
|
||||
bool ftrLLCBypass = false; // Gmmlib
|
||||
bool ftrDisplayEngineS3d = false; // Gmmlib
|
||||
bool ftrVERing = false; // Gmmlib
|
||||
bool ftrWddm2GpuMmu = false; // Gmmlib
|
||||
};
|
||||
|
||||
struct WorkaroundTable {
|
||||
bool waDoNotUseMIReportPerfCount = false;
|
||||
|
||||
bool waEnablePreemptionGranularityControlByUMD = false;
|
||||
bool waSendMIFLUSHBeforeVFE = false;
|
||||
bool waReportPerfCountUseGlobalContextID = false;
|
||||
bool waDisableLSQCROPERFforOCL = false;
|
||||
bool waMsaa8xTileYDepthPitchAlignment = false;
|
||||
bool waLosslessCompressionSurfaceStride = false;
|
||||
bool waFbcLinearSurfaceStride = false; // Gmmlib
|
||||
bool wa4kAlignUVOffsetNV12LinearSurface = false;
|
||||
bool waEncryptedEdramOnlyPartials = false; // Gmmlib
|
||||
bool waDisableEdramForDisplayRT = false; // Gmmlib
|
||||
bool waForcePcBbFullCfgRestore = false;
|
||||
bool waCompressedResourceRequiresConstVA21 = false;
|
||||
bool waDisablePerCtxtPreemptionGranularityControl = false;
|
||||
bool waLLCCachingUnsupported = false;
|
||||
bool waUseVAlign16OnTileXYBpp816 = false;
|
||||
bool waModifyVFEStateAfterGPGPUPreemption = false;
|
||||
bool waCSRUncachable = false;
|
||||
};
|
||||
|
||||
struct HardwareInfo {
|
||||
const PLATFORM *pPlatform;
|
||||
const FeatureTable *pSkuTable;
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "runtime/os_interface/windows/wddm.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "runtime/sku_info/operations/sku_info_receiver.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT];
|
||||
@@ -54,8 +56,8 @@ bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices) {
|
||||
tempHwInfos[devNum].pWaTable = waTable;
|
||||
tempHwInfos[devNum].pSysInfo = new GT_SYSTEM_INFO(adapterInfo->SystemInfo);
|
||||
|
||||
Wddm::setupFeatureTableFromAdapterInfo(featureTable, adapterInfo);
|
||||
Wddm::setupWorkaroundTableFromAdapterInfo(waTable, adapterInfo);
|
||||
SkuInfoReceiver::receiveFtrTableFromAdapterInfo(featureTable, adapterInfo);
|
||||
SkuInfoReceiver::receiveWaTableFromAdapterInfo(waTable, adapterInfo);
|
||||
|
||||
auto productFamily = tempHwInfos[devNum].pPlatform->eProductFamily;
|
||||
DEBUG_BREAK_IF(hardwareInfoTable[productFamily] == nullptr);
|
||||
@@ -130,4 +132,4 @@ void Device::appendOSExtensions(std::string &deviceExtensions) {
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/wddm_helper.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/sku_info/operations/sku_info_receiver.h"
|
||||
#include <dxgi.h>
|
||||
#include <ntstatus.h>
|
||||
#include "CL/cl.h"
|
||||
@@ -111,103 +112,6 @@ bool Wddm::enumAdapters(unsigned int devNum, ADAPTER_INFO *adapterInfo) {
|
||||
return success;
|
||||
}
|
||||
|
||||
void Wddm::setupFeatureTableFromAdapterInfo(FeatureTable *table, ADAPTER_INFO *adapterInfo) {
|
||||
#define COPY_FTR(DST_VAL_NAME, SRC_VAL_NAME) table->DST_VAL_NAME = adapterInfo->SkuTable.SRC_VAL_NAME
|
||||
COPY_FTR(ftrDesktop, FtrDesktop);
|
||||
COPY_FTR(ftrChannelSwizzlingXOREnabled, FtrChannelSwizzlingXOREnabled);
|
||||
|
||||
COPY_FTR(ftrGtBigDie, FtrGtBigDie);
|
||||
COPY_FTR(ftrGtMediumDie, FtrGtMediumDie);
|
||||
COPY_FTR(ftrGtSmallDie, FtrGtSmallDie);
|
||||
|
||||
COPY_FTR(ftrGT1, FtrGT1);
|
||||
COPY_FTR(ftrGT1_5, FtrGT1_5);
|
||||
COPY_FTR(ftrGT2, FtrGT2);
|
||||
COPY_FTR(ftrGT2_5, FtrGT2_5);
|
||||
COPY_FTR(ftrGT3, FtrGT3);
|
||||
COPY_FTR(ftrGT4, FtrGT4);
|
||||
|
||||
COPY_FTR(ftrIVBM0M1Platform, FtrIVBM0M1Platform);
|
||||
COPY_FTR(ftrSGTPVSKUStrapPresent, FtrSGTPVSKUStrapPresent);
|
||||
COPY_FTR(ftrGTA, FtrGTA);
|
||||
COPY_FTR(ftrGTC, FtrGTC);
|
||||
COPY_FTR(ftrGTX, FtrGTX);
|
||||
COPY_FTR(ftr5Slice, Ftr5Slice);
|
||||
|
||||
COPY_FTR(ftrGpGpuMidBatchPreempt, FtrGpGpuMidBatchPreempt);
|
||||
COPY_FTR(ftrGpGpuThreadGroupLevelPreempt, FtrGpGpuThreadGroupLevelPreempt);
|
||||
COPY_FTR(ftrGpGpuMidThreadLevelPreempt, FtrGpGpuMidThreadLevelPreempt);
|
||||
|
||||
COPY_FTR(ftrIoMmuPageFaulting, FtrIoMmuPageFaulting);
|
||||
COPY_FTR(ftrWddm2Svm, FtrWddm2Svm);
|
||||
COPY_FTR(ftrPooledEuEnabled, FtrPooledEuEnabled);
|
||||
|
||||
COPY_FTR(ftrResourceStreamer, FtrResourceStreamer);
|
||||
|
||||
COPY_FTR(ftrPPGTT, FtrPPGTT);
|
||||
COPY_FTR(ftrSVM, FtrSVM);
|
||||
COPY_FTR(ftrEDram, FtrEDram);
|
||||
COPY_FTR(ftrL3IACoherency, FtrL3IACoherency);
|
||||
COPY_FTR(ftrIA32eGfxPTEs, FtrIA32eGfxPTEs);
|
||||
|
||||
COPY_FTR(ftr3dMidBatchPreempt, Ftr3dMidBatchPreempt);
|
||||
COPY_FTR(ftr3dObjectLevelPreempt, Ftr3dObjectLevelPreempt);
|
||||
COPY_FTR(ftrPerCtxtPreemptionGranularityControl, FtrPerCtxtPreemptionGranularityControl);
|
||||
|
||||
COPY_FTR(ftrDisplayYTiling, FtrDisplayYTiling);
|
||||
COPY_FTR(ftrTranslationTable, FtrTranslationTable);
|
||||
COPY_FTR(ftrUserModeTranslationTable, FtrUserModeTranslationTable);
|
||||
|
||||
COPY_FTR(ftrEnableGuC, FtrEnableGuC);
|
||||
|
||||
COPY_FTR(ftrFbc, FtrFbc);
|
||||
COPY_FTR(ftrFbc2AddressTranslation, FtrFbc2AddressTranslation);
|
||||
COPY_FTR(ftrFbcBlitterTracking, FtrFbcBlitterTracking);
|
||||
COPY_FTR(ftrFbcCpuTracking, FtrFbcCpuTracking);
|
||||
|
||||
COPY_FTR(ftrVcs2, FtrVcs2);
|
||||
COPY_FTR(ftrVEBOX, FtrVEBOX);
|
||||
COPY_FTR(ftrSingleVeboxSlice, FtrSingleVeboxSlice);
|
||||
COPY_FTR(ftrULT, FtrULT);
|
||||
COPY_FTR(ftrLCIA, FtrLCIA);
|
||||
COPY_FTR(ftrGttCacheInvalidation, FtrGttCacheInvalidation);
|
||||
COPY_FTR(ftrTileMappedResource, FtrTileMappedResource);
|
||||
COPY_FTR(ftrAstcHdr2D, FtrAstcHdr2D);
|
||||
COPY_FTR(ftrAstcLdr2D, FtrAstcLdr2D);
|
||||
|
||||
COPY_FTR(ftrStandardMipTailFormat, FtrStandardMipTailFormat);
|
||||
COPY_FTR(ftrFrameBufferLLC, FtrFrameBufferLLC);
|
||||
COPY_FTR(ftrCrystalwell, FtrCrystalwell);
|
||||
COPY_FTR(ftrLLCBypass, FtrLLCBypass);
|
||||
COPY_FTR(ftrDisplayEngineS3d, FtrDisplayEngineS3d);
|
||||
COPY_FTR(ftrVERing, FtrVERing);
|
||||
COPY_FTR(ftrWddm2GpuMmu, FtrWddm2GpuMmu);
|
||||
#undef COPY_FTR
|
||||
}
|
||||
void Wddm::setupWorkaroundTableFromAdapterInfo(WorkaroundTable *table, ADAPTER_INFO *adapterInfo) {
|
||||
#define COPY_WA(DST_VAL_NAME, SRC_VAL_NAME) table->DST_VAL_NAME = adapterInfo->WaTable.SRC_VAL_NAME
|
||||
COPY_WA(waDoNotUseMIReportPerfCount, WaDoNotUseMIReportPerfCount);
|
||||
|
||||
COPY_WA(waEnablePreemptionGranularityControlByUMD, WaEnablePreemptionGranularityControlByUMD);
|
||||
COPY_WA(waSendMIFLUSHBeforeVFE, WaSendMIFLUSHBeforeVFE);
|
||||
COPY_WA(waReportPerfCountUseGlobalContextID, WaReportPerfCountUseGlobalContextID);
|
||||
COPY_WA(waDisableLSQCROPERFforOCL, WaDisableLSQCROPERFforOCL);
|
||||
COPY_WA(waMsaa8xTileYDepthPitchAlignment, WaMsaa8xTileYDepthPitchAlignment);
|
||||
COPY_WA(waLosslessCompressionSurfaceStride, WaLosslessCompressionSurfaceStride);
|
||||
COPY_WA(waFbcLinearSurfaceStride, WaFbcLinearSurfaceStride);
|
||||
COPY_WA(wa4kAlignUVOffsetNV12LinearSurface, Wa4kAlignUVOffsetNV12LinearSurface);
|
||||
COPY_WA(waEncryptedEdramOnlyPartials, WaEncryptedEdramOnlyPartials);
|
||||
COPY_WA(waDisableEdramForDisplayRT, WaDisableEdramForDisplayRT);
|
||||
COPY_WA(waForcePcBbFullCfgRestore, WaForcePcBbFullCfgRestore);
|
||||
COPY_WA(waCompressedResourceRequiresConstVA21, WaCompressedResourceRequiresConstVA21);
|
||||
COPY_WA(waDisablePerCtxtPreemptionGranularityControl, WaDisablePerCtxtPreemptionGranularityControl);
|
||||
COPY_WA(waLLCCachingUnsupported, WaLLCCachingUnsupported);
|
||||
COPY_WA(waUseVAlign16OnTileXYBpp816, WaUseVAlign16OnTileXYBpp816);
|
||||
COPY_WA(waModifyVFEStateAfterGPGPUPreemption, WaModifyVFEStateAfterGPGPUPreemption);
|
||||
COPY_WA(waCSRUncachable, WaCSRUncachable);
|
||||
#undef COPY_WA
|
||||
}
|
||||
|
||||
bool Wddm::queryAdapterInfo() {
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
D3DKMT_QUERYADAPTERINFO QueryAdapterInfo = {0};
|
||||
@@ -222,10 +126,10 @@ bool Wddm::queryAdapterInfo() {
|
||||
// translate
|
||||
if (status == STATUS_SUCCESS) {
|
||||
featureTable.reset(new FeatureTable());
|
||||
Wddm::setupFeatureTableFromAdapterInfo(featureTable.get(), adapterInfo);
|
||||
SkuInfoReceiver::receiveFtrTableFromAdapterInfo(featureTable.get(), adapterInfo);
|
||||
|
||||
waTable.reset(new WorkaroundTable());
|
||||
Wddm::setupWorkaroundTableFromAdapterInfo(waTable.get(), adapterInfo);
|
||||
SkuInfoReceiver::receiveWaTableFromAdapterInfo(waTable.get(), adapterInfo);
|
||||
}
|
||||
|
||||
return status == STATUS_SUCCESS;
|
||||
|
||||
@@ -69,8 +69,6 @@ class Wddm {
|
||||
static Wddm *createWddm(Gdi *gdi = nullptr);
|
||||
|
||||
static bool enumAdapters(unsigned int devNum, ADAPTER_INFO *adapterInfo);
|
||||
static void setupFeatureTableFromAdapterInfo(FeatureTable *table, ADAPTER_INFO *adapterInfo);
|
||||
static void setupWorkaroundTableFromAdapterInfo(WorkaroundTable *table, ADAPTER_INFO *adapterInfo);
|
||||
|
||||
MOCKABLE_VIRTUAL bool evict(D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim);
|
||||
MOCKABLE_VIRTUAL bool makeResident(D3DKMT_HANDLE *handles, uint32_t count, bool cantTrimFurther, uint64_t *numberOfBytesToTrim);
|
||||
|
||||
30
runtime/sku_info/definitions/sku_info.h
Normal file
30
runtime/sku_info/definitions/sku_info.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/sku_info/sku_info_base.h"
|
||||
|
||||
namespace OCLRT {
|
||||
struct FeatureTable : FeatureTableBase {};
|
||||
|
||||
struct WorkaroundTable : WorkaroundTableBase {};
|
||||
} // namespace OCLRT
|
||||
33
runtime/sku_info/operations/sku_info_receiver.cpp
Normal file
33
runtime/sku_info/operations/sku_info_receiver.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/sku_info/operations/sku_info_receiver.h"
|
||||
|
||||
namespace OCLRT {
|
||||
void SkuInfoReceiver::receiveFtrTableFromAdapterInfo(FeatureTable *ftrTable, _ADAPTER_INFO *adapterInfo) {
|
||||
receiveFtrTableFromAdapterInfoBase(ftrTable, adapterInfo);
|
||||
}
|
||||
|
||||
void SkuInfoReceiver::receiveWaTableFromAdapterInfo(WorkaroundTable *waTable, _ADAPTER_INFO *adapterInfo) {
|
||||
receiveWaTableFromAdapterInfoBase(waTable, adapterInfo);
|
||||
}
|
||||
} // namespace OCLRT
|
||||
134
runtime/sku_info/operations/sku_info_receiver.h
Normal file
134
runtime/sku_info/operations/sku_info_receiver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "sku_info.h"
|
||||
#include "runtime/os_interface/windows/windows_wrapper.h"
|
||||
#include "umKmInc/sharedata.h"
|
||||
|
||||
namespace OCLRT {
|
||||
class SkuInfoReceiver {
|
||||
public:
|
||||
static void receiveFtrTableFromAdapterInfo(FeatureTable *ftrTable, _ADAPTER_INFO *adapterInfo);
|
||||
static void receiveWaTableFromAdapterInfo(WorkaroundTable *waTable, _ADAPTER_INFO *adapterInfo);
|
||||
|
||||
protected:
|
||||
static void receiveFtrTableFromAdapterInfoBase(FeatureTable *ftrTable, _ADAPTER_INFO *adapterInfo) {
|
||||
#define RECEIVE_FTR(VAL_NAME) ftrTable->ftr##VAL_NAME = adapterInfo->SkuTable.Ftr##VAL_NAME
|
||||
RECEIVE_FTR(Desktop);
|
||||
RECEIVE_FTR(ChannelSwizzlingXOREnabled);
|
||||
|
||||
RECEIVE_FTR(GtBigDie);
|
||||
RECEIVE_FTR(GtMediumDie);
|
||||
RECEIVE_FTR(GtSmallDie);
|
||||
|
||||
RECEIVE_FTR(GT1);
|
||||
RECEIVE_FTR(GT1_5);
|
||||
RECEIVE_FTR(GT2);
|
||||
RECEIVE_FTR(GT2_5);
|
||||
RECEIVE_FTR(GT3);
|
||||
RECEIVE_FTR(GT4);
|
||||
|
||||
RECEIVE_FTR(IVBM0M1Platform);
|
||||
RECEIVE_FTR(SGTPVSKUStrapPresent);
|
||||
RECEIVE_FTR(GTA);
|
||||
RECEIVE_FTR(GTC);
|
||||
RECEIVE_FTR(GTX);
|
||||
RECEIVE_FTR(5Slice);
|
||||
|
||||
RECEIVE_FTR(GpGpuMidBatchPreempt);
|
||||
RECEIVE_FTR(GpGpuThreadGroupLevelPreempt);
|
||||
RECEIVE_FTR(GpGpuMidThreadLevelPreempt);
|
||||
|
||||
RECEIVE_FTR(IoMmuPageFaulting);
|
||||
RECEIVE_FTR(Wddm2Svm);
|
||||
RECEIVE_FTR(PooledEuEnabled);
|
||||
|
||||
RECEIVE_FTR(ResourceStreamer);
|
||||
|
||||
RECEIVE_FTR(PPGTT);
|
||||
RECEIVE_FTR(SVM);
|
||||
RECEIVE_FTR(EDram);
|
||||
RECEIVE_FTR(L3IACoherency);
|
||||
RECEIVE_FTR(IA32eGfxPTEs);
|
||||
|
||||
RECEIVE_FTR(3dMidBatchPreempt);
|
||||
RECEIVE_FTR(3dObjectLevelPreempt);
|
||||
RECEIVE_FTR(PerCtxtPreemptionGranularityControl);
|
||||
|
||||
RECEIVE_FTR(DisplayYTiling);
|
||||
RECEIVE_FTR(TranslationTable);
|
||||
RECEIVE_FTR(UserModeTranslationTable);
|
||||
|
||||
RECEIVE_FTR(EnableGuC);
|
||||
|
||||
RECEIVE_FTR(Fbc);
|
||||
RECEIVE_FTR(Fbc2AddressTranslation);
|
||||
RECEIVE_FTR(FbcBlitterTracking);
|
||||
RECEIVE_FTR(FbcCpuTracking);
|
||||
|
||||
RECEIVE_FTR(Vcs2);
|
||||
RECEIVE_FTR(VEBOX);
|
||||
RECEIVE_FTR(SingleVeboxSlice);
|
||||
RECEIVE_FTR(ULT);
|
||||
RECEIVE_FTR(LCIA);
|
||||
RECEIVE_FTR(GttCacheInvalidation);
|
||||
RECEIVE_FTR(TileMappedResource);
|
||||
RECEIVE_FTR(AstcHdr2D);
|
||||
RECEIVE_FTR(AstcLdr2D);
|
||||
|
||||
RECEIVE_FTR(StandardMipTailFormat);
|
||||
RECEIVE_FTR(FrameBufferLLC);
|
||||
RECEIVE_FTR(Crystalwell);
|
||||
RECEIVE_FTR(LLCBypass);
|
||||
RECEIVE_FTR(DisplayEngineS3d);
|
||||
RECEIVE_FTR(VERing);
|
||||
RECEIVE_FTR(Wddm2GpuMmu);
|
||||
#undef RECEIVE_FTR
|
||||
}
|
||||
|
||||
static void receiveWaTableFromAdapterInfoBase(WorkaroundTable *waTable, _ADAPTER_INFO *adapterInfo) {
|
||||
#define RECEIVE_WA(VAL_NAME) waTable->wa##VAL_NAME = adapterInfo->WaTable.Wa##VAL_NAME
|
||||
RECEIVE_WA(DoNotUseMIReportPerfCount);
|
||||
|
||||
RECEIVE_WA(EnablePreemptionGranularityControlByUMD);
|
||||
RECEIVE_WA(SendMIFLUSHBeforeVFE);
|
||||
RECEIVE_WA(ReportPerfCountUseGlobalContextID);
|
||||
RECEIVE_WA(DisableLSQCROPERFforOCL);
|
||||
RECEIVE_WA(Msaa8xTileYDepthPitchAlignment);
|
||||
RECEIVE_WA(LosslessCompressionSurfaceStride);
|
||||
RECEIVE_WA(FbcLinearSurfaceStride);
|
||||
RECEIVE_WA(4kAlignUVOffsetNV12LinearSurface);
|
||||
RECEIVE_WA(EncryptedEdramOnlyPartials);
|
||||
RECEIVE_WA(DisableEdramForDisplayRT);
|
||||
RECEIVE_WA(ForcePcBbFullCfgRestore);
|
||||
RECEIVE_WA(CompressedResourceRequiresConstVA21);
|
||||
RECEIVE_WA(DisablePerCtxtPreemptionGranularityControl);
|
||||
RECEIVE_WA(LLCCachingUnsupported);
|
||||
RECEIVE_WA(UseVAlign16OnTileXYBpp816);
|
||||
RECEIVE_WA(ModifyVFEStateAfterGPGPUPreemption);
|
||||
RECEIVE_WA(CSRUncachable);
|
||||
#undef RECEIVE_WA
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace OCLRT
|
||||
33
runtime/sku_info/operations/sku_info_transfer.cpp
Normal file
33
runtime/sku_info/operations/sku_info_transfer.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/sku_info/operations/sku_info_transfer.h"
|
||||
|
||||
namespace OCLRT {
|
||||
void SkuInfoTransfer::transferWaTableForGmm(_WA_TABLE *dstWaTable, const OCLRT::WorkaroundTable *srcWaTable) {
|
||||
transferWaTableForGmmBase(dstWaTable, srcWaTable);
|
||||
}
|
||||
|
||||
void SkuInfoTransfer::transferFtrTableForGmm(_SKU_FEATURE_TABLE *dstFtrTable, const OCLRT::FeatureTable *srcFtrTable) {
|
||||
transferFtrTableForGmmBase(dstFtrTable, srcFtrTable);
|
||||
}
|
||||
} // namespace OCLRT
|
||||
62
runtime/sku_info/operations/sku_info_transfer.h
Normal file
62
runtime/sku_info/operations/sku_info_transfer.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "sku_info.h"
|
||||
#include "runtime/sku_info/operations/sku_info_transfer.h"
|
||||
#include "runtime/gmm_helper/gmm_lib.h"
|
||||
|
||||
namespace OCLRT {
|
||||
class SkuInfoTransfer {
|
||||
public:
|
||||
static void transferFtrTableForGmm(_SKU_FEATURE_TABLE *dstFtrTable, const FeatureTable *srcFtrTable);
|
||||
static void transferWaTableForGmm(_WA_TABLE *dstWaTable, const WorkaroundTable *srcWaTable);
|
||||
|
||||
protected:
|
||||
static void transferFtrTableForGmmBase(_SKU_FEATURE_TABLE *dstFtrTable, const OCLRT::FeatureTable *srcFtrTable) {
|
||||
#define TRANSFER_FTR_TO_GMM(VAL_NAME) dstFtrTable->Ftr##VAL_NAME = srcFtrTable->ftr##VAL_NAME
|
||||
TRANSFER_FTR_TO_GMM(StandardMipTailFormat);
|
||||
TRANSFER_FTR_TO_GMM(ULT);
|
||||
TRANSFER_FTR_TO_GMM(EDram);
|
||||
TRANSFER_FTR_TO_GMM(FrameBufferLLC);
|
||||
TRANSFER_FTR_TO_GMM(Crystalwell);
|
||||
TRANSFER_FTR_TO_GMM(DisplayEngineS3d);
|
||||
TRANSFER_FTR_TO_GMM(DisplayYTiling);
|
||||
TRANSFER_FTR_TO_GMM(Fbc);
|
||||
TRANSFER_FTR_TO_GMM(VERing);
|
||||
TRANSFER_FTR_TO_GMM(Vcs2);
|
||||
TRANSFER_FTR_TO_GMM(LCIA);
|
||||
TRANSFER_FTR_TO_GMM(IA32eGfxPTEs);
|
||||
TRANSFER_FTR_TO_GMM(Wddm2GpuMmu);
|
||||
#undef TRANSFER_FTR_TO_GMM
|
||||
}
|
||||
|
||||
static void transferWaTableForGmmBase(_WA_TABLE *dstWaTable, const OCLRT::WorkaroundTable *srcWaTable) {
|
||||
#define TRANSFER_WA_TO_GMM(VAL_NAME) dstWaTable->Wa##VAL_NAME = srcWaTable->wa##VAL_NAME
|
||||
TRANSFER_WA_TO_GMM(FbcLinearSurfaceStride);
|
||||
TRANSFER_WA_TO_GMM(DisableEdramForDisplayRT);
|
||||
TRANSFER_WA_TO_GMM(EncryptedEdramOnlyPartials);
|
||||
#undef TRANSFER_WA_TO_GMM
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace OCLRT
|
||||
119
runtime/sku_info/sku_info_base.h
Normal file
119
runtime/sku_info/sku_info_base.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace OCLRT {
|
||||
struct FeatureTableBase {
|
||||
bool ftrDesktop = false;
|
||||
bool ftrChannelSwizzlingXOREnabled = false;
|
||||
|
||||
bool ftrGtBigDie = false;
|
||||
bool ftrGtMediumDie = false;
|
||||
bool ftrGtSmallDie = false;
|
||||
|
||||
bool ftrGT1 = false;
|
||||
bool ftrGT1_5 = false;
|
||||
bool ftrGT2 = false;
|
||||
bool ftrGT2_5 = false;
|
||||
bool ftrGT3 = false;
|
||||
bool ftrGT4 = false;
|
||||
|
||||
bool ftrIVBM0M1Platform = false;
|
||||
bool ftrSGTPVSKUStrapPresent = false;
|
||||
bool ftrGTA = false;
|
||||
bool ftrGTC = false;
|
||||
bool ftrGTX = false;
|
||||
bool ftr5Slice = false;
|
||||
|
||||
bool ftrGpGpuMidBatchPreempt = false;
|
||||
bool ftrGpGpuThreadGroupLevelPreempt = false;
|
||||
bool ftrGpGpuMidThreadLevelPreempt = false;
|
||||
|
||||
bool ftrIoMmuPageFaulting = false;
|
||||
bool ftrWddm2Svm = false;
|
||||
bool ftrPooledEuEnabled = false;
|
||||
|
||||
bool ftrResourceStreamer = false;
|
||||
|
||||
bool ftrPPGTT = false;
|
||||
bool ftrSVM = false;
|
||||
bool ftrEDram = false;
|
||||
bool ftrL3IACoherency = false;
|
||||
bool ftrIA32eGfxPTEs = false;
|
||||
|
||||
bool ftr3dMidBatchPreempt = false;
|
||||
bool ftr3dObjectLevelPreempt = false;
|
||||
bool ftrPerCtxtPreemptionGranularityControl = false;
|
||||
|
||||
bool ftrDisplayYTiling = false;
|
||||
bool ftrTranslationTable = false;
|
||||
bool ftrUserModeTranslationTable = false;
|
||||
|
||||
bool ftrEnableGuC = false;
|
||||
|
||||
bool ftrFbc = false;
|
||||
bool ftrFbc2AddressTranslation = false;
|
||||
bool ftrFbcBlitterTracking = false;
|
||||
bool ftrFbcCpuTracking = false;
|
||||
|
||||
bool ftrVcs2 = false;
|
||||
bool ftrVEBOX = false;
|
||||
bool ftrSingleVeboxSlice = false;
|
||||
bool ftrULT = false;
|
||||
bool ftrLCIA = false;
|
||||
bool ftrGttCacheInvalidation = false;
|
||||
bool ftrTileMappedResource = false;
|
||||
bool ftrAstcHdr2D = false;
|
||||
bool ftrAstcLdr2D = false;
|
||||
|
||||
bool ftrStandardMipTailFormat = false; // Gmmlib
|
||||
bool ftrFrameBufferLLC = false; // Gmmlib
|
||||
bool ftrCrystalwell = false; // Gmmlib
|
||||
bool ftrLLCBypass = false; // Gmmlib
|
||||
bool ftrDisplayEngineS3d = false; // Gmmlib
|
||||
bool ftrVERing = false; // Gmmlib
|
||||
bool ftrWddm2GpuMmu = false; // Gmmlib
|
||||
};
|
||||
|
||||
struct WorkaroundTableBase {
|
||||
bool waDoNotUseMIReportPerfCount = false;
|
||||
|
||||
bool waEnablePreemptionGranularityControlByUMD = false;
|
||||
bool waSendMIFLUSHBeforeVFE = false;
|
||||
bool waReportPerfCountUseGlobalContextID = false;
|
||||
bool waDisableLSQCROPERFforOCL = false;
|
||||
bool waMsaa8xTileYDepthPitchAlignment = false;
|
||||
bool waLosslessCompressionSurfaceStride = false;
|
||||
bool waFbcLinearSurfaceStride = false; // Gmmlib
|
||||
bool wa4kAlignUVOffsetNV12LinearSurface = false;
|
||||
bool waEncryptedEdramOnlyPartials = false; // Gmmlib
|
||||
bool waDisableEdramForDisplayRT = false; // Gmmlib
|
||||
bool waForcePcBbFullCfgRestore = false;
|
||||
bool waCompressedResourceRequiresConstVA21 = false;
|
||||
bool waDisablePerCtxtPreemptionGranularityControl = false;
|
||||
bool waLLCCachingUnsupported = false;
|
||||
bool waUseVAlign16OnTileXYBpp816 = false;
|
||||
bool waModifyVFEStateAfterGPGPUPreemption = false;
|
||||
bool waCSRUncachable = false;
|
||||
};
|
||||
} // namespace OCLRT
|
||||
@@ -57,6 +57,7 @@ add_subdirectory(program)
|
||||
add_subdirectory(sampler)
|
||||
add_subdirectory(scenarios)
|
||||
add_subdirectory(scheduler)
|
||||
add_subdirectory(sku_info)
|
||||
add_subdirectory(sharings)
|
||||
add_subdirectory(utilities)
|
||||
|
||||
@@ -123,6 +124,7 @@ set(IGDRCL_SRCS_tests
|
||||
${IGDRCL_SRCS_tests_sampler}
|
||||
${IGDRCL_SRCS_tests_scenarios}
|
||||
${IGDRCL_SRCS_tests_scheduler}
|
||||
${IGDRCL_SRCS_tests_sku_info}
|
||||
${IGDRCL_SRCS_tests_sharings}
|
||||
${IGDRCL_SRCS_tests_utilities}
|
||||
)
|
||||
@@ -348,6 +350,7 @@ source_group("source files\\program" FILES ${IGDRCL_SRCS_tests_program})
|
||||
source_group("source files\\sampler" FILES ${IGDRCL_SRCS_tests_sampler})
|
||||
source_group("source files\\scenarios" FILES ${IGDRCL_SRCS_tests_scenarios})
|
||||
source_group("source files\\scheduler" FILES ${IGDRCL_SRCS_tests_scheduler})
|
||||
source_group("source files\\sku_info" FILES ${IGDRCL_SRCS_tests_sku_info})
|
||||
source_group("source files\\sharings" FILES ${IGDRCL_SRCS_tests_sharings})
|
||||
source_group("source files\\utilities" FILES ${IGDRCL_SRCS_tests_utilities})
|
||||
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
using namespace ::testing;
|
||||
|
||||
namespace OCLRT {
|
||||
extern void fillWaTable(_WA_TABLE *dstWaTable, const WorkaroundTable *srcWaTable);
|
||||
extern void fillFtrTable(_SKU_FEATURE_TABLE *dstFtrTable, const FeatureTable *srcFtrTable);
|
||||
|
||||
class GmmTests : public ::testing::Test {
|
||||
public:
|
||||
void SetUp() override {
|
||||
@@ -563,42 +560,4 @@ TEST_F(GmmTests, copyResourceBlt) {
|
||||
EXPECT_EQ(1u, retVal);
|
||||
EXPECT_TRUE(memcmp(&expectedCpuBlt, &requestedCpuBlt, sizeof(GMM_RES_COPY_BLT)) == 0);
|
||||
}
|
||||
|
||||
TEST(GmmTest, givenFeatureTableWhenFillingStructureForGmmThenCopyOnlySelectedValues) {
|
||||
_SKU_FEATURE_TABLE requestedFtrTable = {};
|
||||
_SKU_FEATURE_TABLE refFtrTable = {};
|
||||
FeatureTable featureTable;
|
||||
memset(&featureTable, 1, sizeof(FeatureTable));
|
||||
|
||||
refFtrTable.FtrStandardMipTailFormat = 1;
|
||||
refFtrTable.FtrULT = 1;
|
||||
refFtrTable.FtrEDram = 1;
|
||||
refFtrTable.FtrFrameBufferLLC = 1;
|
||||
refFtrTable.FtrCrystalwell = 1;
|
||||
refFtrTable.FtrDisplayEngineS3d = 1;
|
||||
refFtrTable.FtrDisplayYTiling = 1;
|
||||
refFtrTable.FtrFbc = 1;
|
||||
refFtrTable.FtrVERing = 1;
|
||||
refFtrTable.FtrVcs2 = 1;
|
||||
refFtrTable.FtrLCIA = 1;
|
||||
refFtrTable.FtrIA32eGfxPTEs = 1;
|
||||
refFtrTable.FtrWddm2GpuMmu = 1;
|
||||
|
||||
fillFtrTable(&requestedFtrTable, &featureTable);
|
||||
EXPECT_TRUE(memcmp(&requestedFtrTable, &refFtrTable, sizeof(_SKU_FEATURE_TABLE)) == 0);
|
||||
}
|
||||
|
||||
TEST(GmmTest, givenWaTableWhenFillingStructureForGmmThenCopyOnlySelectedValues) {
|
||||
_WA_TABLE requestedWaTable = {};
|
||||
_WA_TABLE refWaTable = {};
|
||||
WorkaroundTable waTable;
|
||||
memset(&waTable, 1, sizeof(WorkaroundTable));
|
||||
|
||||
refWaTable.WaFbcLinearSurfaceStride = 1;
|
||||
refWaTable.WaDisableEdramForDisplayRT = 1;
|
||||
refWaTable.WaEncryptedEdramOnlyPartials = 1;
|
||||
|
||||
fillWaTable(&requestedWaTable, &waTable);
|
||||
EXPECT_TRUE(memcmp(&requestedWaTable, &refWaTable, sizeof(_WA_TABLE)) == 0);
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -766,113 +766,3 @@ HWTEST_F(WddmWithMockGdiTest, givenOpenSharedHandleWhenZeroAllocationsThenReturn
|
||||
|
||||
EXPECT_EQ(false, ret);
|
||||
}
|
||||
|
||||
TEST(WddmWTest, givenAdapterInfoWhenInitializingThenUpdateFtrTable) {
|
||||
FeatureTable refFeatureTable = {};
|
||||
FeatureTable requestedFeatureTable = {};
|
||||
ADAPTER_INFO adapterInfo = {};
|
||||
memset(&adapterInfo.SkuTable, ~0, sizeof(adapterInfo.SkuTable));
|
||||
Wddm::setupFeatureTableFromAdapterInfo(&requestedFeatureTable, &adapterInfo);
|
||||
|
||||
refFeatureTable.ftrDesktop = true;
|
||||
refFeatureTable.ftrChannelSwizzlingXOREnabled = true;
|
||||
|
||||
refFeatureTable.ftrGtBigDie = true;
|
||||
refFeatureTable.ftrGtMediumDie = true;
|
||||
refFeatureTable.ftrGtSmallDie = true;
|
||||
|
||||
refFeatureTable.ftrGT1 = true;
|
||||
refFeatureTable.ftrGT1_5 = true;
|
||||
refFeatureTable.ftrGT2 = true;
|
||||
refFeatureTable.ftrGT2_5 = true;
|
||||
refFeatureTable.ftrGT3 = true;
|
||||
refFeatureTable.ftrGT4 = true;
|
||||
|
||||
refFeatureTable.ftrIVBM0M1Platform = true;
|
||||
refFeatureTable.ftrSGTPVSKUStrapPresent = true;
|
||||
refFeatureTable.ftrGTA = true;
|
||||
refFeatureTable.ftrGTC = true;
|
||||
refFeatureTable.ftrGTX = true;
|
||||
refFeatureTable.ftr5Slice = true;
|
||||
|
||||
refFeatureTable.ftrGpGpuMidBatchPreempt = true;
|
||||
refFeatureTable.ftrGpGpuThreadGroupLevelPreempt = true;
|
||||
refFeatureTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
|
||||
refFeatureTable.ftrIoMmuPageFaulting = true;
|
||||
refFeatureTable.ftrWddm2Svm = true;
|
||||
refFeatureTable.ftrPooledEuEnabled = true;
|
||||
|
||||
refFeatureTable.ftrResourceStreamer = true;
|
||||
|
||||
refFeatureTable.ftrPPGTT = true;
|
||||
refFeatureTable.ftrSVM = true;
|
||||
refFeatureTable.ftrEDram = true;
|
||||
refFeatureTable.ftrL3IACoherency = true;
|
||||
refFeatureTable.ftrIA32eGfxPTEs = true;
|
||||
|
||||
refFeatureTable.ftr3dMidBatchPreempt = true;
|
||||
refFeatureTable.ftr3dObjectLevelPreempt = true;
|
||||
refFeatureTable.ftrPerCtxtPreemptionGranularityControl = true;
|
||||
|
||||
refFeatureTable.ftrDisplayYTiling = true;
|
||||
refFeatureTable.ftrTranslationTable = true;
|
||||
refFeatureTable.ftrUserModeTranslationTable = true;
|
||||
|
||||
refFeatureTable.ftrEnableGuC = true;
|
||||
|
||||
refFeatureTable.ftrFbc = true;
|
||||
refFeatureTable.ftrFbc2AddressTranslation = true;
|
||||
refFeatureTable.ftrFbcBlitterTracking = true;
|
||||
refFeatureTable.ftrFbcCpuTracking = true;
|
||||
|
||||
refFeatureTable.ftrVcs2 = true;
|
||||
refFeatureTable.ftrVEBOX = true;
|
||||
refFeatureTable.ftrSingleVeboxSlice = true;
|
||||
refFeatureTable.ftrULT = true;
|
||||
refFeatureTable.ftrLCIA = true;
|
||||
refFeatureTable.ftrGttCacheInvalidation = true;
|
||||
refFeatureTable.ftrTileMappedResource = true;
|
||||
refFeatureTable.ftrAstcHdr2D = true;
|
||||
refFeatureTable.ftrAstcLdr2D = true;
|
||||
|
||||
refFeatureTable.ftrStandardMipTailFormat = true;
|
||||
refFeatureTable.ftrFrameBufferLLC = true;
|
||||
refFeatureTable.ftrCrystalwell = true;
|
||||
refFeatureTable.ftrLLCBypass = true;
|
||||
refFeatureTable.ftrDisplayEngineS3d = true;
|
||||
refFeatureTable.ftrVERing = true;
|
||||
refFeatureTable.ftrWddm2GpuMmu = true;
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedFeatureTable, &refFeatureTable, sizeof(FeatureTable)) == 0);
|
||||
}
|
||||
|
||||
TEST(WddmWTest, givenAdapterInfoWhenInitializingThenUpdateWaTable) {
|
||||
WorkaroundTable refWaTable = {};
|
||||
WorkaroundTable requestedWaTable = {};
|
||||
ADAPTER_INFO adapterInfo = {};
|
||||
memset(&adapterInfo.WaTable, ~0, sizeof(adapterInfo.WaTable));
|
||||
Wddm::setupWorkaroundTableFromAdapterInfo(&requestedWaTable, &adapterInfo);
|
||||
|
||||
refWaTable.waDoNotUseMIReportPerfCount = true;
|
||||
|
||||
refWaTable.waEnablePreemptionGranularityControlByUMD = true;
|
||||
refWaTable.waSendMIFLUSHBeforeVFE = true;
|
||||
refWaTable.waReportPerfCountUseGlobalContextID = true;
|
||||
refWaTable.waDisableLSQCROPERFforOCL = true;
|
||||
refWaTable.waMsaa8xTileYDepthPitchAlignment = true;
|
||||
refWaTable.waLosslessCompressionSurfaceStride = true;
|
||||
refWaTable.waFbcLinearSurfaceStride = true;
|
||||
refWaTable.wa4kAlignUVOffsetNV12LinearSurface = true;
|
||||
refWaTable.waEncryptedEdramOnlyPartials = true;
|
||||
refWaTable.waDisableEdramForDisplayRT = true;
|
||||
refWaTable.waForcePcBbFullCfgRestore = true;
|
||||
refWaTable.waCompressedResourceRequiresConstVA21 = true;
|
||||
refWaTable.waDisablePerCtxtPreemptionGranularityControl = true;
|
||||
refWaTable.waLLCCachingUnsupported = true;
|
||||
refWaTable.waUseVAlign16OnTileXYBpp816 = true;
|
||||
refWaTable.waModifyVFEStateAfterGPGPUPreemption = true;
|
||||
refWaTable.waCSRUncachable = true;
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedWaTable, &refWaTable, sizeof(WorkaroundTable)) == 0);
|
||||
}
|
||||
|
||||
33
unit_tests/sku_info/CMakeLists.txt
Normal file
33
unit_tests/sku_info/CMakeLists.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
# Copyright (c) 2018, Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
set(IGDRCL_SRCS_tests_sku_info
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sku_info_base_reference.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}${SKU_INFO_SRCS_DIR_SUFFIX}/sku_info_transfer_tests.cpp"
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND IGDRCL_SRCS_tests_sku_info
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}${SKU_INFO_SRCS_DIR_SUFFIX}/sku_info_receiver_tests.cpp"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(IGDRCL_SRCS_tests_sku_info "${IGDRCL_SRCS_tests_sku_info}" PARENT_SCOPE)
|
||||
149
unit_tests/sku_info/sku_info_base_reference.h
Normal file
149
unit_tests/sku_info/sku_info_base_reference.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "sku_info.h"
|
||||
#include "runtime/gmm_helper/gmm_lib.h"
|
||||
|
||||
namespace OCLRT {
|
||||
struct SkuInfoBaseReference {
|
||||
static void fillReferenceFtrForTransfer(_SKU_FEATURE_TABLE &refFtrTable) {
|
||||
refFtrTable = {};
|
||||
refFtrTable.FtrStandardMipTailFormat = 1;
|
||||
refFtrTable.FtrULT = 1;
|
||||
refFtrTable.FtrEDram = 1;
|
||||
refFtrTable.FtrFrameBufferLLC = 1;
|
||||
refFtrTable.FtrCrystalwell = 1;
|
||||
refFtrTable.FtrDisplayEngineS3d = 1;
|
||||
refFtrTable.FtrDisplayYTiling = 1;
|
||||
refFtrTable.FtrFbc = 1;
|
||||
refFtrTable.FtrVERing = 1;
|
||||
refFtrTable.FtrVcs2 = 1;
|
||||
refFtrTable.FtrLCIA = 1;
|
||||
refFtrTable.FtrIA32eGfxPTEs = 1;
|
||||
refFtrTable.FtrWddm2GpuMmu = 1;
|
||||
}
|
||||
|
||||
static void fillReferenceWaForTransfer(_WA_TABLE &refWaTable) {
|
||||
refWaTable = {};
|
||||
refWaTable.WaFbcLinearSurfaceStride = 1;
|
||||
refWaTable.WaDisableEdramForDisplayRT = 1;
|
||||
refWaTable.WaEncryptedEdramOnlyPartials = 1;
|
||||
}
|
||||
|
||||
static void fillReferenceFtrToReceive(FeatureTable &refFtrTable) {
|
||||
refFtrTable = {};
|
||||
refFtrTable.ftrDesktop = true;
|
||||
refFtrTable.ftrChannelSwizzlingXOREnabled = true;
|
||||
|
||||
refFtrTable.ftrGtBigDie = true;
|
||||
refFtrTable.ftrGtMediumDie = true;
|
||||
refFtrTable.ftrGtSmallDie = true;
|
||||
|
||||
refFtrTable.ftrGT1 = true;
|
||||
refFtrTable.ftrGT1_5 = true;
|
||||
refFtrTable.ftrGT2 = true;
|
||||
refFtrTable.ftrGT2_5 = true;
|
||||
refFtrTable.ftrGT3 = true;
|
||||
refFtrTable.ftrGT4 = true;
|
||||
|
||||
refFtrTable.ftrIVBM0M1Platform = true;
|
||||
refFtrTable.ftrSGTPVSKUStrapPresent = true;
|
||||
refFtrTable.ftrGTA = true;
|
||||
refFtrTable.ftrGTC = true;
|
||||
refFtrTable.ftrGTX = true;
|
||||
refFtrTable.ftr5Slice = true;
|
||||
|
||||
refFtrTable.ftrGpGpuMidBatchPreempt = true;
|
||||
refFtrTable.ftrGpGpuThreadGroupLevelPreempt = true;
|
||||
refFtrTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
|
||||
refFtrTable.ftrIoMmuPageFaulting = true;
|
||||
refFtrTable.ftrWddm2Svm = true;
|
||||
refFtrTable.ftrPooledEuEnabled = true;
|
||||
|
||||
refFtrTable.ftrResourceStreamer = true;
|
||||
|
||||
refFtrTable.ftrPPGTT = true;
|
||||
refFtrTable.ftrSVM = true;
|
||||
refFtrTable.ftrEDram = true;
|
||||
refFtrTable.ftrL3IACoherency = true;
|
||||
refFtrTable.ftrIA32eGfxPTEs = true;
|
||||
|
||||
refFtrTable.ftr3dMidBatchPreempt = true;
|
||||
refFtrTable.ftr3dObjectLevelPreempt = true;
|
||||
refFtrTable.ftrPerCtxtPreemptionGranularityControl = true;
|
||||
|
||||
refFtrTable.ftrDisplayYTiling = true;
|
||||
refFtrTable.ftrTranslationTable = true;
|
||||
refFtrTable.ftrUserModeTranslationTable = true;
|
||||
|
||||
refFtrTable.ftrEnableGuC = true;
|
||||
|
||||
refFtrTable.ftrFbc = true;
|
||||
refFtrTable.ftrFbc2AddressTranslation = true;
|
||||
refFtrTable.ftrFbcBlitterTracking = true;
|
||||
refFtrTable.ftrFbcCpuTracking = true;
|
||||
|
||||
refFtrTable.ftrVcs2 = true;
|
||||
refFtrTable.ftrVEBOX = true;
|
||||
refFtrTable.ftrSingleVeboxSlice = true;
|
||||
refFtrTable.ftrULT = true;
|
||||
refFtrTable.ftrLCIA = true;
|
||||
refFtrTable.ftrGttCacheInvalidation = true;
|
||||
refFtrTable.ftrTileMappedResource = true;
|
||||
refFtrTable.ftrAstcHdr2D = true;
|
||||
refFtrTable.ftrAstcLdr2D = true;
|
||||
|
||||
refFtrTable.ftrStandardMipTailFormat = true;
|
||||
refFtrTable.ftrFrameBufferLLC = true;
|
||||
refFtrTable.ftrCrystalwell = true;
|
||||
refFtrTable.ftrLLCBypass = true;
|
||||
refFtrTable.ftrDisplayEngineS3d = true;
|
||||
refFtrTable.ftrVERing = true;
|
||||
refFtrTable.ftrWddm2GpuMmu = true;
|
||||
}
|
||||
|
||||
static void fillReferenceWaToReceive(WorkaroundTable &refWaTable) {
|
||||
refWaTable = {};
|
||||
refWaTable.waDoNotUseMIReportPerfCount = true;
|
||||
|
||||
refWaTable.waEnablePreemptionGranularityControlByUMD = true;
|
||||
refWaTable.waSendMIFLUSHBeforeVFE = true;
|
||||
refWaTable.waReportPerfCountUseGlobalContextID = true;
|
||||
refWaTable.waDisableLSQCROPERFforOCL = true;
|
||||
refWaTable.waMsaa8xTileYDepthPitchAlignment = true;
|
||||
refWaTable.waLosslessCompressionSurfaceStride = true;
|
||||
refWaTable.waFbcLinearSurfaceStride = true;
|
||||
refWaTable.wa4kAlignUVOffsetNV12LinearSurface = true;
|
||||
refWaTable.waEncryptedEdramOnlyPartials = true;
|
||||
refWaTable.waDisableEdramForDisplayRT = true;
|
||||
refWaTable.waForcePcBbFullCfgRestore = true;
|
||||
refWaTable.waCompressedResourceRequiresConstVA21 = true;
|
||||
refWaTable.waDisablePerCtxtPreemptionGranularityControl = true;
|
||||
refWaTable.waLLCCachingUnsupported = true;
|
||||
refWaTable.waUseVAlign16OnTileXYBpp816 = true;
|
||||
refWaTable.waModifyVFEStateAfterGPGPUPreemption = true;
|
||||
refWaTable.waCSRUncachable = true;
|
||||
}
|
||||
}; // namespace SkuInfoBaseReference
|
||||
} // namespace OCLRT
|
||||
51
unit_tests/sku_info/sku_info_receiver_tests.cpp
Normal file
51
unit_tests/sku_info/sku_info_receiver_tests.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/sku_info/operations/sku_info_receiver.h"
|
||||
#include "unit_tests/sku_info/sku_info_base_reference.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(SkuInfoReceiverTest, givenAdapterInfoWhenReceivingThenUpdateFtrTable) {
|
||||
FeatureTable refFeatureTable = {};
|
||||
FeatureTable requestedFeatureTable = {};
|
||||
ADAPTER_INFO adapterInfo = {};
|
||||
memset(&adapterInfo.SkuTable, ~0, sizeof(adapterInfo.SkuTable));
|
||||
SkuInfoReceiver::receiveFtrTableFromAdapterInfo(&requestedFeatureTable, &adapterInfo);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceFtrToReceive(refFeatureTable);
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedFeatureTable, &refFeatureTable, sizeof(FeatureTable)) == 0);
|
||||
}
|
||||
|
||||
TEST(SkuInfoReceiverTest, givenAdapterInfoWhenReceivingThenUpdateWaTable) {
|
||||
WorkaroundTable refWaTable = {};
|
||||
WorkaroundTable requestedWaTable = {};
|
||||
ADAPTER_INFO adapterInfo = {};
|
||||
memset(&adapterInfo.WaTable, ~0, sizeof(adapterInfo.WaTable));
|
||||
SkuInfoReceiver::receiveWaTableFromAdapterInfo(&requestedWaTable, &adapterInfo);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceWaToReceive(refWaTable);
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedWaTable, &refWaTable, sizeof(WorkaroundTable)) == 0);
|
||||
}
|
||||
51
unit_tests/sku_info/sku_info_transfer_tests.cpp
Normal file
51
unit_tests/sku_info/sku_info_transfer_tests.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/sku_info/operations/sku_info_transfer.h"
|
||||
#include "unit_tests/sku_info/sku_info_base_reference.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(SkuInfoTransferTest, givenFeatureTableWhenFillingStructureForGmmThenCopyOnlySelectedValues) {
|
||||
_SKU_FEATURE_TABLE requestedFtrTable = {};
|
||||
_SKU_FEATURE_TABLE refFtrTable = {};
|
||||
FeatureTable featureTable;
|
||||
memset(&featureTable, 1, sizeof(FeatureTable));
|
||||
SkuInfoTransfer::transferFtrTableForGmm(&requestedFtrTable, &featureTable);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceFtrForTransfer(refFtrTable);
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedFtrTable, &refFtrTable, sizeof(_SKU_FEATURE_TABLE)) == 0);
|
||||
}
|
||||
|
||||
TEST(SkuInfoTransferTest, givenWaTableWhenFillingStructureForGmmThenCopyOnlySelectedValues) {
|
||||
_WA_TABLE requestedWaTable = {};
|
||||
_WA_TABLE refWaTable = {};
|
||||
WorkaroundTable waTable;
|
||||
memset(&waTable, 1, sizeof(WorkaroundTable));
|
||||
SkuInfoTransfer::transferWaTableForGmm(&requestedWaTable, &waTable);
|
||||
|
||||
SkuInfoBaseReference::fillReferenceWaForTransfer(refWaTable);
|
||||
|
||||
EXPECT_TRUE(memcmp(&requestedWaTable, &refWaTable, sizeof(_WA_TABLE)) == 0);
|
||||
}
|
||||
Reference in New Issue
Block a user