SWDEV-283981 - Revert "SWDEV-283981 - [PAL] Support hostcall SQ interrupt"
This reverts commit 9df70fa03ce60d47247eb0e8f278e1f8dbd33d6e.
Reason for revert: need SWDEV-294782 to be resolved before we can enable SQ interrupt support.
Change-Id: I328170b60f1a3aab28c0b1fd3191297a1a51ecb7
[ROCm/clr commit: 6566361144]
This commit is contained in:
committad av
Maneesh Gupta
förälder
d65375bbc9
incheckning
9b02e5baa4
@@ -335,10 +335,10 @@ void HostcallListener::removeBuffer(HostcallBuffer* buffer) {
|
||||
|
||||
bool HostcallListener::initialize(const amd::Device &dev) {
|
||||
doorbell_ = dev.createSignal();
|
||||
#if defined(WITH_PAL_DEVICE) && !defined(_WIN32)
|
||||
auto ws = device::Signal::WaitState::Active;
|
||||
#else
|
||||
#ifdef WITH_HSA_DEVICE
|
||||
auto ws = device::Signal::WaitState::Blocked;
|
||||
#else
|
||||
auto ws = device::Signal::WaitState::Active;
|
||||
#endif
|
||||
if ((doorbell_ == nullptr) || !doorbell_->Init(dev, SIGNAL_INIT, ws)) {
|
||||
return false;
|
||||
|
||||
@@ -29,21 +29,6 @@ namespace pal {
|
||||
|
||||
Signal::~Signal() {
|
||||
dev_->context().svmFree(amdSignal_);
|
||||
|
||||
if (ws_ == device::Signal::WaitState::Blocked) {
|
||||
#if defined(_WIN32)
|
||||
Pal::Result result = Pal::Result::Success;
|
||||
|
||||
Pal::UnregisterEventInfo eventInfo = {};
|
||||
eventInfo.pEvent = &event_;
|
||||
eventInfo.trackingType = Pal::EventTrackingType::ShaderInterrupt;
|
||||
result = dev_->iDev()->UnregisterEvent(eventInfo);
|
||||
if (result != Pal::Result::Success) {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE,
|
||||
"Failed to unregister SQ event needed for hostcall buffer");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool Signal::Init(const amd::Device& dev, uint64_t init, device::Signal::WaitState ws) {
|
||||
@@ -62,47 +47,6 @@ bool Signal::Init(const amd::Device& dev, uint64_t init, device::Signal::WaitSta
|
||||
amdSignal_ = new (buffer) amd_signal_t();
|
||||
amdSignal_->value = init;
|
||||
|
||||
if (ws_ == device::Signal::WaitState::Blocked) {
|
||||
#if defined(_WIN32)
|
||||
Pal::Result result = Pal::Result::Success;
|
||||
|
||||
Util::EventCreateFlags flags = {};
|
||||
flags.manualReset = false;
|
||||
flags.initiallySignaled = false;
|
||||
result = event_.Init(flags);
|
||||
if (result != Pal::Result::Success) {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE,
|
||||
"Failed to create Pal::Util::Event needed for hostcall buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
result = event_.Set();
|
||||
if (result != Pal::Result::Success) {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE,
|
||||
"Failed to set Pal::Util::Event needed for hostcall buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
Pal::RegisterEventInfo eventInputInfo = {};
|
||||
eventInputInfo.pEvent = &event_;
|
||||
eventInputInfo.trackingType = Pal::EventTrackingType::ShaderInterrupt;
|
||||
Pal::RegisterEventOutputInfo eventOutputInfo = {};
|
||||
result = dev_->iDev()->RegisterEvent(
|
||||
eventInputInfo,
|
||||
&eventOutputInfo);
|
||||
if (result != Pal::Result::Success) {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE,
|
||||
"Failed to register SQ event needed for hostcall buffer");
|
||||
return false;
|
||||
}
|
||||
amdSignal_->event_id = eventOutputInfo.shaderInterrupt.eventId;
|
||||
amdSignal_->event_mailbox_ptr = eventOutputInfo.shaderInterrupt.eventMailboxGpuVa;
|
||||
ClPrint(amd::LOG_INFO, amd::LOG_INIT,
|
||||
"Registered SQ event %d with mailbox slot %p",
|
||||
amdSignal_->event_id, amdSignal_->event_mailbox_ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,19 +67,7 @@ uint64_t Signal::Wait(uint64_t value, device::Signal::Condition c, uint64_t time
|
||||
} (c);
|
||||
|
||||
if (ws_ == device::Signal::WaitState::Blocked) {
|
||||
#if defined(_WIN32)
|
||||
Pal::Result result = Pal::Result::Success;
|
||||
|
||||
float timeoutInSec = timeout / (1000 * 1000);
|
||||
result = event_.Wait(timeoutInSec);
|
||||
|
||||
if (result != Pal::Result::Success) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::atomic_thread_fence(std::memory_order_acquire);
|
||||
return amdSignal_->value;
|
||||
#endif
|
||||
guarantee(false, "Unimplemented");
|
||||
} else if (ws_ == device::Signal::WaitState::Active) {
|
||||
auto start = amd::Os::timeNanos();
|
||||
while (true) {
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include <amd_hsa_signal.h>
|
||||
|
||||
#include "palEvent.h"
|
||||
|
||||
namespace pal {
|
||||
|
||||
class Device;
|
||||
@@ -34,7 +32,6 @@ class Signal: public device::Signal {
|
||||
private:
|
||||
const Device* dev_;
|
||||
amd_signal_t* amdSignal_;
|
||||
Util::Event event_;
|
||||
|
||||
public:
|
||||
~Signal() override;
|
||||
|
||||
Referens i nytt ärende
Block a user