mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Linux dll tests: test turbo patch only on supported platforms
use deviceId from first entry in deviceDescriptorTable as default deviceId correct using simplified mocs table Change-Id: I3a6e7cd599912380d48937767f201b44ee98e391
This commit is contained in:
committed by
sys_ocldev
parent
c2368739ce
commit
08faa004aa
@@ -210,7 +210,7 @@ Drm *Drm::create(int32_t deviceOrdinal) {
|
|||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
//turbo patch not present, we are not on custom Kernel, switch to simplified Mocs selection
|
//turbo patch not present, we are not on custom Kernel, switch to simplified Mocs selection
|
||||||
//do this only for GEN9+
|
//do this only for GEN9+
|
||||||
if (eGtType >= GTTYPE_GTA) {
|
if (device->pHwInfo->pPlatform->eRenderCoreFamily >= IGFX_GEN9_CORE) {
|
||||||
Gmm::useSimplifiedMocsTable = true;
|
Gmm::useSimplifiedMocsTable = true;
|
||||||
}
|
}
|
||||||
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
|
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ TEST_F(DrmNullDeviceTests, GIVENdrmNullDeviceWHENcallGetDeviceIdTHENreturnProper
|
|||||||
int deviceId = 0;
|
int deviceId = 0;
|
||||||
int ret = drmNullDevice->getDeviceID(deviceId);
|
int ret = drmNullDevice->getDeviceID(deviceId);
|
||||||
EXPECT_EQ(0, ret);
|
EXPECT_EQ(0, ret);
|
||||||
EXPECT_EQ(0x1916, deviceId);
|
EXPECT_EQ(deviceDescriptorTable[0].deviceId, deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DrmNullDeviceTests, GIVENdrmNullDeviceWHENcallIoctlTHENalwaysSuccess) {
|
TEST_F(DrmNullDeviceTests, GIVENdrmNullDeviceWHENcallIoctlTHENalwaysSuccess) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "runtime/helpers/basic_math.h"
|
#include "runtime/helpers/basic_math.h"
|
||||||
#include "runtime/os_interface/linux/allocator_helper.h"
|
#include "runtime/os_interface/linux/allocator_helper.h"
|
||||||
#include "unit_tests/custom_event_listener.h"
|
#include "unit_tests/custom_event_listener.h"
|
||||||
|
#include "unit_tests/helpers/variable_backup.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
using namespace OCLRT;
|
using namespace OCLRT;
|
||||||
@@ -199,6 +200,7 @@ TEST_F(DrmTests, failOnSoftPin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DrmTests, failOnParamBoost) {
|
TEST_F(DrmTests, failOnParamBoost) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
failOnParamBoost = -1;
|
failOnParamBoost = -1;
|
||||||
|
|
||||||
auto ptr = DrmWrap::createDrm(0);
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
@@ -206,23 +208,73 @@ TEST_F(DrmTests, failOnParamBoost) {
|
|||||||
EXPECT_NE(ptr, nullptr);
|
EXPECT_NE(ptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenDeviceLowerThenGen9IsCreatedThenSimplifiedMocsSelectionIsFalse) {
|
#ifdef SUPPORT_BDW
|
||||||
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenBdwDeviceIsCreatedThenSimplifiedMocsSelectionIsFalse) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
deviceId = IBDW_GT3_WRK_DEVICE_F0_ID;
|
deviceId = IBDW_GT3_WRK_DEVICE_F0_ID;
|
||||||
failOnParamBoost = -1;
|
failOnParamBoost = -1;
|
||||||
auto ptr = DrmWrap::createDrm(0);
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
EXPECT_NE(ptr, nullptr);
|
EXPECT_NE(ptr, nullptr);
|
||||||
EXPECT_FALSE(Gmm::useSimplifiedMocsTable);
|
EXPECT_FALSE(Gmm::useSimplifiedMocsTable);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenDeviceIsNewerThenGen9IsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
#ifdef SUPPORT_SKL
|
||||||
Gmm::useSimplifiedMocsTable = false;
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenSklDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
|
deviceId = ISKL_GT2_DT_DEVICE_F0_ID;
|
||||||
|
failOnParamBoost = -1;
|
||||||
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
|
EXPECT_NE(ptr, nullptr);
|
||||||
|
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_KBL
|
||||||
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenKblDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
|
deviceId = IKBL_GT1_ULT_DEVICE_F0_ID;
|
||||||
|
failOnParamBoost = -1;
|
||||||
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
|
EXPECT_NE(ptr, nullptr);
|
||||||
|
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_BXT
|
||||||
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenBxtDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
deviceId = IBXT_X_DEVICE_F0_ID;
|
deviceId = IBXT_X_DEVICE_F0_ID;
|
||||||
failOnParamBoost = -1;
|
failOnParamBoost = -1;
|
||||||
auto ptr = DrmWrap::createDrm(0);
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
EXPECT_NE(ptr, nullptr);
|
EXPECT_NE(ptr, nullptr);
|
||||||
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
||||||
Gmm::useSimplifiedMocsTable = false;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_GLK
|
||||||
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenGlkDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
|
deviceId = IGLK_GT2_ULT_18EU_DEVICE_F0_ID;
|
||||||
|
failOnParamBoost = -1;
|
||||||
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
|
EXPECT_NE(ptr, nullptr);
|
||||||
|
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_CFL
|
||||||
|
TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenCflDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) {
|
||||||
|
VariableBackup<bool> useSimplifiedMocsTableBckp(&Gmm::useSimplifiedMocsTable);
|
||||||
|
useSimplifiedMocsTableBckp = false;
|
||||||
|
deviceId = ICFL_GT1_S61_DT_DEVICE_F0_ID;
|
||||||
|
failOnParamBoost = -1;
|
||||||
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
|
EXPECT_NE(ptr, nullptr);
|
||||||
|
EXPECT_TRUE(Gmm::useSimplifiedMocsTable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_F(DrmTests, givenKernelSupportingTurboPatchWhenDeviceIsCreatedThenSimplifiedMocsSelectionIsFalse) {
|
TEST_F(DrmTests, givenKernelSupportingTurboPatchWhenDeviceIsCreatedThenSimplifiedMocsSelectionIsFalse) {
|
||||||
auto ptr = DrmWrap::createDrm(0);
|
auto ptr = DrmWrap::createDrm(0);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Intel Corporation
|
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -23,15 +23,14 @@
|
|||||||
#include "mock_os_layer.h"
|
#include "mock_os_layer.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
const char *devDri[2] = {"/dev/dri/renderD128", "/dev/dri/card0"};
|
const char *devDri[2] = {"/dev/dri/renderD128", "/dev/dri/card0"};
|
||||||
|
|
||||||
int (*c_open)(const char *pathname, int flags, ...) = nullptr;
|
int (*c_open)(const char *pathname, int flags, ...) = nullptr;
|
||||||
int (*c_ioctl)(int fd, unsigned long int request, ...) = nullptr;
|
int (*c_ioctl)(int fd, unsigned long int request, ...) = nullptr;
|
||||||
|
|
||||||
int fakeFd = 1023;
|
int fakeFd = 1023;
|
||||||
int haveDri = 0; // index of dri to serve, -1 - none
|
int haveDri = 0; // index of dri to serve, -1 - none
|
||||||
int deviceId = 0x1916; // known DeviceID
|
int deviceId = OCLRT::deviceDescriptorTable[0].deviceId; // default supported DeviceID
|
||||||
int haveSoftPin = 1;
|
int haveSoftPin = 1;
|
||||||
int havePreemption = 1;
|
int havePreemption = 1;
|
||||||
int failOnDeviceId = 0;
|
int failOnDeviceId = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Intel Corporation
|
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -63,7 +63,7 @@ extern std::array<OCLRT::Drm *, 1> drms;
|
|||||||
inline void resetOSMockGlobalState() {
|
inline void resetOSMockGlobalState() {
|
||||||
fakeFd = 1023;
|
fakeFd = 1023;
|
||||||
haveDri = 0;
|
haveDri = 0;
|
||||||
deviceId = 0x1916;
|
deviceId = OCLRT::deviceDescriptorTable[0].deviceId;
|
||||||
haveSoftPin = 1;
|
haveSoftPin = 1;
|
||||||
failOnDeviceId = 0;
|
failOnDeviceId = 0;
|
||||||
failOnRevisionId = 0;
|
failOnRevisionId = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user