From d893fa673090dc8d956d43d8bdc0509ce8c6ef50 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 18 Jul 2019 14:57:53 -0400
Subject: [PATCH] P4 to Git Change 1969954 by gandryey@gera-win10 on 2019/07/18
14:55:51
SWDEV-196199 - [Navi10] Corruption is observed when running Premier Pro Benchmarks using Adobe Premier Pro 2019
- In addition to CL#1968527. Add an extra transfer in the case the app reads image without kernel execution
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#139 edit
[ROCm/clr commit: b9897c0ba935e23257c84a7a99842a217ff384b5]
---
projects/clr/rocclr/runtime/device/pal/palvirtual.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
index ab6421822a..9513dbec68 100644
--- a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
@@ -1108,8 +1108,17 @@ void VirtualGPU::submitReadMemory(amd::ReadMemoryCommand& vcmd) {
if (memory->memoryType() == Resource::ImageBuffer) {
Image* imageBuffer = static_cast(memory);
// Check if synchronization has to be performed
- if (imageBuffer->CopyImageBuffer() != nullptr) {
+ if (nullptr != imageBuffer->CopyImageBuffer()) {
memory = imageBuffer->CopyImageBuffer();
+ if (nullptr == imageBuffer->owner()->getLastWriter()) {
+ Memory* buffer = dev().getGpuMemory(imageBuffer->owner()->parent());
+ amd::Image* image = imageBuffer->owner()->asImage();
+ amd::Coord3D offs(0);
+ // Copy memory from the original image buffer into the backing store image
+ result = blitMgr().copyBufferToImage(*buffer, *imageBuffer->CopyImageBuffer(),
+ offs, offs, image->getRegion(), true,
+ image->getRowPitch(), image->getSlicePitch());
+ }
}
}
if (hostMemory != nullptr) {