Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/drm
File: ivpu_accel.h
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* Copyright (C) 2020-2023 Intel Corporation
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
#ifndef __UAPI_IVPU_DRM_H__
[5] Fix | Delete
#define __UAPI_IVPU_DRM_H__
[6] Fix | Delete
[7] Fix | Delete
#include "drm.h"
[8] Fix | Delete
[9] Fix | Delete
#if defined(__cplusplus)
[10] Fix | Delete
extern "C" {
[11] Fix | Delete
#endif
[12] Fix | Delete
[13] Fix | Delete
#define DRM_IVPU_DRIVER_MAJOR 1
[14] Fix | Delete
#define DRM_IVPU_DRIVER_MINOR 0
[15] Fix | Delete
[16] Fix | Delete
#define DRM_IVPU_GET_PARAM 0x00
[17] Fix | Delete
#define DRM_IVPU_SET_PARAM 0x01
[18] Fix | Delete
#define DRM_IVPU_BO_CREATE 0x02
[19] Fix | Delete
#define DRM_IVPU_BO_INFO 0x03
[20] Fix | Delete
#define DRM_IVPU_SUBMIT 0x05
[21] Fix | Delete
#define DRM_IVPU_BO_WAIT 0x06
[22] Fix | Delete
[23] Fix | Delete
#define DRM_IOCTL_IVPU_GET_PARAM \
[24] Fix | Delete
DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
[25] Fix | Delete
[26] Fix | Delete
#define DRM_IOCTL_IVPU_SET_PARAM \
[27] Fix | Delete
DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SET_PARAM, struct drm_ivpu_param)
[28] Fix | Delete
[29] Fix | Delete
#define DRM_IOCTL_IVPU_BO_CREATE \
[30] Fix | Delete
DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_CREATE, struct drm_ivpu_bo_create)
[31] Fix | Delete
[32] Fix | Delete
#define DRM_IOCTL_IVPU_BO_INFO \
[33] Fix | Delete
DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_INFO, struct drm_ivpu_bo_info)
[34] Fix | Delete
[35] Fix | Delete
#define DRM_IOCTL_IVPU_SUBMIT \
[36] Fix | Delete
DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SUBMIT, struct drm_ivpu_submit)
[37] Fix | Delete
[38] Fix | Delete
#define DRM_IOCTL_IVPU_BO_WAIT \
[39] Fix | Delete
DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* DOC: contexts
[43] Fix | Delete
*
[44] Fix | Delete
* VPU contexts have private virtual address space, job queues and priority.
[45] Fix | Delete
* Each context is identified by an unique ID. Context is created on open().
[46] Fix | Delete
*/
[47] Fix | Delete
[48] Fix | Delete
#define DRM_IVPU_PARAM_DEVICE_ID 0
[49] Fix | Delete
#define DRM_IVPU_PARAM_DEVICE_REVISION 1
[50] Fix | Delete
#define DRM_IVPU_PARAM_PLATFORM_TYPE 2
[51] Fix | Delete
#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
[52] Fix | Delete
#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
[53] Fix | Delete
#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
[54] Fix | Delete
#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
[55] Fix | Delete
#define DRM_IVPU_PARAM_CONTEXT_ID 7
[56] Fix | Delete
#define DRM_IVPU_PARAM_FW_API_VERSION 8
[57] Fix | Delete
#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
[58] Fix | Delete
#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
[59] Fix | Delete
#define DRM_IVPU_PARAM_TILE_CONFIG 11
[60] Fix | Delete
#define DRM_IVPU_PARAM_SKU 12
[61] Fix | Delete
[62] Fix | Delete
#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
[63] Fix | Delete
[64] Fix | Delete
#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
[65] Fix | Delete
#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
[66] Fix | Delete
#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
[67] Fix | Delete
#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* struct drm_ivpu_param - Get/Set VPU parameters
[71] Fix | Delete
*/
[72] Fix | Delete
struct drm_ivpu_param {
[73] Fix | Delete
/**
[74] Fix | Delete
* @param:
[75] Fix | Delete
*
[76] Fix | Delete
* Supported params:
[77] Fix | Delete
*
[78] Fix | Delete
* %DRM_IVPU_PARAM_DEVICE_ID:
[79] Fix | Delete
* PCI Device ID of the VPU device (read-only)
[80] Fix | Delete
*
[81] Fix | Delete
* %DRM_IVPU_PARAM_DEVICE_REVISION:
[82] Fix | Delete
* VPU device revision (read-only)
[83] Fix | Delete
*
[84] Fix | Delete
* %DRM_IVPU_PARAM_PLATFORM_TYPE:
[85] Fix | Delete
* Returns %DRM_IVPU_PLATFORM_TYPE_SILICON on real hardware or device specific
[86] Fix | Delete
* platform type when executing on a simulator or emulator (read-only)
[87] Fix | Delete
*
[88] Fix | Delete
* %DRM_IVPU_PARAM_CORE_CLOCK_RATE:
[89] Fix | Delete
* Current PLL frequency (read-only)
[90] Fix | Delete
*
[91] Fix | Delete
* %DRM_IVPU_PARAM_NUM_CONTEXTS:
[92] Fix | Delete
* Maximum number of simultaneously existing contexts (read-only)
[93] Fix | Delete
*
[94] Fix | Delete
* %DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
[95] Fix | Delete
* Lowest VPU virtual address available in the current context (read-only)
[96] Fix | Delete
*
[97] Fix | Delete
* %DRM_IVPU_PARAM_CONTEXT_PRIORITY:
[98] Fix | Delete
* Value of current context scheduling priority (read-write).
[99] Fix | Delete
* See DRM_IVPU_CONTEXT_PRIORITY_* for possible values.
[100] Fix | Delete
*
[101] Fix | Delete
* %DRM_IVPU_PARAM_CONTEXT_ID:
[102] Fix | Delete
* Current context ID, always greater than 0 (read-only)
[103] Fix | Delete
*
[104] Fix | Delete
* %DRM_IVPU_PARAM_FW_API_VERSION:
[105] Fix | Delete
* Firmware API version array (read-only)
[106] Fix | Delete
*
[107] Fix | Delete
* %DRM_IVPU_PARAM_ENGINE_HEARTBEAT:
[108] Fix | Delete
* Heartbeat value from an engine (read-only).
[109] Fix | Delete
* Engine ID (i.e. DRM_IVPU_ENGINE_COMPUTE) is given via index.
[110] Fix | Delete
*
[111] Fix | Delete
* %DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID:
[112] Fix | Delete
* Device-unique inference ID (read-only)
[113] Fix | Delete
*
[114] Fix | Delete
* %DRM_IVPU_PARAM_TILE_CONFIG:
[115] Fix | Delete
* VPU tile configuration (read-only)
[116] Fix | Delete
*
[117] Fix | Delete
* %DRM_IVPU_PARAM_SKU:
[118] Fix | Delete
* VPU SKU ID (read-only)
[119] Fix | Delete
*
[120] Fix | Delete
*/
[121] Fix | Delete
__u32 param;
[122] Fix | Delete
[123] Fix | Delete
/** @index: Index for params that have multiple instances */
[124] Fix | Delete
__u32 index;
[125] Fix | Delete
[126] Fix | Delete
/** @value: Param value */
[127] Fix | Delete
__u64 value;
[128] Fix | Delete
};
[129] Fix | Delete
[130] Fix | Delete
#define DRM_IVPU_BO_HIGH_MEM 0x00000001
[131] Fix | Delete
#define DRM_IVPU_BO_MAPPABLE 0x00000002
[132] Fix | Delete
[133] Fix | Delete
#define DRM_IVPU_BO_CACHED 0x00000000
[134] Fix | Delete
#define DRM_IVPU_BO_UNCACHED 0x00010000
[135] Fix | Delete
#define DRM_IVPU_BO_WC 0x00020000
[136] Fix | Delete
#define DRM_IVPU_BO_CACHE_MASK 0x00030000
[137] Fix | Delete
[138] Fix | Delete
#define DRM_IVPU_BO_FLAGS \
[139] Fix | Delete
(DRM_IVPU_BO_HIGH_MEM | \
[140] Fix | Delete
DRM_IVPU_BO_MAPPABLE | \
[141] Fix | Delete
DRM_IVPU_BO_CACHE_MASK)
[142] Fix | Delete
[143] Fix | Delete
/**
[144] Fix | Delete
* struct drm_ivpu_bo_create - Create BO backed by SHMEM
[145] Fix | Delete
*
[146] Fix | Delete
* Create GEM buffer object allocated in SHMEM memory.
[147] Fix | Delete
*/
[148] Fix | Delete
struct drm_ivpu_bo_create {
[149] Fix | Delete
/** @size: The size in bytes of the allocated memory */
[150] Fix | Delete
__u64 size;
[151] Fix | Delete
[152] Fix | Delete
/**
[153] Fix | Delete
* @flags:
[154] Fix | Delete
*
[155] Fix | Delete
* Supported flags:
[156] Fix | Delete
*
[157] Fix | Delete
* %DRM_IVPU_BO_HIGH_MEM:
[158] Fix | Delete
*
[159] Fix | Delete
* Allocate VPU address from >4GB range.
[160] Fix | Delete
* Buffer object with vpu address >4GB can be always accessed by the
[161] Fix | Delete
* VPU DMA engine, but some HW generation may not be able to access
[162] Fix | Delete
* this memory from then firmware running on the VPU management processor.
[163] Fix | Delete
* Suitable for input, output and some scratch buffers.
[164] Fix | Delete
*
[165] Fix | Delete
* %DRM_IVPU_BO_MAPPABLE:
[166] Fix | Delete
*
[167] Fix | Delete
* Buffer object can be mapped using mmap().
[168] Fix | Delete
*
[169] Fix | Delete
* %DRM_IVPU_BO_CACHED:
[170] Fix | Delete
*
[171] Fix | Delete
* Allocated BO will be cached on host side (WB) and snooped on the VPU side.
[172] Fix | Delete
* This is the default caching mode.
[173] Fix | Delete
*
[174] Fix | Delete
* %DRM_IVPU_BO_UNCACHED:
[175] Fix | Delete
*
[176] Fix | Delete
* Allocated BO will not be cached on host side nor snooped on the VPU side.
[177] Fix | Delete
*
[178] Fix | Delete
* %DRM_IVPU_BO_WC:
[179] Fix | Delete
*
[180] Fix | Delete
* Allocated BO will use write combining buffer for writes but reads will be
[181] Fix | Delete
* uncached.
[182] Fix | Delete
*/
[183] Fix | Delete
__u32 flags;
[184] Fix | Delete
[185] Fix | Delete
/** @handle: Returned GEM object handle */
[186] Fix | Delete
__u32 handle;
[187] Fix | Delete
[188] Fix | Delete
/** @vpu_addr: Returned VPU virtual address */
[189] Fix | Delete
__u64 vpu_addr;
[190] Fix | Delete
};
[191] Fix | Delete
[192] Fix | Delete
/**
[193] Fix | Delete
* struct drm_ivpu_bo_info - Query buffer object info
[194] Fix | Delete
*/
[195] Fix | Delete
struct drm_ivpu_bo_info {
[196] Fix | Delete
/** @handle: Handle of the queried BO */
[197] Fix | Delete
__u32 handle;
[198] Fix | Delete
[199] Fix | Delete
/** @flags: Returned flags used to create the BO */
[200] Fix | Delete
__u32 flags;
[201] Fix | Delete
[202] Fix | Delete
/** @vpu_addr: Returned VPU virtual address */
[203] Fix | Delete
__u64 vpu_addr;
[204] Fix | Delete
[205] Fix | Delete
/**
[206] Fix | Delete
* @mmap_offset:
[207] Fix | Delete
*
[208] Fix | Delete
* Returned offset to be used in mmap(). 0 in case the BO is not mappable.
[209] Fix | Delete
*/
[210] Fix | Delete
__u64 mmap_offset;
[211] Fix | Delete
[212] Fix | Delete
/** @size: Returned GEM object size, aligned to PAGE_SIZE */
[213] Fix | Delete
__u64 size;
[214] Fix | Delete
};
[215] Fix | Delete
[216] Fix | Delete
/* drm_ivpu_submit engines */
[217] Fix | Delete
#define DRM_IVPU_ENGINE_COMPUTE 0
[218] Fix | Delete
#define DRM_IVPU_ENGINE_COPY 1
[219] Fix | Delete
[220] Fix | Delete
/**
[221] Fix | Delete
* struct drm_ivpu_submit - Submit commands to the VPU
[222] Fix | Delete
*
[223] Fix | Delete
* Execute a single command buffer on a given VPU engine.
[224] Fix | Delete
* Handles to all referenced buffer objects have to be provided in @buffers_ptr.
[225] Fix | Delete
*
[226] Fix | Delete
* User space may wait on job completion using %DRM_IVPU_BO_WAIT ioctl.
[227] Fix | Delete
*/
[228] Fix | Delete
struct drm_ivpu_submit {
[229] Fix | Delete
/**
[230] Fix | Delete
* @buffers_ptr:
[231] Fix | Delete
*
[232] Fix | Delete
* A pointer to an u32 array of GEM handles of the BOs required for this job.
[233] Fix | Delete
* The number of elements in the array must be equal to the value given by @buffer_count.
[234] Fix | Delete
*
[235] Fix | Delete
* The first BO is the command buffer. The rest of array has to contain all
[236] Fix | Delete
* BOs referenced from the command buffer.
[237] Fix | Delete
*/
[238] Fix | Delete
__u64 buffers_ptr;
[239] Fix | Delete
[240] Fix | Delete
/** @buffer_count: Number of elements in the @buffers_ptr */
[241] Fix | Delete
__u32 buffer_count;
[242] Fix | Delete
[243] Fix | Delete
/**
[244] Fix | Delete
* @engine: Select the engine this job should be executed on
[245] Fix | Delete
*
[246] Fix | Delete
* %DRM_IVPU_ENGINE_COMPUTE:
[247] Fix | Delete
*
[248] Fix | Delete
* Performs Deep Learning Neural Compute Inference Operations
[249] Fix | Delete
*
[250] Fix | Delete
* %DRM_IVPU_ENGINE_COPY:
[251] Fix | Delete
*
[252] Fix | Delete
* Performs memory copy operations to/from system memory allocated for VPU
[253] Fix | Delete
*/
[254] Fix | Delete
__u32 engine;
[255] Fix | Delete
[256] Fix | Delete
/** @flags: Reserved for future use - must be zero */
[257] Fix | Delete
__u32 flags;
[258] Fix | Delete
[259] Fix | Delete
/**
[260] Fix | Delete
* @commands_offset:
[261] Fix | Delete
*
[262] Fix | Delete
* Offset inside the first buffer in @buffers_ptr containing commands
[263] Fix | Delete
* to be executed. The offset has to be 8-byte aligned.
[264] Fix | Delete
*/
[265] Fix | Delete
__u32 commands_offset;
[266] Fix | Delete
};
[267] Fix | Delete
[268] Fix | Delete
/* drm_ivpu_bo_wait job status codes */
[269] Fix | Delete
#define DRM_IVPU_JOB_STATUS_SUCCESS 0
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* struct drm_ivpu_bo_wait - Wait for BO to become inactive
[273] Fix | Delete
*
[274] Fix | Delete
* Blocks until a given buffer object becomes inactive.
[275] Fix | Delete
* With @timeout_ms set to 0 returns immediately.
[276] Fix | Delete
*/
[277] Fix | Delete
struct drm_ivpu_bo_wait {
[278] Fix | Delete
/** @handle: Handle to the buffer object to be waited on */
[279] Fix | Delete
__u32 handle;
[280] Fix | Delete
[281] Fix | Delete
/** @flags: Reserved for future use - must be zero */
[282] Fix | Delete
__u32 flags;
[283] Fix | Delete
[284] Fix | Delete
/** @timeout_ns: Absolute timeout in nanoseconds (may be zero) */
[285] Fix | Delete
__s64 timeout_ns;
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* @job_status:
[289] Fix | Delete
*
[290] Fix | Delete
* Job status code which is updated after the job is completed.
[291] Fix | Delete
* &DRM_IVPU_JOB_STATUS_SUCCESS or device specific error otherwise.
[292] Fix | Delete
* Valid only if @handle points to a command buffer.
[293] Fix | Delete
*/
[294] Fix | Delete
__u32 job_status;
[295] Fix | Delete
[296] Fix | Delete
/** @pad: Padding - must be zero */
[297] Fix | Delete
__u32 pad;
[298] Fix | Delete
};
[299] Fix | Delete
[300] Fix | Delete
#if defined(__cplusplus)
[301] Fix | Delete
}
[302] Fix | Delete
#endif
[303] Fix | Delete
[304] Fix | Delete
#endif /* __UAPI_IVPU_DRM_H__ */
[305] Fix | Delete
[306] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function