From e0c4654f3ed973020585f1fc6826c87a7ccb17b7 Mon Sep 17 00:00:00 2001 From: Alex Xie Date: Sun, 28 Mar 2021 21:55:11 -0400 Subject: [PATCH] SWDEV-268914 - Linux, AMF, tests fail to scale images down This is part 2 of the change. This is for PAL backend. The parent buffer sometimes has newer data than the sub buffer or image. We always need to copy the data into copybuffer in pitch workaround. Tests: clinfo Conformance tests: all images test, info, API, basic. Internal runtime tests Change-Id: I97d876ac75b240e69b48244be4c9e522db24f8ac [ROCm/clr commit: 0de4b2962cce9fd122b36d81d30b37560347a618] --- projects/clr/rocclr/device/pal/palvirtual.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/projects/clr/rocclr/device/pal/palvirtual.cpp b/projects/clr/rocclr/device/pal/palvirtual.cpp index d919ae973e..c54101b2c3 100644 --- a/projects/clr/rocclr/device/pal/palvirtual.cpp +++ b/projects/clr/rocclr/device/pal/palvirtual.cpp @@ -1249,15 +1249,13 @@ void VirtualGPU::submitReadMemory(amd::ReadMemoryCommand& vcmd) { // Check if synchronization has to be performed 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()); - } + 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) {