From 753f82f86861da5200bf75616dcc25e92ee66302 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 21 Apr 2015 18:43:08 -0400
Subject: [PATCH] P4 to Git Change 1142991 by
skudchad@skudchad_test_win_opencl2 on 2015/04/21 18:31:11
EPR #403782 - IOMMU2/SVM on CZ Win10, GL Interop changes for SVM.
- Pass flag to GL to indicate SVM mode for OpenCL
ReviewBoardURL = http://ocltc.amd.com/reviews/r/7394/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp#22 edit
---
.../device/gpu/gslbe/src/rt/GSLDeviceGL.cpp | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
index 7757baf49a..b1b0afe1dd 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
@@ -616,12 +616,19 @@ CALGSLDevice::glAssociate(CALvoid* GLplatformContext, CALvoid* GLdeviceContext)
return false;
}
+ int flags = 0;
+
+ if (m_adp->pAsicInfo->svmFineGrainSystem)
+ {
+ flags = GL_INTEROP_SVM;
+ }
+
#ifdef ATI_OS_LINUX
GLXContext ctx = (GLXContext)GLplatformContext;
return (glXBeginCLInteropAMD(ctx, 0)) ? true : false;
#else
HGLRC hRC = (HGLRC)GLplatformContext;
- return (wglBeginCLInteropAMD(hRC, 0)) ? true : false;
+ return (wglBeginCLInteropAMD(hRC, flags)) ? true : false;
#endif
}
@@ -662,6 +669,11 @@ CALGSLDevice::resGLAssociate(GLResAssociate & resData) const
GSL_ALLOCATION_INSTANCED // alloc_type
);
+ if (m_adp->pAsicInfo->svmFineGrainSystem)
+ {
+ attribs.isAllocSVM = true;
+ }
+
hRes.type = resData.type;
GLResourceData* hData = new GLResourceData;