blob: 767da05fc8d25e9287382b0f563f119e560a29bc [file] [log] [blame]
Sheri Zhang79cb9452021-09-07 14:51:49 +01001/*******************************************************************************
Viet-Hoa Do633ebd12023-08-11 12:27:59 +01002 * Copyright (c) 2008-2023 The Khronos Group Inc.
Pablo Telloe86a09f2018-01-11 15:44:48 +00003 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01004 * 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 Telloe86a09f2018-01-11 15:44:48 +00007 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01008 * http://www.apache.org/licenses/LICENSE-2.0
Pablo Telloe86a09f2018-01-11 15:44:48 +00009 *
Sheri Zhang79cb9452021-09-07 14:51:49 +010010 * 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 Telloe86a09f2018-01-11 15:44:48 +000016
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010017#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 Telloe86a09f2018-01-11 15:44:48 +000025
26#include <CL/cl.h>
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010027
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 Telloe86a09f2018-01-11 15:44:48 +000044
45#ifdef __cplusplus
46extern "C" {
47#endif
48
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010049/***************************************************************
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 Telloe86a09f2018-01-11 15:44:48 +000055
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010056/* when cl_intel_va_api_media_sharing is supported */
57
58typedef cl_int (CL_API_CALL *
59clGetSupportedVA_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
70extern CL_API_ENTRY cl_int CL_API_CALL
71clGetSupportedVA_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 Telloe86a09f2018-01-11 15:44:48 +000085#define cl_intel_va_api_media_sharing 1
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010086#define CL_INTEL_VA_API_MEDIA_SHARING_EXTENSION_NAME \
87 "cl_intel_va_api_media_sharing"
Pablo Telloe86a09f2018-01-11 15:44:48 +000088
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010089typedef cl_uint cl_va_api_device_source_intel;
90typedef cl_uint cl_va_api_device_set_intel;
91
92/* Error codes */
Pablo Telloe86a09f2018-01-11 15:44:48 +000093#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 Do633ebd12023-08-11 12:27:59 +0100118
119typedef cl_int (CL_API_CALL *
120clGetDeviceIDsFromVA_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
129typedef cl_mem (CL_API_CALL *
130clCreateFromVA_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
137typedef cl_int (CL_API_CALL *
138clEnqueueAcquireVA_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
146typedef cl_int (CL_API_CALL *
147clEnqueueReleaseVA_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 Telloe86a09f2018-01-11 15:44:48 +0000156
157extern CL_API_ENTRY cl_int CL_API_CALL
158clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100159 cl_platform_id platform,
Sheri Zhang67354e02021-06-30 16:08:29 +0100160 cl_va_api_device_source_intel media_adapter_type,
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100161 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 Telloe86a09f2018-01-11 15:44:48 +0000166
167extern CL_API_ENTRY cl_mem CL_API_CALL
168clCreateFromVA_APIMediaSurfaceINTEL(
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100169 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 Telloe86a09f2018-01-11 15:44:48 +0000174
175extern CL_API_ENTRY cl_int CL_API_CALL
176clEnqueueAcquireVA_APIMediaSurfacesINTEL(
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100177 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 Telloe86a09f2018-01-11 15:44:48 +0000183
184extern CL_API_ENTRY cl_int CL_API_CALL
185clEnqueueReleaseVA_APIMediaSurfacesINTEL(
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100186 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 Zhang67354e02021-06-30 16:08:29 +0100192
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100193#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
Pablo Telloe86a09f2018-01-11 15:44:48 +0000194
195#ifdef __cplusplus
196}
197#endif
198
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100199#endif /* OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ */