blob: 0e7cd4d6f8321f15c0fab08df055f93b0739f0e0 [file] [log] [blame]
Sheri Zhang79cb9452021-09-07 14:51:49 +01001/*******************************************************************************
2 * Copyright (c) 2008-2020 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/*****************************************************************************\
17
Sheri Zhang67354e02021-06-30 16:08:29 +010018Copyright (c) 2013-2019 Intel Corporation All Rights Reserved.
Pablo Telloe86a09f2018-01-11 15:44:48 +000019
20THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
24CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
28OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
29NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
30MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32File Name: cl_va_api_media_sharing_intel.h
33
34Abstract:
35
36Notes:
37
38\*****************************************************************************/
39
40
41#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
42#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
43
44#include <CL/cl.h>
45#include <CL/cl_platform.h>
46#include <va/va.h>
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/******************************************
53* cl_intel_va_api_media_sharing extension *
54*******************************************/
55
56#define cl_intel_va_api_media_sharing 1
57
58/* error codes */
59#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
60#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
61#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
62#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
63
64/* cl_va_api_device_source_intel */
65#define CL_VA_API_DISPLAY_INTEL 0x4094
66
67/* cl_va_api_device_set_intel */
68#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
69#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
70
71/* cl_context_info */
72#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
73
74/* cl_mem_info */
75#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
76
77/* cl_image_info */
78#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
79
80/* cl_command_type */
81#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
82#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
83
84typedef cl_uint cl_va_api_device_source_intel;
85typedef cl_uint cl_va_api_device_set_intel;
86
87extern CL_API_ENTRY cl_int CL_API_CALL
88clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +010089 cl_platform_id platform,
90 cl_va_api_device_source_intel media_adapter_type,
91 void* media_adapter,
92 cl_va_api_device_set_intel media_adapter_set,
93 cl_uint num_entries,
94 cl_device_id* devices,
95 cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +000096
97typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010098 cl_platform_id platform,
99 cl_va_api_device_source_intel media_adapter_type,
100 void* media_adapter,
101 cl_va_api_device_set_intel media_adapter_set,
102 cl_uint num_entries,
103 cl_device_id* devices,
104 cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000105
106extern CL_API_ENTRY cl_mem CL_API_CALL
107clCreateFromVA_APIMediaSurfaceINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +0100108 cl_context context,
109 cl_mem_flags flags,
110 VASurfaceID* surface,
111 cl_uint plane,
112 cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000113
114typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100115 cl_context context,
116 cl_mem_flags flags,
117 VASurfaceID* surface,
118 cl_uint plane,
119 cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000120
121extern CL_API_ENTRY cl_int CL_API_CALL
122clEnqueueAcquireVA_APIMediaSurfacesINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +0100123 cl_command_queue command_queue,
124 cl_uint num_objects,
125 const cl_mem* mem_objects,
126 cl_uint num_events_in_wait_list,
127 const cl_event* event_wait_list,
128 cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000129
130typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100131 cl_command_queue command_queue,
132 cl_uint num_objects,
133 const cl_mem* mem_objects,
134 cl_uint num_events_in_wait_list,
135 const cl_event* event_wait_list,
136 cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000137
138extern CL_API_ENTRY cl_int CL_API_CALL
139clEnqueueReleaseVA_APIMediaSurfacesINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +0100140 cl_command_queue command_queue,
141 cl_uint num_objects,
142 const cl_mem* mem_objects,
143 cl_uint num_events_in_wait_list,
144 const cl_event* event_wait_list,
145 cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
146
Pablo Telloe86a09f2018-01-11 15:44:48 +0000147typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100148 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_EXT_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000154
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
160