To fix sdma segment fault for error address

pad_size address shall start from command_addr not
(command_addr + total_command_size)

Change-Id: I3d8491986caf2d4d5dc41b1d90286c21e7c0a457


[ROCm/ROCR-Runtime commit: 4b69351394]
This commit is contained in:
Ruili Ji
2023-12-23 14:43:51 +08:00
والد 816b46868a
کامیت ff2c3dfcca
@@ -471,6 +471,7 @@ hsa_status_t BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset, useGCR>:
wrapped_index += fence_command_size_;
BuildTrapCommand(command_addr, out_signal.signal_.event_id);
command_addr += trap_command_size_;
bytes_written_[wrapped_index] = post_bytes;
wrapped_index += trap_command_size_;
}
@@ -481,7 +482,7 @@ hsa_status_t BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset, useGCR>:
if (pad_size) {
memset(command_addr, 0, pad_size);
uint32_t *dword_command_addr = reinterpret_cast<uint32_t*>(command_addr);
dword_command_addr[total_command_size/4] = (pad_size/4 - 1) << 16;
dword_command_addr[0] = (pad_size/4 - 1) << 16;
}
ReleaseWriteAddress(curr_index, total_command_size + pad_size);