Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 2 | * Copyright (c) 2008-2023 The Khronos Group Inc. |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 3 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 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 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 7 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 9 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 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 | ******************************************************************************/ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 16 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 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> |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 25 | |
| 26 | #include <CL/cl.h> |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 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 |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 44 | |
| 45 | #ifdef __cplusplus |
| 46 | extern "C" { |
| 47 | #endif |
| 48 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 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" |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 55 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 56 | /* when cl_intel_va_api_media_sharing is supported */ |
| 57 | |
| 58 | typedef cl_int (CL_API_CALL * |
| 59 | clGetSupportedVA_APIMediaSurfaceFormatsINTEL_fn)( |
| 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 | #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 69 | |
| 70 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 71 | clGetSupportedVA_APIMediaSurfaceFormatsINTEL( |
| 72 | cl_context context, |
| 73 | cl_mem_flags flags, |
| 74 | cl_mem_object_type image_type, |
| 75 | cl_uint plane, |
| 76 | cl_uint num_entries, |
| 77 | VAImageFormat* va_api_formats, |
| 78 | cl_uint* num_surface_formats) ; |
| 79 | |
| 80 | #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ |
| 81 | |
| 82 | /*************************************************************** |
| 83 | * cl_intel_va_api_media_sharing |
| 84 | ***************************************************************/ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 85 | #define cl_intel_va_api_media_sharing 1 |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 86 | #define CL_INTEL_VA_API_MEDIA_SHARING_EXTENSION_NAME \ |
| 87 | "cl_intel_va_api_media_sharing" |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 88 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 89 | typedef cl_uint cl_va_api_device_source_intel; |
| 90 | typedef cl_uint cl_va_api_device_set_intel; |
| 91 | |
| 92 | /* Error codes */ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 93 | #define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098 |
| 94 | #define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099 |
| 95 | #define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100 |
| 96 | #define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101 |
| 97 | |
| 98 | /* cl_va_api_device_source_intel */ |
| 99 | #define CL_VA_API_DISPLAY_INTEL 0x4094 |
| 100 | |
| 101 | /* cl_va_api_device_set_intel */ |
| 102 | #define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095 |
| 103 | #define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096 |
| 104 | |
| 105 | /* cl_context_info */ |
| 106 | #define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097 |
| 107 | |
| 108 | /* cl_mem_info */ |
| 109 | #define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098 |
| 110 | |
| 111 | /* cl_image_info */ |
| 112 | #define CL_IMAGE_VA_API_PLANE_INTEL 0x4099 |
| 113 | |
| 114 | /* cl_command_type */ |
| 115 | #define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A |
| 116 | #define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B |
| 117 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 118 | |
| 119 | typedef cl_int (CL_API_CALL * |
| 120 | clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)( |
| 121 | cl_platform_id platform, |
| 122 | cl_va_api_device_source_intel media_adapter_type, |
| 123 | void* media_adapter, |
| 124 | cl_va_api_device_set_intel media_adapter_set, |
| 125 | cl_uint num_entries, |
| 126 | cl_device_id* devices, |
| 127 | cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; |
| 128 | |
| 129 | typedef cl_mem (CL_API_CALL * |
| 130 | clCreateFromVA_APIMediaSurfaceINTEL_fn)( |
| 131 | cl_context context, |
| 132 | cl_mem_flags flags, |
| 133 | VASurfaceID* surface, |
| 134 | cl_uint plane, |
| 135 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 136 | |
| 137 | typedef cl_int (CL_API_CALL * |
| 138 | clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)( |
| 139 | cl_command_queue command_queue, |
| 140 | cl_uint num_objects, |
| 141 | const cl_mem* mem_objects, |
| 142 | cl_uint num_events_in_wait_list, |
| 143 | const cl_event* event_wait_list, |
| 144 | cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
| 145 | |
| 146 | typedef cl_int (CL_API_CALL * |
| 147 | clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)( |
| 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) CL_API_SUFFIX__VERSION_1_2; |
| 154 | |
| 155 | #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 156 | |
| 157 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 158 | clGetDeviceIDsFromVA_APIMediaAdapterINTEL( |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 159 | cl_platform_id platform, |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 160 | cl_va_api_device_source_intel media_adapter_type, |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 161 | void* media_adapter, |
| 162 | cl_va_api_device_set_intel media_adapter_set, |
| 163 | cl_uint num_entries, |
| 164 | cl_device_id* devices, |
| 165 | cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 166 | |
| 167 | extern CL_API_ENTRY cl_mem CL_API_CALL |
| 168 | clCreateFromVA_APIMediaSurfaceINTEL( |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 169 | cl_context context, |
| 170 | cl_mem_flags flags, |
| 171 | VASurfaceID* surface, |
| 172 | cl_uint plane, |
| 173 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 174 | |
| 175 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 176 | clEnqueueAcquireVA_APIMediaSurfacesINTEL( |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 177 | cl_command_queue command_queue, |
| 178 | cl_uint num_objects, |
| 179 | const cl_mem* mem_objects, |
| 180 | cl_uint num_events_in_wait_list, |
| 181 | const cl_event* event_wait_list, |
| 182 | cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 183 | |
| 184 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 185 | clEnqueueReleaseVA_APIMediaSurfacesINTEL( |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 186 | cl_command_queue command_queue, |
| 187 | cl_uint num_objects, |
| 188 | const cl_mem* mem_objects, |
| 189 | cl_uint num_events_in_wait_list, |
| 190 | const cl_event* event_wait_list, |
| 191 | cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 192 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 193 | #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 194 | |
| 195 | #ifdef __cplusplus |
| 196 | } |
| 197 | #endif |
| 198 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 199 | #endif /* OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ */ |