mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Enable KMD fallback for User Fence wait call
Related-To: NEO-5845 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6c7ccddae0
commit
ad18099ed8
@@ -76,15 +76,7 @@ int BufferObject::wait(int64_t timeoutNs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_i915_gem_wait wait = {};
|
||||
wait.bo_handle = this->handle;
|
||||
wait.timeout_ns = -1;
|
||||
|
||||
int ret = this->drm->ioctl(DRM_IOCTL_I915_GEM_WAIT, &wait);
|
||||
if (ret != 0) {
|
||||
int err = errno;
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(I915_GEM_WAIT) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
}
|
||||
int ret = this->drm->waitHandle(this->handle, -1);
|
||||
UNRECOVERABLE_IF(ret != 0);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -743,12 +743,18 @@ const std::vector<int> &Drm::getSliceMappings(uint32_t deviceIndex) {
|
||||
return topologyMap[deviceIndex].sliceIndices;
|
||||
}
|
||||
|
||||
int Drm::waitHandle(uint32_t waitHandle) {
|
||||
int Drm::waitHandle(uint32_t waitHandle, int64_t timeout) {
|
||||
drm_i915_gem_wait wait = {};
|
||||
wait.bo_handle = waitHandle;
|
||||
wait.timeout_ns = -1;
|
||||
wait.timeout_ns = timeout;
|
||||
|
||||
return ioctl(DRM_IOCTL_I915_GEM_WAIT, &wait);
|
||||
int ret = ioctl(DRM_IOCTL_I915_GEM_WAIT, &wait);
|
||||
if (ret != 0) {
|
||||
int err = errno;
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(I915_GEM_WAIT) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -204,14 +204,14 @@ class Drm : public DriverModel {
|
||||
uint64_t getNextFenceVal(uint32_t vmHandleId) { return ++fenceVal[vmHandleId]; }
|
||||
uint64_t *getFenceAddr(uint32_t vmHandleId) { return &pagingFence[vmHandleId]; }
|
||||
|
||||
int waitHandle(uint32_t waitHandle);
|
||||
int waitHandle(uint32_t waitHandle, int64_t timeout);
|
||||
enum class ValueWidth : uint32_t {
|
||||
U8,
|
||||
U16,
|
||||
U32,
|
||||
U64
|
||||
};
|
||||
MOCKABLE_VIRTUAL int waitUserFence(uint32_t ctxId, uint64_t address, uint64_t value, ValueWidth dataWidth);
|
||||
MOCKABLE_VIRTUAL int waitUserFence(uint32_t ctxId, uint64_t address, uint64_t value, ValueWidth dataWidth, int64_t timeout);
|
||||
|
||||
void setNewResourceBound(bool value) { this->newResourceBound = value; };
|
||||
bool getNewResourceBound() { return this->newResourceBound; };
|
||||
|
||||
@@ -75,7 +75,7 @@ int Drm::unbindBufferObject(OsContext *osContext, uint32_t vmHandleId, BufferObj
|
||||
void Drm::waitForBind(uint32_t vmHandleId) {
|
||||
}
|
||||
|
||||
int Drm::waitUserFence(uint32_t ctx, uint64_t address, uint64_t value, ValueWidth dataWidth) {
|
||||
int Drm::waitUserFence(uint32_t ctx, uint64_t address, uint64_t value, ValueWidth dataWidth, int64_t timeout) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ int Drm::unbindBufferObject(OsContext *osContext, uint32_t vmHandleId, BufferObj
|
||||
void Drm::waitForBind(uint32_t vmHandleId) {
|
||||
}
|
||||
|
||||
int Drm::waitUserFence(uint32_t ctx, uint64_t address, uint64_t value, ValueWidth dataWidth) {
|
||||
int Drm::waitUserFence(uint32_t ctx, uint64_t address, uint64_t value, ValueWidth dataWidth, int64_t timeout) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user