1 /******************************************************************************* 2 * Copyright (c) 2008-2023 The Khronos Group Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 #ifndef OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ 18 #define OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ 19 20 /* 21 ** This header is generated from the Khronos OpenCL XML API Registry. 22 */ 23 24 #include <va/va.h> 25 26 #include <CL/cl.h> 27 28 /* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ 29 #if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) 30 #define CL_NO_EXTENSION_PROTOTYPES 31 #endif 32 33 /* CL_NO_EXTENSION_PROTOTYPES implies 34 CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and 35 CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ 36 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 37 !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 38 #define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES 39 #endif 40 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 41 !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 42 #define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES 43 #endif 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 /*************************************************************** 50 * cl_intel_sharing_format_query_va_api 51 ***************************************************************/ 52 #define cl_intel_sharing_format_query_va_api 1 53 #define CL_INTEL_SHARING_FORMAT_QUERY_VA_API_EXTENSION_NAME \ 54 "cl_intel_sharing_format_query_va_api" 55 56 /* when cl_intel_va_api_media_sharing is supported */ 57 58 typedef cl_int CL_API_CALL 59 clGetSupportedVA_APIMediaSurfaceFormatsINTEL_t( 60 cl_context context, 61 cl_mem_flags flags, 62 cl_mem_object_type image_type, 63 cl_uint plane, 64 cl_uint num_entries, 65 VAImageFormat* va_api_formats, 66 cl_uint* num_surface_formats); 67 68 typedef clGetSupportedVA_APIMediaSurfaceFormatsINTEL_t * 69 clGetSupportedVA_APIMediaSurfaceFormatsINTEL_fn ; 70 71 #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 72 73 extern CL_API_ENTRY cl_int CL_API_CALL 74 clGetSupportedVA_APIMediaSurfaceFormatsINTEL( 75 cl_context context, 76 cl_mem_flags flags, 77 cl_mem_object_type image_type, 78 cl_uint plane, 79 cl_uint num_entries, 80 VAImageFormat* va_api_formats, 81 cl_uint* num_surface_formats) ; 82 83 #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 84 85 /*************************************************************** 86 * cl_intel_va_api_media_sharing 87 ***************************************************************/ 88 #define cl_intel_va_api_media_sharing 1 89 #define CL_INTEL_VA_API_MEDIA_SHARING_EXTENSION_NAME \ 90 "cl_intel_va_api_media_sharing" 91 92 typedef cl_uint cl_va_api_device_source_intel; 93 typedef cl_uint cl_va_api_device_set_intel; 94 95 /* Error codes */ 96 #define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098 97 #define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099 98 #define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100 99 #define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101 100 101 /* cl_va_api_device_source_intel */ 102 #define CL_VA_API_DISPLAY_INTEL 0x4094 103 104 /* cl_va_api_device_set_intel */ 105 #define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095 106 #define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096 107 108 /* cl_context_info */ 109 #define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097 110 111 /* cl_mem_info */ 112 #define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098 113 114 /* cl_image_info */ 115 #define CL_IMAGE_VA_API_PLANE_INTEL 0x4099 116 117 /* cl_command_type */ 118 #define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A 119 #define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B 120 121 122 typedef cl_int CL_API_CALL 123 clGetDeviceIDsFromVA_APIMediaAdapterINTEL_t( 124 cl_platform_id platform, 125 cl_va_api_device_source_intel media_adapter_type, 126 void* media_adapter, 127 cl_va_api_device_set_intel media_adapter_set, 128 cl_uint num_entries, 129 cl_device_id* devices, 130 cl_uint* num_devices); 131 132 typedef clGetDeviceIDsFromVA_APIMediaAdapterINTEL_t * 133 clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn CL_API_SUFFIX__VERSION_1_2; 134 135 typedef cl_mem CL_API_CALL 136 clCreateFromVA_APIMediaSurfaceINTEL_t( 137 cl_context context, 138 cl_mem_flags flags, 139 VASurfaceID* surface, 140 cl_uint plane, 141 cl_int* errcode_ret); 142 143 typedef clCreateFromVA_APIMediaSurfaceINTEL_t * 144 clCreateFromVA_APIMediaSurfaceINTEL_fn CL_API_SUFFIX__VERSION_1_2; 145 146 typedef cl_int CL_API_CALL 147 clEnqueueAcquireVA_APIMediaSurfacesINTEL_t( 148 cl_command_queue command_queue, 149 cl_uint num_objects, 150 const cl_mem* mem_objects, 151 cl_uint num_events_in_wait_list, 152 const cl_event* event_wait_list, 153 cl_event* event); 154 155 typedef clEnqueueAcquireVA_APIMediaSurfacesINTEL_t * 156 clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn CL_API_SUFFIX__VERSION_1_2; 157 158 typedef cl_int CL_API_CALL 159 clEnqueueReleaseVA_APIMediaSurfacesINTEL_t( 160 cl_command_queue command_queue, 161 cl_uint num_objects, 162 const cl_mem* mem_objects, 163 cl_uint num_events_in_wait_list, 164 const cl_event* event_wait_list, 165 cl_event* event); 166 167 typedef clEnqueueReleaseVA_APIMediaSurfacesINTEL_t * 168 clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn CL_API_SUFFIX__VERSION_1_2; 169 170 #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 171 172 extern CL_API_ENTRY cl_int CL_API_CALL 173 clGetDeviceIDsFromVA_APIMediaAdapterINTEL( 174 cl_platform_id platform, 175 cl_va_api_device_source_intel media_adapter_type, 176 void* media_adapter, 177 cl_va_api_device_set_intel media_adapter_set, 178 cl_uint num_entries, 179 cl_device_id* devices, 180 cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; 181 182 extern CL_API_ENTRY cl_mem CL_API_CALL 183 clCreateFromVA_APIMediaSurfaceINTEL( 184 cl_context context, 185 cl_mem_flags flags, 186 VASurfaceID* surface, 187 cl_uint plane, 188 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; 189 190 extern CL_API_ENTRY cl_int CL_API_CALL 191 clEnqueueAcquireVA_APIMediaSurfacesINTEL( 192 cl_command_queue command_queue, 193 cl_uint num_objects, 194 const cl_mem* mem_objects, 195 cl_uint num_events_in_wait_list, 196 const cl_event* event_wait_list, 197 cl_event* event) CL_API_SUFFIX__VERSION_1_2; 198 199 extern CL_API_ENTRY cl_int CL_API_CALL 200 clEnqueueReleaseVA_APIMediaSurfacesINTEL( 201 cl_command_queue command_queue, 202 cl_uint num_objects, 203 const cl_mem* mem_objects, 204 cl_uint num_events_in_wait_list, 205 const cl_event* event_wait_list, 206 cl_event* event) CL_API_SUFFIX__VERSION_1_2; 207 208 #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 209 210 #ifdef __cplusplus 211 } 212 #endif 213 214 #endif /* OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ */ 215