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
这个提交包含在:
Saleel Kudchadker 于 2024-04-08 15:42:52 -04:00 提交
1 父节点 dbac2976e4
当前提交 3f0bcf7834
4 个文件已更改
+15 -2

没有与搜索条件相匹配的文件

+5 -1
查看文件
@@ -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