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
@@ -118,7 +118,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
return blitterDirectSubmission.get() != nullptr;
|
||||
}
|
||||
|
||||
virtual bool isNewResidencyModelActive() { return false; }
|
||||
virtual bool isKmdWaitModeActive() { return true; }
|
||||
|
||||
bool initDirectSubmission(Device &device, OsContext &osContext) override;
|
||||
GraphicsAllocation *getClearColorAllocation() override;
|
||||
|
||||
@@ -843,7 +843,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFal
|
||||
int64_t waitTimeout = 0;
|
||||
bool enableTimeout = false;
|
||||
|
||||
enableTimeout = kmdNotifyHelper->obtainTimeoutParams(waitTimeout, useQuickKmdSleep, *getTagAddress(), taskCountToWait, flushStampToWait, forcePowerSavingMode, this->isNewResidencyModelActive());
|
||||
enableTimeout = kmdNotifyHelper->obtainTimeoutParams(waitTimeout, useQuickKmdSleep, *getTagAddress(), taskCountToWait, flushStampToWait, forcePowerSavingMode, this->isKmdWaitModeActive());
|
||||
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.LogWaitingForCompletion.get(), stdout,
|
||||
"\nWaiting for task count %u at location %p. Current value: %u\n",
|
||||
|
||||
@@ -232,7 +232,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, WaitLoopCount, -1, "-1: use default, >=0: number
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, GTPinAllocateBufferInSharedMemory, -1, "Force GTPin to allocate buffer in shared memory")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, AlignLocalMemoryVaTo2MB, -1, "Allow 2MB pages for allocations with size>=2MB. On Linux it means aligned VA, on Windows it means aligned size. -1: default, 0: disabled, 1: enabled")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceForCompletionWait, -1, "-1: default (disabled), 0: disable, 1: enable : Use Wait User Fence instead Gem Wait")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceUseCtxId, -1, "-1: default (disabled), 0: disable, 1: enable : Use Context Id in Wait User Fence when waiting for completion tag")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceUseCtxId, -1, "-1: default (enabled), 0: disable, 1: enable : Use Context Id in Wait User Fence when waiting for completion tag")
|
||||
|
||||
/*EXPERIMENTAL TOGGLES*/
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ExperimentalEnableCustomLocalMemoryAlignment, 0, "Align local memory allocations to a given value. Works only with allocations at least as big as the value. 0: no effect, 2097152: 2 megabytes, 1073741824: 1 gigabyte")
|
||||
|
||||
@@ -19,12 +19,12 @@ bool KmdNotifyHelper::obtainTimeoutParams(int64_t &timeoutValueOutput,
|
||||
uint32_t taskCountToWait,
|
||||
FlushStamp flushStampToWait,
|
||||
bool forcePowerSavingMode,
|
||||
bool newResidencyModelActive) {
|
||||
bool kmdWaitModeActive) {
|
||||
if (flushStampToWait == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newResidencyModelActive) {
|
||||
if (!kmdWaitModeActive) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class KmdNotifyHelper {
|
||||
uint32_t taskCountToWait,
|
||||
FlushStamp flushStampToWait,
|
||||
bool forcePowerSavingMode,
|
||||
bool newResidencyModelActive);
|
||||
bool kmdWaitModeActive);
|
||||
|
||||
bool quickKmdSleepForSporadicWaitsEnabled() const { return properties->enableQuickKmdSleepForSporadicWaits; }
|
||||
MOCKABLE_VIRTUAL void updateLastWaitForCompletionTimestamp();
|
||||
|
||||
@@ -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