From 4d659dfd3777215b108727184c1f927e9c7b395e Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 22 Nov 2016 14:43:24 -0500
Subject: [PATCH] P4 to Git Change 1344768 by
skudchad@skudchad_test_win_opencl2 on 2016/11/22 14:31:30
SWDEV-107226 - [SDI] SDISpeedTest Corruption for OCL GPU to SDI RGBA
- Single step copy using SDMA to remote SDI buffer seems to be causing corruption. This fix is a workaround to do transfer via a staging buffer and seems to be fixing corruption. The issue is under investigation
ReviewBoardURL = http://ocltc.amd.com/reviews/r/11882/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#125 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#12 edit
---
rocclr/runtime/device/gpu/gpublit.cpp | 5 ++++-
rocclr/runtime/device/pal/palblit.cpp | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/rocclr/runtime/device/gpu/gpublit.cpp b/rocclr/runtime/device/gpu/gpublit.cpp
index 20fe38cf11..c6f3f05095 100644
--- a/rocclr/runtime/device/gpu/gpublit.cpp
+++ b/rocclr/runtime/device/gpu/gpublit.cpp
@@ -1360,7 +1360,10 @@ KernelBlitManager::copyImageToBuffer(
((slicePitch == 0) || (slicePitch == imgSlicePitch))))) {
// First attempt to do this all with DMA,
// but there are restriciton with older hardware
- if (dev().settings().imageDMA_) {
+ // If the dest buffer is external physical(SDI), copy two step as
+ // single step SDMA is causing corruption and the cause is under investigation
+ if (dev().settings().imageDMA_ &&
+ gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical) {
result = DmaBlitManager::copyImageToBuffer(
srcMemory, dstMemory, srcOrigin, dstOrigin,
size, entire, rowPitch, slicePitch);
diff --git a/rocclr/runtime/device/pal/palblit.cpp b/rocclr/runtime/device/pal/palblit.cpp
index 56c5f63dbb..33a39eef04 100644
--- a/rocclr/runtime/device/pal/palblit.cpp
+++ b/rocclr/runtime/device/pal/palblit.cpp
@@ -1360,7 +1360,10 @@ KernelBlitManager::copyImageToBuffer(
((slicePitch == 0) || (slicePitch == imgSlicePitch))))) {
// First attempt to do this all with DMA,
// but there are restriciton with older hardware
- if (dev().settings().imageDMA_) {
+ // If the dest buffer is external physical(SDI), copy two step as
+ // single step SDMA is causing corruption and the cause is under investigation
+ if (dev().settings().imageDMA_ &&
+ gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical) {
result = DmaBlitManager::copyImageToBuffer(
srcMemory, dstMemory, srcOrigin, dstOrigin,
size, entire, rowPitch, slicePitch);