Use bind fence atomically

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2021-08-09 14:33:44 +00:00 committed by Compute-Runtime-Automation
parent 0845a3b34b
commit 81609c7695
2 changed files with 7 additions and 0 deletions

View File

@ -420,6 +420,10 @@ int Drm::queryVmId(uint32_t drmContextId, uint32_t &vmId) {
return retVal;
}
std::unique_lock<std::mutex> Drm::lockBindFenceMutex() {
return std::unique_lock<std::mutex>(this->bindFenceMutex);
}
int Drm::getEuTotal(int &euTotal) {
return getParamIoctl(I915_PARAM_EU_TOTAL, &euTotal);
}

View File

@ -230,6 +230,8 @@ class Drm : public DriverModel {
static std::vector<std::unique_ptr<HwDeviceId>> discoverDevices(ExecutionEnvironment &executionEnvironment);
std::unique_lock<std::mutex> lockBindFenceMutex();
protected:
Drm(std::unique_ptr<HwDeviceIdDrm> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment);
@ -275,6 +277,7 @@ class Drm : public DriverModel {
TopologyMap topologyMap;
std::unordered_map<unsigned long, std::pair<long long, uint64_t>> ioctlStatistics;
std::mutex bindFenceMutex;
std::array<uint64_t, EngineLimits::maxHandleCount> pagingFence;
std::array<uint64_t, EngineLimits::maxHandleCount> fenceVal;
StackVec<uint32_t, size_t(ResourceClass::MaxSize)> classHandles;