blob: 5d9edbdfbae874248a94fb1bd00ae7ef597b8aee [file] [log] [blame]
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +00001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __UAPI_IVPU_DRM_H__
20#define __UAPI_IVPU_DRM_H__
21#include "drm.h"
22#ifdef __cplusplus
23extern "C" {
24#endif
25#define DRM_IVPU_DRIVER_MAJOR 1
26#define DRM_IVPU_DRIVER_MINOR 0
27#define DRM_IVPU_GET_PARAM 0x00
28#define DRM_IVPU_SET_PARAM 0x01
29#define DRM_IVPU_BO_CREATE 0x02
30#define DRM_IVPU_BO_INFO 0x03
31#define DRM_IVPU_SUBMIT 0x05
32#define DRM_IVPU_BO_WAIT 0x06
33#define DRM_IOCTL_IVPU_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
34#define DRM_IOCTL_IVPU_SET_PARAM DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SET_PARAM, struct drm_ivpu_param)
35#define DRM_IOCTL_IVPU_BO_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_CREATE, struct drm_ivpu_bo_create)
36#define DRM_IOCTL_IVPU_BO_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_INFO, struct drm_ivpu_bo_info)
37#define DRM_IOCTL_IVPU_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SUBMIT, struct drm_ivpu_submit)
38#define DRM_IOCTL_IVPU_BO_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)
39#define DRM_IVPU_PARAM_DEVICE_ID 0
40#define DRM_IVPU_PARAM_DEVICE_REVISION 1
41#define DRM_IVPU_PARAM_PLATFORM_TYPE 2
42#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
43#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
44#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
45#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
46#define DRM_IVPU_PARAM_CONTEXT_ID 7
47#define DRM_IVPU_PARAM_FW_API_VERSION 8
48#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
49#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
50#define DRM_IVPU_PARAM_TILE_CONFIG 11
51#define DRM_IVPU_PARAM_SKU 12
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070052#define DRM_IVPU_PARAM_CAPABILITIES 13
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +000053#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
54#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
55#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
56#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
57#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070058#define DRM_IVPU_CAP_METRIC_STREAMER 1
59#define DRM_IVPU_CAP_DMA_MEMORY_RANGE 2
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +000060struct drm_ivpu_param {
61 __u32 param;
62 __u32 index;
63 __u64 value;
64};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070065#define DRM_IVPU_BO_SHAVE_MEM 0x00000001
66#define DRM_IVPU_BO_HIGH_MEM DRM_IVPU_BO_SHAVE_MEM
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +000067#define DRM_IVPU_BO_MAPPABLE 0x00000002
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070068#define DRM_IVPU_BO_DMA_MEM 0x00000004
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +000069#define DRM_IVPU_BO_CACHED 0x00000000
70#define DRM_IVPU_BO_UNCACHED 0x00010000
71#define DRM_IVPU_BO_WC 0x00020000
72#define DRM_IVPU_BO_CACHE_MASK 0x00030000
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070073#define DRM_IVPU_BO_FLAGS (DRM_IVPU_BO_HIGH_MEM | DRM_IVPU_BO_MAPPABLE | DRM_IVPU_BO_DMA_MEM | DRM_IVPU_BO_CACHE_MASK)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +000074struct drm_ivpu_bo_create {
75 __u64 size;
76 __u32 flags;
77 __u32 handle;
78 __u64 vpu_addr;
79};
80struct drm_ivpu_bo_info {
81 __u32 handle;
82 __u32 flags;
83 __u64 vpu_addr;
84 __u64 mmap_offset;
85 __u64 size;
86};
87#define DRM_IVPU_ENGINE_COMPUTE 0
88#define DRM_IVPU_ENGINE_COPY 1
89struct drm_ivpu_submit {
90 __u64 buffers_ptr;
91 __u32 buffer_count;
92 __u32 engine;
93 __u32 flags;
94 __u32 commands_offset;
95};
96#define DRM_IVPU_JOB_STATUS_SUCCESS 0
97struct drm_ivpu_bo_wait {
98 __u32 handle;
99 __u32 flags;
100 __s64 timeout_ns;
101 __u32 job_status;
102 __u32 pad;
103};
104#ifdef __cplusplus
105}
106#endif
107#endif