From 533067947382ae597695fb7fe288edc7f3c55a3a Mon Sep 17 00:00:00 2001 From: Alex Xie Date: Fri, 29 Jan 2021 14:41:21 -0500 Subject: [PATCH] SWDEV-268914 - Linux, AMF, tests fail to scale images down In pitch workaround, we need to copy the image to copy buffer when application wants to read image to buffer. After this patch, we unconditionally copy the image data to the copy buffer. Change-Id: I71b0d19459542dfbb3ca51a2c8a3a81367fa2fb5 --- rocclr/device/rocm/rocvirtual.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index f6d484e86b..0cd5017214 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -1226,15 +1226,13 @@ void VirtualGPU::submitReadMemory(amd::ReadMemoryCommand& cmd) { if (nullptr != imageBuffer->CopyImageBuffer()) { amd::Memory* memory = imageBuffer->CopyImageBuffer(); devMem = dev().getGpuMemory(memory); - 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, *devMem, 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, *devMem, offs, + offs, image->getRegion(), true, + image->getRowPitch(), image->getSlicePitch()); } } if (hostMemory != nullptr) {