From 68cefb3654b7420b28af403ce2f1890515562b00 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 19 Jul 2016 10:45:55 -0400
Subject: [PATCH] P4 to Git Change 1293023 by wchau@wchau_WIN_OCL_HSA on
2016/07/19 10:24:01
SWDEV-89502 - [OCL] Support AMD DVR Core functionalities - add support for PFPA_DOPP_SUBMISSION & GL_RGB10_A2 format (changes in OCL RT)
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#51 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#12 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#26 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#317 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#125 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#404 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#17 edit
---
opencl/api/opencl/amdocl/cl_gl.cpp | 9 ++++++++-
opencl/api/opencl/amdocl/cl_svm.cpp | 9 +++++++++
opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h | 1 +
opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h | 1 +
opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h | 1 +
5 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/opencl/api/opencl/amdocl/cl_gl.cpp b/opencl/api/opencl/amdocl/cl_gl.cpp
index 2ab4014e58..7b59fa2c32 100644
--- a/opencl/api/opencl/amdocl/cl_gl.cpp
+++ b/opencl/api/opencl/amdocl/cl_gl.cpp
@@ -1089,6 +1089,13 @@ CL_FLOAT
switch(gliInternalFormat)
{
+ case GL_RGB10_A2:
+ pclImageFormat->image_channel_order = CL_RGB;
+ pclImageFormat->image_channel_data_type = CL_UNORM_INT_101010;
+ *piBytesPerPixel = 4;
+ bRetVal = true;
+ break;
+
case GL_BGR8_ATI:
case GL_BGRA8_ATI:
pclImageFormat->image_channel_order = CL_BGRA;
@@ -1456,10 +1463,10 @@ clChannelDataTypeToGlType(cl_channel_type channel_type)
case CL_UNSIGNED_INT16: return GL_UNSIGNED_SHORT;
case CL_UNSIGNED_INT32: return GL_UNSIGNED_INT;
case CL_FLOAT: return GL_FLOAT;
+ case CL_UNORM_INT_101010: return GL_UNSIGNED_INT_10_10_10_2;
case CL_HALF_FLOAT:
case CL_UNORM_SHORT_565:
case CL_UNORM_SHORT_555:
- case CL_UNORM_INT_101010:
default:
guarantee(false && "Unexpected CL type.");
return 0;
diff --git a/opencl/api/opencl/amdocl/cl_svm.cpp b/opencl/api/opencl/amdocl/cl_svm.cpp
index 62fc51e980..232eb12202 100644
--- a/opencl/api/opencl/amdocl/cl_svm.cpp
+++ b/opencl/api/opencl/amdocl/cl_svm.cpp
@@ -1096,6 +1096,15 @@ RUNTIME_ENTRY(cl_int, clSetKernelExecInfo, (
amdKernel->parameters().setExecNewVcop(newVcopFlag);
}
break;
+ case CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD:
+ if (param_value_size != sizeof(cl_bool)) {
+ return CL_INVALID_VALUE;
+ }
+ else {
+ const bool pfpaVcopFlag = (*(reinterpret_cast(param_value))) ? true: false;
+ amdKernel->parameters().setExecPfpaVcop(pfpaVcopFlag);
+ }
+ break;
default:
return CL_INVALID_VALUE;
}
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
index fbfd56e1f3..4ac6e71bae 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
@@ -268,6 +268,7 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
+#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
/***************************************
* cl-gl depth buffer interop extension *
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
index 8a9a773679..b8ec2ac52c 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
@@ -232,6 +232,7 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
+#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
/***************************************
* cl-gl depth buffer interop extension *
diff --git a/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h b/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h
index 9e73a69dda..76da26ed8a 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h
@@ -231,6 +231,7 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
+#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
/***************************************
* cl-gl depth buffer interop extension *