Revert "Remove tlb flush from CCS"

This reverts commit 797f56bed4.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation 2022-12-23 10:53:47 +01:00 committed by Compute-Runtime-Automation
parent 3cfc8a0b68
commit 5652edb92f
4 changed files with 7 additions and 6 deletions

View File

@ -162,7 +162,7 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::handleResidency() {
template <typename GfxFamily, typename Dispatcher>
bool DrmDirectSubmission<GfxFamily, Dispatcher>::isNewResourceHandleNeeded() {
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
auto newResourcesBound = EngineHelpers::isBcs(osContextLinux->getEngineType()) && osContextLinux->isTlbFlushRequired();
auto newResourcesBound = osContextLinux->isTlbFlushRequired();
if (DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get() != -1) {
newResourcesBound = DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get();

View File

@ -659,7 +659,7 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
for (const auto &engine : engines) {
if (engine.osContext->getDeviceBitfield().test(vmHandleId) && EngineHelpers::isBcs(engine.osContext->getEngineType())) {
if (engine.osContext->getDeviceBitfield().test(vmHandleId)) {
auto osContextLinux = static_cast<OsContextLinux *>(engine.osContext);
if (&osContextLinux->getDrm() == this) {

View File

@ -584,8 +584,9 @@ HWTEST_F(DrmDirectSubmissionTest, givenNewResourceBoundWhenDispatchCommandBuffer
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, 0);
hwParse.findHardwareCommands<FamilyType>();
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>();
EXPECT_EQ(pipeControl, nullptr);
EXPECT_TRUE(osContext->isTlbFlushRequired());
EXPECT_TRUE(pipeControl->getTlbInvalidate());
EXPECT_TRUE(pipeControl->getTextureCacheInvalidationEnable());
EXPECT_FALSE(osContext->isTlbFlushRequired());
EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL));
}

View File

@ -121,7 +121,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun
for (const auto &engine : device->getAllEngines()) {
auto osContexLinux = static_cast<MockOsContextLinux *>(engine.osContext);
if (osContexLinux->getDeviceBitfield().test(1u) && EngineHelpers::isBcs(osContexLinux->getEngineType())) {
if (osContexLinux->getDeviceBitfield().test(1u)) {
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
} else {
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
@ -139,7 +139,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun
for (const auto &engine : devices[1]->getAllEngines()) {
auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext);
if (osContexLinux->getDeviceBitfield().test(0u) && EngineHelpers::isBcs(osContexLinux->getEngineType())) {
if (osContexLinux->getDeviceBitfield().test(0u)) {
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
} else {
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());