refactor: decouple ClosCacheReservation from Drm

The dependency towards `Drm` is unnecessary and only makes testing more
difficult. Instead, dependency towards `IoctlHelper` alone only is
sufficient.

Related-To: NEO-10158
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
Maciej Bielski
2024-07-30 17:53:09 +00:00
committed by Compute-Runtime-Automation
parent 1f79f867e6
commit 790bb84841
10 changed files with 32 additions and 34 deletions

View File

@@ -979,7 +979,7 @@ void Drm::setupCacheInfo(const HardwareInfo &hwInfo) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
if (debugManager.flags.ClosEnabled.get() == 0 || gfxCoreHelper.getNumCacheRegions() == 0) {
this->cacheInfo.reset(new CacheInfo(*this, 0, 0, 0));
this->cacheInfo.reset(new CacheInfo{*ioctlHelper, 0, 0, 0});
return;
}
@@ -993,7 +993,7 @@ void Drm::setupCacheInfo(const HardwareInfo &hwInfo) {
const size_t maxReservationCacheSize = (totalCacheSize * maxReservationNumWays) / maxNumWays;
const uint32_t maxReservationNumCacheRegions = gfxCoreHelper.getNumCacheRegions() - 1;
this->cacheInfo.reset(new CacheInfo(*this, maxReservationCacheSize, maxReservationNumCacheRegions, maxReservationNumWays));
this->cacheInfo.reset(new CacheInfo(*ioctlHelper, maxReservationCacheSize, maxReservationNumCacheRegions, maxReservationNumWays));
}
void Drm::getPrelimVersion(std::string &prelimVersion) {