P4 to Git Change 1275749 by wchau@wchau_WIN_OCL_HSA on 2016/06/02 13:38:16

SWDEV-89502 - [OCL] Support AMD DVR Core functionalities.  Add OCL support for DOPP for desktop and present texture (OCL RT changes)

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#50 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#17 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#11 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#25 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#316 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#124 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#403 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#16 edit
This commit is contained in:
foreman
2016-06-02 14:15:36 -04:00
والد 5896562f0f
کامیت d65b1ec47f
5فایلهای تغییر یافته به همراه63 افزوده شده و 32 حذف شده
@@ -24,6 +24,10 @@
#include "device/device.hpp"
/* The pixel internal format for DOPP texture defined in gl_enum.h */
#define GL_BGR8_ATI 0x8083
#define GL_BGRA8_ATI 0x8088
#include <cstring>
#include <vector>
@@ -1085,6 +1089,14 @@ CL_FLOAT
switch(gliInternalFormat)
{
case GL_BGR8_ATI:
case GL_BGRA8_ATI:
pclImageFormat->image_channel_order = CL_BGRA;
pclImageFormat->image_channel_data_type = CL_UNORM_INT8;//CL_UNSIGNED_INT8;
*piBytesPerPixel = 4;
bRetVal = true;
break;
case GL_ALPHA8:
pclImageFormat->image_channel_order = CL_A;
pclImageFormat->image_channel_data_type = CL_UNORM_INT8;//CL_UNSIGNED_INT8;
@@ -1041,53 +1041,63 @@ RUNTIME_ENTRY(cl_int, clSetKernelExecInfo, (
return CL_INVALID_KERNEL;
}
if (param_name != CL_KERNEL_EXEC_INFO_SVM_PTRS &&
param_name != CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM) {
return CL_INVALID_VALUE;
}
if (param_value == NULL) {
return CL_INVALID_VALUE;
}
const amd::Kernel* amdKernel = as_amd(kernel);
if (param_name == CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM) {
switch (param_name) {
case CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM:
if (param_value_size != sizeof(cl_bool)) {
return CL_INVALID_VALUE;
}
const bool flag = *(static_cast<const bool*>(param_value));
const amd::Context* amdContext = &amdKernel->program().context();
bool foundFineGrainedSystemDevice = false;
const std::vector<amd::Device*>& devices = amdContext->devices();
std::vector<amd::Device*>::const_iterator it;
for (it = devices.begin(); it != devices.end(); ++it) {
if ((*it)->info().svmCapabilities_ &
CL_DEVICE_SVM_FINE_GRAIN_SYSTEM) {
foundFineGrainedSystemDevice = true;
break;
}
else {
const bool flag = *(static_cast<const bool*>(param_value));
const amd::Context* amdContext = &amdKernel->program().context();
bool foundFineGrainedSystemDevice = false;
const std::vector<amd::Device*>& devices = amdContext->devices();
std::vector<amd::Device*>::const_iterator it;
for (it = devices.begin(); it != devices.end(); ++it) {
if ((*it)->info().svmCapabilities_ &
CL_DEVICE_SVM_FINE_GRAIN_SYSTEM) {
foundFineGrainedSystemDevice = true;
break;
}
}
if (flag && !foundFineGrainedSystemDevice) {
return CL_INVALID_OPERATION;
}
amdKernel->parameters().setSvmSystemPointersSupport(flag ? FGS_YES : FGS_NO);
}
if (flag && !foundFineGrainedSystemDevice) {
return CL_INVALID_OPERATION;
}
amdKernel->parameters().setSvmSystemPointersSupport(flag ? FGS_YES : FGS_NO);
}
else {
break;
case CL_KERNEL_EXEC_INFO_SVM_PTRS:
if (param_value_size == 0 || !amd::isMultipleOf(param_value_size,
sizeof(void*))) {
sizeof(void*))) {
return CL_INVALID_VALUE;
}
size_t count = param_value_size/sizeof(void*);
void* const* execInfoArray = reinterpret_cast<void* const*>(param_value);
for (size_t i = 0; i < count; i++) {
if (NULL == execInfoArray[i]) {
return CL_INVALID_VALUE;
else {
size_t count = param_value_size/sizeof(void*);
void* const* execInfoArray = reinterpret_cast<void* const*>(param_value);
for (size_t i = 0; i < count; i++) {
if (NULL == execInfoArray[i]) {
return CL_INVALID_VALUE;
}
}
amdKernel->parameters().addSvmPtr(execInfoArray, count);
}
amdKernel->parameters().addSvmPtr(execInfoArray, count);
break;
case CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD:
if (param_value_size != sizeof(cl_bool)) {
return CL_INVALID_VALUE;
}
else {
const bool newVcopFlag = (*(reinterpret_cast<const cl_bool*>(param_value))) ? true: false;
amdKernel->parameters().setExecNewVcop(newVcopFlag);
}
break;
default:
return CL_INVALID_VALUE;
}
return CL_SUCCESS;
@@ -266,6 +266,9 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
**************************/
#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
/***************************************
* cl-gl depth buffer interop extension *
****************************************/
@@ -230,6 +230,9 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
**************************/
#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
/***************************************
* cl-gl depth buffer interop extension *
****************************************/
@@ -229,6 +229,9 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
**************************/
#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
/* cl_kernel_exec_info for DVR DOPP texture support */
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
/***************************************
* cl-gl depth buffer interop extension *
****************************************/