mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
performance: override for driver protection bits
Add infrastructure to override usage in getDriverProtectionBits. Related-To: NEO-14482 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
00620f07c0
commit
be04b6f172
@@ -36,7 +36,7 @@ class GmmResourceInfo : NonCopyableAndNonMovableClass {
|
||||
|
||||
MOCKABLE_VIRTUAL size_t getRenderPitch() { return static_cast<size_t>(resourceInfo->GetRenderPitch()); }
|
||||
|
||||
MOCKABLE_VIRTUAL uint64_t getDriverProtectionBits();
|
||||
MOCKABLE_VIRTUAL uint64_t getDriverProtectionBits(bool overrideUsage, uint32_t usage);
|
||||
|
||||
MOCKABLE_VIRTUAL uint32_t getNumSamples() { return resourceInfo->GetNumSamples(); }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits() {
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits(bool overrideUsage, uint32_t usage) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits() {
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits(bool overrideUsage, uint32_t usage) {
|
||||
GMM_OVERRIDE_VALUES overrideValues{};
|
||||
if (overrideUsage) {
|
||||
overrideValues.Usage = usage;
|
||||
}
|
||||
return static_cast<uint64_t>(resourceInfo->GetDriverProtectionBits(overrideValues));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits() {
|
||||
uint64_t GmmResourceInfo::getDriverProtectionBits(bool overrideUsage, uint32_t usage) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -33,7 +33,11 @@ class MockGmmResourceInfo : public GmmResourceInfo {
|
||||
|
||||
size_t getRenderPitch() override { return rowPitch; }
|
||||
|
||||
uint64_t getDriverProtectionBits() override { return driverProtectionBits; }
|
||||
uint64_t getDriverProtectionBits(bool overrideUsage, uint32_t usage) override {
|
||||
driverProtectionBitsUsageWasOverriden = overrideUsage;
|
||||
driverProtectionBitsUsageOverride = usage;
|
||||
return driverProtectionBits;
|
||||
}
|
||||
|
||||
uint32_t getNumSamples() override { return mockResourceCreateParams.MSAA.NumSamples; }
|
||||
|
||||
@@ -116,6 +120,8 @@ class MockGmmResourceInfo : public GmmResourceInfo {
|
||||
using GmmResourceInfo::decodeResourceInfo;
|
||||
|
||||
uint64_t driverProtectionBits = 0;
|
||||
bool driverProtectionBitsUsageWasOverriden = false;
|
||||
uint32_t driverProtectionBitsUsageOverride = 0u;
|
||||
uint32_t getOffsetCalled = 0u;
|
||||
uint32_t arrayIndexPassedToGetOffset = 0;
|
||||
SurfaceFormatInfo tempSurface{};
|
||||
|
||||
Reference in New Issue
Block a user