SWDEV-301667 - Fix SDMA mask reuse

If we are using the mask returned by getLastUsedSdmaEngine() then we
need to apply the SDMA Read/Write mask to it before using with HSA
copy_on_engine API.

Change-Id: I6e5dc6c187eeb3c61ee159e9d2a0fa7b4737c06e
This commit is contained in:
Saleel Kudchadker committed 2024-04-08 15:42:52 -04:00
1 parent dbac2976e4
commit 3f0bcf7834
4 files changed
+15 -2

No files matched your search

+5 -1
View File
@@ -33,7 +33,9 @@ DmaBlitManager::DmaBlitManager(VirtualGPU& gpu, Setup setup)
MinSizeForPinnedTransfer(dev().settings().pinnedMinXferSize_),
completeOperation_(false),
context_(nullptr),
sdmaEngineRetainCount_(0) {}
sdmaEngineRetainCount_(0) {
dev().getSdmaRWMasks(&sdmaEngineReadMask_, &sdmaEngineWriteMask_);
}
inline void DmaBlitManager::synchronize() const {
if (syncOperation_) {
@@ -731,6 +733,8 @@ bool DmaBlitManager::hsaCopy(const Memory& srcMemory, const Memory& dstMemory,
// Check if there a recently used SDMA engine for the stream
copyMask = gpu().getLastUsedSdmaEngine();
ClPrint(amd::LOG_DEBUG, amd::LOG_COPY, "Last copy mask 0x%x", copyMask);
copyMask &= (engine == HwQueueEngine::SdmaRead ?
sdmaEngineReadMask_ : sdmaEngineWriteMask_);
}
if (copyMask == 0) {
// Check SDMA engine status