diff --git a/rocclr/runtime/device/pal/palresource.cpp b/rocclr/runtime/device/pal/palresource.cpp index 85663e5689..c569c326cc 100644 --- a/rocclr/runtime/device/pal/palresource.cpp +++ b/rocclr/runtime/device/pal/palresource.cpp @@ -1271,6 +1271,7 @@ Resource::partialMemCopyTo( uint64_t gpuMemoryOffset, gpuMemoryRowPitch, imageOffsetx; bool img1Darray = false; + bool img2Darray = false; if (desc().buffer_ && !dstResource.desc().buffer_) { imageOffsetx = calDstOrigin[0] % dstResource.elementSize(); @@ -1278,6 +1279,7 @@ Resource::partialMemCopyTo( gpuMemoryRowPitch = (calSrcOrigin[1]) ? calSrcOrigin[1] : calSize[0] * dstResource.elementSize(); img1Darray = (dstResource.desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY); + img2Darray = (dstResource.desc().topology_ == CL_MEM_OBJECT_IMAGE2D_ARRAY); } else if (!desc().buffer_ && dstResource.desc().buffer_) { imageOffsetx = calSrcOrigin[0] % elementSize(); @@ -1285,6 +1287,7 @@ Resource::partialMemCopyTo( gpuMemoryRowPitch = (calDstOrigin[1]) ? calDstOrigin[1] : calSize[0] * elementSize(); img1Darray = (desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY); + img2Darray = (desc().topology_ == CL_MEM_OBJECT_IMAGE2D_ARRAY); } @@ -1297,8 +1300,7 @@ Resource::partialMemCopyTo( // another DRM restriciton... SI has 4 pixels (gpuMemoryOffset % 4 != 0) || (dev().settings().sdamPageFaultWar_ && - (imageOffsetx != 0)) || - (dev().settings().disableSdmaMemoryToImage_ && img1Darray)) { + (imageOffsetx != 0))) { return false; } @@ -1329,12 +1331,20 @@ Resource::partialMemCopyTo( copyRegion.imageExtent.height = calSize[1]; copyRegion.imageExtent.depth = calSize[2]; copyRegion.numSlices = 1; + if (img1Darray) { + copyRegion.numSlices = copyRegion.imageExtent.height; + copyRegion.imageExtent.height = 1; + } + else if (img2Darray) { + copyRegion.numSlices = copyRegion.imageExtent.depth; + copyRegion.imageExtent.depth = 1; + } copyRegion.gpuMemoryOffset = gpuMemoryOffset; copyRegion.gpuMemoryRowPitch = gpuMemoryRowPitch; copyRegion.gpuMemoryDepthPitch = (calSrcOrigin[2]) ? calSrcOrigin[2] : - copyRegion.gpuMemoryRowPitch * calSize[1]; - gpu.iCmd()->CmdCopyMemoryToImage(*iMem(), *dstResource.image_, - imgLayout, 1, ©Region); + copyRegion.gpuMemoryRowPitch * copyRegion.imageExtent.height; + gpu.iCmd()->CmdCopyMemoryToImage(*iMem(), *dstResource.image_, + imgLayout, 1, ©Region); } else if (!desc().buffer_ && dstResource.desc().buffer_) { Pal::MemoryImageCopyRegion copyRegion = {}; @@ -1347,12 +1357,20 @@ Resource::partialMemCopyTo( copyRegion.imageExtent.height = calSize[1]; copyRegion.imageExtent.depth = calSize[2]; copyRegion.numSlices = 1; + if (img1Darray) { + copyRegion.numSlices = copyRegion.imageExtent.height; + copyRegion.imageExtent.height = 1; + } + else if (img2Darray) { + copyRegion.numSlices = copyRegion.imageExtent.depth; + copyRegion.imageExtent.depth = 1; + } copyRegion.gpuMemoryOffset = gpuMemoryOffset; copyRegion.gpuMemoryRowPitch = gpuMemoryRowPitch; copyRegion.gpuMemoryDepthPitch = (calDstOrigin[2]) ? calDstOrigin[2] : - copyRegion.gpuMemoryRowPitch * calSize[1]; - gpu.iCmd()->CmdCopyImageToMemory(*image_, imgLayout, - *dstResource.iMem(), 1, ©Region); + copyRegion.gpuMemoryRowPitch * copyRegion.imageExtent.height; + gpu.iCmd()->CmdCopyImageToMemory(*image_, imgLayout, + *dstResource.iMem(), 1, ©Region); } else { if (enableCopyRect) { diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp index 54468881ee..7fb230bcdc 100644 --- a/rocclr/runtime/device/pal/palsettings.cpp +++ b/rocclr/runtime/device/pal/palsettings.cpp @@ -179,10 +179,6 @@ Settings::create( switch (palProp.gfxLevel) { case Pal::GfxIpLevel::GfxIp9: aiPlus_ = true; - // This is a temporary workaround to disable sDMA for MemToImage and - // ImageToMem copies and needs be removed later once we have a fix - // for Conf. images(mipmaps) 1Darray failures on Vega10 - disableSdmaMemoryToImage_ = GPU_DISABLE_SDMA_MEMORY_TO_IMAGE; break; default: assert(0 && "Unknown GfxIP type!");