• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2  * Copyright (c) 2008-2020 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 
18 Copyright (c) 2013-2019 Intel Corporation All Rights Reserved.
19 
20 THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
24 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
28 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
29 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
30 MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 File Name: cl_va_api_media_sharing_intel.h
33 
34 Abstract:
35 
36 Notes:
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
49 extern "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 
84 typedef cl_uint cl_va_api_device_source_intel;
85 typedef cl_uint cl_va_api_device_set_intel;
86 
87 extern CL_API_ENTRY cl_int CL_API_CALL
88 clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
89     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;
96 
97 typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
98     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;
105 
106 extern CL_API_ENTRY cl_mem CL_API_CALL
107 clCreateFromVA_APIMediaSurfaceINTEL(
108     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;
113 
114 typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
115     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;
120 
121 extern CL_API_ENTRY cl_int CL_API_CALL
122 clEnqueueAcquireVA_APIMediaSurfacesINTEL(
123     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;
129 
130 typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
131     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;
137 
138 extern CL_API_ENTRY cl_int CL_API_CALL
139 clEnqueueReleaseVA_APIMediaSurfacesINTEL(
140     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 
147 typedef CL_API_ENTRY cl_int (CL_API_CALL *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_EXT_SUFFIX__VERSION_1_2;
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif  /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
160 
161