blob: 7ba2ec83d1db33b53d1af65c66583ade1f42af83 [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#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
18#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
19
20#include <CL/cl.h>
21#include <CL/cl_platform.h>
22#include <va/va.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/******************************************
29* cl_intel_va_api_media_sharing extension *
30*******************************************/
31
32#define cl_intel_va_api_media_sharing 1
33
34/* error codes */
35#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
36#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
37#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
38#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
39
40/* cl_va_api_device_source_intel */
41#define CL_VA_API_DISPLAY_INTEL 0x4094
42
43/* cl_va_api_device_set_intel */
44#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
45#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
46
47/* cl_context_info */
48#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
49
50/* cl_mem_info */
51#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
52
53/* cl_image_info */
54#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
55
56/* cl_command_type */
57#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
58#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
59
60typedef cl_uint cl_va_api_device_source_intel;
61typedef cl_uint cl_va_api_device_set_intel;
62
63extern CL_API_ENTRY cl_int CL_API_CALL
64clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +010065 cl_platform_id platform,
66 cl_va_api_device_source_intel media_adapter_type,
67 void* media_adapter,
68 cl_va_api_device_set_intel media_adapter_set,
69 cl_uint num_entries,
70 cl_device_id* devices,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000071 cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +000072
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000073typedef cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010074 cl_platform_id platform,
75 cl_va_api_device_source_intel media_adapter_type,
76 void* media_adapter,
77 cl_va_api_device_set_intel media_adapter_set,
78 cl_uint num_entries,
79 cl_device_id* devices,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000080 cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +000081
82extern CL_API_ENTRY cl_mem CL_API_CALL
83clCreateFromVA_APIMediaSurfaceINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +010084 cl_context context,
85 cl_mem_flags flags,
86 VASurfaceID* surface,
87 cl_uint plane,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000088 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +000089
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000090typedef cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010091 cl_context context,
92 cl_mem_flags flags,
93 VASurfaceID* surface,
94 cl_uint plane,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000095 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +000096
97extern CL_API_ENTRY cl_int CL_API_CALL
98clEnqueueAcquireVA_APIMediaSurfacesINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +010099 cl_command_queue command_queue,
100 cl_uint num_objects,
101 const cl_mem* mem_objects,
102 cl_uint num_events_in_wait_list,
103 const cl_event* event_wait_list,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000104 cl_event* event) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000105
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000106typedef cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100107 cl_command_queue command_queue,
108 cl_uint num_objects,
109 const cl_mem* mem_objects,
110 cl_uint num_events_in_wait_list,
111 const cl_event* event_wait_list,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000112 cl_event* event) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000113
114extern CL_API_ENTRY cl_int CL_API_CALL
115clEnqueueReleaseVA_APIMediaSurfacesINTEL(
Sheri Zhang67354e02021-06-30 16:08:29 +0100116 cl_command_queue command_queue,
117 cl_uint num_objects,
118 const cl_mem* mem_objects,
119 cl_uint num_events_in_wait_list,
120 const cl_event* event_wait_list,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000121 cl_event* event) CL_API_SUFFIX__VERSION_1_2;
Sheri Zhang67354e02021-06-30 16:08:29 +0100122
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000123typedef cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100124 cl_command_queue command_queue,
125 cl_uint num_objects,
126 const cl_mem* mem_objects,
127 cl_uint num_events_in_wait_list,
128 const cl_event* event_wait_list,
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000129 cl_event* event) CL_API_SUFFIX__VERSION_1_2;
Pablo Telloe86a09f2018-01-11 15:44:48 +0000130
131#ifdef __cplusplus
132}
133#endif
134
135#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
136