mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Revert "I915_EXEC_DATA_PORT_COHERENT support"
This reverts commit 933312e098.
Change-Id: I70a48a80c5d06455570dc2a97b99e1fb5edd7c08
This commit is contained in:
committed by
sys_ocldev
parent
656fc9beff
commit
5389d4d859
@@ -81,7 +81,6 @@ class DrmMockCustom : public Drm {
|
||||
IoctlResExt(int32_t no, int32_t res) : no(no), res(res) {}
|
||||
};
|
||||
void overideCoherencyPatchActive(bool newCoherencyPatchActiveValue) { coherencyDisablePatchActive = newCoherencyPatchActiveValue; }
|
||||
void overideDataPortCoherencyPatchActive(bool newValue) { dataPortCoherencyPatchActive = newValue; }
|
||||
|
||||
class Ioctls {
|
||||
public:
|
||||
|
||||
@@ -110,36 +110,6 @@ TEST_F(DrmBufferObjectTest, givenDrmWithCoherencyPatchActiveWhenExecIsCalledWith
|
||||
EXPECT_EQ(expectedFlag, currentFlag);
|
||||
}
|
||||
|
||||
TEST_F(DrmBufferObjectTest, givenDrmWithDataPortCoherencyPatchActiveWhenExecWithCoherencyRequestCalledThenSetExecFlag) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
mock->ioctl_res = 0;
|
||||
mock->overideDataPortCoherencyPatchActive(true);
|
||||
|
||||
auto ret = bo->exec(0, 0, 0, true);
|
||||
EXPECT_EQ(mock->ioctl_res, ret);
|
||||
EXPECT_NE(0u, mock->execBuffer.flags & I915_EXEC_DATA_PORT_COHERENT);
|
||||
}
|
||||
|
||||
TEST_F(DrmBufferObjectTest, givenDrmWithoutDataPortCoherencyPatchActiveWhenExecWithCoherencyRequestCalledThenDontSetExecFlag) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
mock->ioctl_res = 0;
|
||||
mock->overideDataPortCoherencyPatchActive(false);
|
||||
|
||||
auto ret = bo->exec(0, 0, 0, true);
|
||||
EXPECT_EQ(mock->ioctl_res, ret);
|
||||
EXPECT_EQ(0u, mock->execBuffer.flags & I915_EXEC_DATA_PORT_COHERENT);
|
||||
}
|
||||
|
||||
TEST_F(DrmBufferObjectTest, givenDrmWithDataPortCoherencyPatchActiveWhenExecWithoutCoherencyRequestCalledThenDontSetExecFlag) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
mock->ioctl_res = 0;
|
||||
mock->overideDataPortCoherencyPatchActive(true);
|
||||
|
||||
auto ret = bo->exec(0, 0, 0, false);
|
||||
EXPECT_EQ(mock->ioctl_res, ret);
|
||||
EXPECT_EQ(0u, mock->execBuffer.flags & I915_EXEC_DATA_PORT_COHERENT);
|
||||
}
|
||||
|
||||
TEST_F(DrmBufferObjectTest, exec_ioctlFailed) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
mock->ioctl_res = -1;
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "unit_tests/os_interface/linux/drm_mock.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
#include "runtime/os_interface/os_interface.h"
|
||||
#include <fstream>
|
||||
@@ -181,50 +180,6 @@ TEST(DrmTest, GivenMockDrmWhenAskedFor48BitAddressCorrectValueReturned) {
|
||||
delete pDrm;
|
||||
}
|
||||
|
||||
ACTION_P2(saveGetParamData, saveParamPtr, forceReturnValuePtr) {
|
||||
auto getParamArg = static_cast<drm_i915_getparam_t *>(arg1);
|
||||
*saveParamPtr = getParamArg->param;
|
||||
*getParamArg->value = forceReturnValuePtr;
|
||||
}
|
||||
struct DrmDataPortCoherencyTests : public ::testing::Test {
|
||||
struct MyMockDrm : public Drm2 {
|
||||
MyMockDrm() : Drm2(){};
|
||||
MOCK_METHOD2(ioctl, int(unsigned long request, void *arg));
|
||||
} drm;
|
||||
|
||||
void setupExpectCall(int expectedRetVal, int expectedGetParamValue) {
|
||||
using namespace ::testing;
|
||||
auto saveAndReturnAction = DoAll(saveGetParamData(&receivedGetParamType, expectedGetParamValue),
|
||||
Return(expectedRetVal));
|
||||
EXPECT_CALL(drm, ioctl(DRM_IOCTL_I915_GETPARAM, _)).Times(1).WillOnce(saveAndReturnAction);
|
||||
}
|
||||
int receivedGetParamType = 0;
|
||||
};
|
||||
|
||||
TEST_F(DrmDataPortCoherencyTests, givenDisabledPatchWhenAskedToObtainDataPortCoherencyPatchThenReturnFlase) {
|
||||
setupExpectCall(1, 0); // return error == 1, dont care about assigned feature value
|
||||
drm.obtainDataPortCoherencyPatchActive();
|
||||
|
||||
EXPECT_EQ(receivedGetParamType, I915_PARAM_HAS_EXEC_DATA_PORT_COHERENCY);
|
||||
EXPECT_FALSE(drm.peekDataPortCoherencyPatchActive());
|
||||
}
|
||||
|
||||
TEST_F(DrmDataPortCoherencyTests, givenEnabledPatchAndDisabledFeatureWhenAskedToObtainDataPortCoherencyPatchThenReturnFlase) {
|
||||
setupExpectCall(0, 0); // return success(0), set disabled feature (0)
|
||||
drm.obtainDataPortCoherencyPatchActive();
|
||||
|
||||
EXPECT_EQ(receivedGetParamType, I915_PARAM_HAS_EXEC_DATA_PORT_COHERENCY);
|
||||
EXPECT_FALSE(drm.peekDataPortCoherencyPatchActive());
|
||||
}
|
||||
|
||||
TEST_F(DrmDataPortCoherencyTests, givenEnabledPatchAndEnabledFeatureWhenAskedToObtainDataPortCoherencyPatchThenReturnTrue) {
|
||||
setupExpectCall(0, 1); // return success(0), set enabled feature (1)
|
||||
drm.obtainDataPortCoherencyPatchActive();
|
||||
|
||||
EXPECT_EQ(receivedGetParamType, I915_PARAM_HAS_EXEC_DATA_PORT_COHERENCY);
|
||||
EXPECT_TRUE(drm.peekDataPortCoherencyPatchActive());
|
||||
}
|
||||
|
||||
#if defined(I915_PARAM_HAS_PREEMPTION)
|
||||
TEST(DrmTest, GivenMockDrmWhenAskedForPreemptionCorrectValueReturned) {
|
||||
Drm2 *pDrm = new Drm2;
|
||||
|
||||
@@ -358,14 +358,4 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenPointerToHwInfoWhenConfigureHwInfoCalled
|
||||
int ret = hwConfig.configureHwInfo(pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(outHwInfo.pSysInfo->CsrSizeInMb * MemoryConstants::megaByte, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
|
||||
}
|
||||
|
||||
TEST_F(HwInfoConfigTestLinuxDummy, whenAskedToConfigureHwInfoThenObtainDataPortCoherencyPatchStatus) {
|
||||
struct MyDrm : public Drm2 {
|
||||
void obtainDataPortCoherencyPatchActive() override { obtainDataPortCoherencyPatchActiveCalled = true; }
|
||||
bool obtainDataPortCoherencyPatchActiveCalled = false;
|
||||
} myDrm;
|
||||
osInterface->get()->setDrm(&myDrm);
|
||||
hwConfig.configureHwInfo(pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_TRUE(myDrm.obtainDataPortCoherencyPatchActiveCalled);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user