0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef __AMDGPU_CS_H__
0024 #define __AMDGPU_CS_H__
0025
0026 #include "amdgpu_job.h"
0027 #include "amdgpu_bo_list.h"
0028 #include "amdgpu_ring.h"
0029
0030 struct amdgpu_bo_va_mapping;
0031
0032 struct amdgpu_cs_chunk {
0033 uint32_t chunk_id;
0034 uint32_t length_dw;
0035 void *kdata;
0036 };
0037
0038 struct amdgpu_cs_post_dep {
0039 struct drm_syncobj *syncobj;
0040 struct dma_fence_chain *chain;
0041 u64 point;
0042 };
0043
0044 struct amdgpu_cs_parser {
0045 struct amdgpu_device *adev;
0046 struct drm_file *filp;
0047 struct amdgpu_ctx *ctx;
0048
0049
0050 unsigned nchunks;
0051 struct amdgpu_cs_chunk *chunks;
0052
0053
0054 struct amdgpu_job *job;
0055 struct drm_sched_entity *entity;
0056
0057
0058 struct ww_acquire_ctx ticket;
0059 struct amdgpu_bo_list *bo_list;
0060 struct amdgpu_mn *mn;
0061 struct amdgpu_bo_list_entry vm_pd;
0062 struct list_head validated;
0063 struct dma_fence *fence;
0064 uint64_t bytes_moved_threshold;
0065 uint64_t bytes_moved_vis_threshold;
0066 uint64_t bytes_moved;
0067 uint64_t bytes_moved_vis;
0068
0069
0070 struct amdgpu_bo_list_entry uf_entry;
0071
0072 unsigned num_post_deps;
0073 struct amdgpu_cs_post_dep *post_deps;
0074 };
0075
0076 int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
0077 uint64_t addr, struct amdgpu_bo **bo,
0078 struct amdgpu_bo_va_mapping **mapping);
0079
0080 #endif