Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/include/drm
File: lima_drm.h
/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
[0] Fix | Delete
/* Copyright 2017-2018 Qiang Yu <yuq825@gmail.com> */
[1] Fix | Delete
[2] Fix | Delete
#ifndef __LIMA_DRM_H__
[3] Fix | Delete
#define __LIMA_DRM_H__
[4] Fix | Delete
[5] Fix | Delete
#include "drm.h"
[6] Fix | Delete
[7] Fix | Delete
#if defined(__cplusplus)
[8] Fix | Delete
extern "C" {
[9] Fix | Delete
#endif
[10] Fix | Delete
[11] Fix | Delete
enum drm_lima_param_gpu_id {
[12] Fix | Delete
DRM_LIMA_PARAM_GPU_ID_UNKNOWN,
[13] Fix | Delete
DRM_LIMA_PARAM_GPU_ID_MALI400,
[14] Fix | Delete
DRM_LIMA_PARAM_GPU_ID_MALI450,
[15] Fix | Delete
};
[16] Fix | Delete
[17] Fix | Delete
enum drm_lima_param {
[18] Fix | Delete
DRM_LIMA_PARAM_GPU_ID,
[19] Fix | Delete
DRM_LIMA_PARAM_NUM_PP,
[20] Fix | Delete
DRM_LIMA_PARAM_GP_VERSION,
[21] Fix | Delete
DRM_LIMA_PARAM_PP_VERSION,
[22] Fix | Delete
};
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* get various information of the GPU
[26] Fix | Delete
*/
[27] Fix | Delete
struct drm_lima_get_param {
[28] Fix | Delete
__u32 param; /* in, value in enum drm_lima_param */
[29] Fix | Delete
__u32 pad; /* pad, must be zero */
[30] Fix | Delete
__u64 value; /* out, parameter value */
[31] Fix | Delete
};
[32] Fix | Delete
[33] Fix | Delete
/*
[34] Fix | Delete
* heap buffer dynamically increase backup memory size when GP task fail
[35] Fix | Delete
* due to lack of heap memory. size field of heap buffer is an up bound of
[36] Fix | Delete
* the backup memory which can be set to a fairly large value.
[37] Fix | Delete
*/
[38] Fix | Delete
#define LIMA_BO_FLAG_HEAP (1 << 0)
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* create a buffer for used by GPU
[42] Fix | Delete
*/
[43] Fix | Delete
struct drm_lima_gem_create {
[44] Fix | Delete
__u32 size; /* in, buffer size */
[45] Fix | Delete
__u32 flags; /* in, buffer flags */
[46] Fix | Delete
__u32 handle; /* out, GEM buffer handle */
[47] Fix | Delete
__u32 pad; /* pad, must be zero */
[48] Fix | Delete
};
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* get information of a buffer
[52] Fix | Delete
*/
[53] Fix | Delete
struct drm_lima_gem_info {
[54] Fix | Delete
__u32 handle; /* in, GEM buffer handle */
[55] Fix | Delete
__u32 va; /* out, virtual address mapped into GPU MMU */
[56] Fix | Delete
__u64 offset; /* out, used to mmap this buffer to CPU */
[57] Fix | Delete
};
[58] Fix | Delete
[59] Fix | Delete
#define LIMA_SUBMIT_BO_READ 0x01
[60] Fix | Delete
#define LIMA_SUBMIT_BO_WRITE 0x02
[61] Fix | Delete
[62] Fix | Delete
/* buffer information used by one task */
[63] Fix | Delete
struct drm_lima_gem_submit_bo {
[64] Fix | Delete
__u32 handle; /* in, GEM buffer handle */
[65] Fix | Delete
__u32 flags; /* in, buffer read/write by GPU */
[66] Fix | Delete
};
[67] Fix | Delete
[68] Fix | Delete
#define LIMA_GP_FRAME_REG_NUM 6
[69] Fix | Delete
[70] Fix | Delete
/* frame used to setup GP for each task */
[71] Fix | Delete
struct drm_lima_gp_frame {
[72] Fix | Delete
__u32 frame[LIMA_GP_FRAME_REG_NUM];
[73] Fix | Delete
};
[74] Fix | Delete
[75] Fix | Delete
#define LIMA_PP_FRAME_REG_NUM 23
[76] Fix | Delete
#define LIMA_PP_WB_REG_NUM 12
[77] Fix | Delete
[78] Fix | Delete
/* frame used to setup mali400 GPU PP for each task */
[79] Fix | Delete
struct drm_lima_m400_pp_frame {
[80] Fix | Delete
__u32 frame[LIMA_PP_FRAME_REG_NUM];
[81] Fix | Delete
__u32 num_pp;
[82] Fix | Delete
__u32 wb[3 * LIMA_PP_WB_REG_NUM];
[83] Fix | Delete
__u32 plbu_array_address[4];
[84] Fix | Delete
__u32 fragment_stack_address[4];
[85] Fix | Delete
};
[86] Fix | Delete
[87] Fix | Delete
/* frame used to setup mali450 GPU PP for each task */
[88] Fix | Delete
struct drm_lima_m450_pp_frame {
[89] Fix | Delete
__u32 frame[LIMA_PP_FRAME_REG_NUM];
[90] Fix | Delete
__u32 num_pp;
[91] Fix | Delete
__u32 wb[3 * LIMA_PP_WB_REG_NUM];
[92] Fix | Delete
__u32 use_dlbu;
[93] Fix | Delete
__u32 _pad;
[94] Fix | Delete
union {
[95] Fix | Delete
__u32 plbu_array_address[8];
[96] Fix | Delete
__u32 dlbu_regs[4];
[97] Fix | Delete
};
[98] Fix | Delete
__u32 fragment_stack_address[8];
[99] Fix | Delete
};
[100] Fix | Delete
[101] Fix | Delete
#define LIMA_PIPE_GP 0x00
[102] Fix | Delete
#define LIMA_PIPE_PP 0x01
[103] Fix | Delete
[104] Fix | Delete
#define LIMA_SUBMIT_FLAG_EXPLICIT_FENCE (1 << 0)
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* submit a task to GPU
[108] Fix | Delete
*
[109] Fix | Delete
* User can always merge multi sync_file and drm_syncobj
[110] Fix | Delete
* into one drm_syncobj as in_sync[0], but we reserve
[111] Fix | Delete
* in_sync[1] for another task's out_sync to avoid the
[112] Fix | Delete
* export/import/merge pass when explicit sync.
[113] Fix | Delete
*/
[114] Fix | Delete
struct drm_lima_gem_submit {
[115] Fix | Delete
__u32 ctx; /* in, context handle task is submitted to */
[116] Fix | Delete
__u32 pipe; /* in, which pipe to use, GP/PP */
[117] Fix | Delete
__u32 nr_bos; /* in, array length of bos field */
[118] Fix | Delete
__u32 frame_size; /* in, size of frame field */
[119] Fix | Delete
__u64 bos; /* in, array of drm_lima_gem_submit_bo */
[120] Fix | Delete
__u64 frame; /* in, GP/PP frame */
[121] Fix | Delete
__u32 flags; /* in, submit flags */
[122] Fix | Delete
__u32 out_sync; /* in, drm_syncobj handle used to wait task finish after submission */
[123] Fix | Delete
__u32 in_sync[2]; /* in, drm_syncobj handle used to wait before start this task */
[124] Fix | Delete
};
[125] Fix | Delete
[126] Fix | Delete
#define LIMA_GEM_WAIT_READ 0x01
[127] Fix | Delete
#define LIMA_GEM_WAIT_WRITE 0x02
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* wait pending GPU task finish of a buffer
[131] Fix | Delete
*/
[132] Fix | Delete
struct drm_lima_gem_wait {
[133] Fix | Delete
__u32 handle; /* in, GEM buffer handle */
[134] Fix | Delete
__u32 op; /* in, CPU want to read/write this buffer */
[135] Fix | Delete
__s64 timeout_ns; /* in, wait timeout in absulute time */
[136] Fix | Delete
};
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* create a context
[140] Fix | Delete
*/
[141] Fix | Delete
struct drm_lima_ctx_create {
[142] Fix | Delete
__u32 id; /* out, context handle */
[143] Fix | Delete
__u32 _pad; /* pad, must be zero */
[144] Fix | Delete
};
[145] Fix | Delete
[146] Fix | Delete
/**
[147] Fix | Delete
* free a context
[148] Fix | Delete
*/
[149] Fix | Delete
struct drm_lima_ctx_free {
[150] Fix | Delete
__u32 id; /* in, context handle */
[151] Fix | Delete
__u32 _pad; /* pad, must be zero */
[152] Fix | Delete
};
[153] Fix | Delete
[154] Fix | Delete
#define DRM_LIMA_GET_PARAM 0x00
[155] Fix | Delete
#define DRM_LIMA_GEM_CREATE 0x01
[156] Fix | Delete
#define DRM_LIMA_GEM_INFO 0x02
[157] Fix | Delete
#define DRM_LIMA_GEM_SUBMIT 0x03
[158] Fix | Delete
#define DRM_LIMA_GEM_WAIT 0x04
[159] Fix | Delete
#define DRM_LIMA_CTX_CREATE 0x05
[160] Fix | Delete
#define DRM_LIMA_CTX_FREE 0x06
[161] Fix | Delete
[162] Fix | Delete
#define DRM_IOCTL_LIMA_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GET_PARAM, struct drm_lima_get_param)
[163] Fix | Delete
#define DRM_IOCTL_LIMA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GEM_CREATE, struct drm_lima_gem_create)
[164] Fix | Delete
#define DRM_IOCTL_LIMA_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_LIMA_GEM_INFO, struct drm_lima_gem_info)
[165] Fix | Delete
#define DRM_IOCTL_LIMA_GEM_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_GEM_SUBMIT, struct drm_lima_gem_submit)
[166] Fix | Delete
#define DRM_IOCTL_LIMA_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_GEM_WAIT, struct drm_lima_gem_wait)
[167] Fix | Delete
#define DRM_IOCTL_LIMA_CTX_CREATE DRM_IOR(DRM_COMMAND_BASE + DRM_LIMA_CTX_CREATE, struct drm_lima_ctx_create)
[168] Fix | Delete
#define DRM_IOCTL_LIMA_CTX_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_LIMA_CTX_FREE, struct drm_lima_ctx_free)
[169] Fix | Delete
[170] Fix | Delete
#if defined(__cplusplus)
[171] Fix | Delete
}
[172] Fix | Delete
#endif
[173] Fix | Delete
[174] Fix | Delete
#endif /* __LIMA_DRM_H__ */
[175] Fix | Delete
[176] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function