diff options
author | Christian König <christian.koenig@amd.com> | 2018-07-13 03:50:08 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-16 17:11:51 -0400 |
commit | 050d9d43a7d3847fd9726a675bf644b124518425 (patch) | |
tree | 7dd68840be3320303521bcf36bbd0d1ff199e43f /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 9a6a8075bd439115b41468eaccdcb5e463196fb5 (diff) |
drm/amdgpu: cleanup job header
Move job related defines, structure and function declarations to
amdgpu_job.h
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c6c1e8dc919f..e0cc9f878e80 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #include "amdgpu_virt.h" | 73 | #include "amdgpu_virt.h" |
74 | #include "amdgpu_gart.h" | 74 | #include "amdgpu_gart.h" |
75 | #include "amdgpu_debugfs.h" | 75 | #include "amdgpu_debugfs.h" |
76 | #include "amdgpu_job.h" | ||
76 | 77 | ||
77 | /* | 78 | /* |
78 | * Modules parameters. | 79 | * Modules parameters. |
@@ -600,17 +601,6 @@ struct amdgpu_ib { | |||
600 | 601 | ||
601 | extern const struct drm_sched_backend_ops amdgpu_sched_ops; | 602 | extern const struct drm_sched_backend_ops amdgpu_sched_ops; |
602 | 603 | ||
603 | int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, | ||
604 | struct amdgpu_job **job, struct amdgpu_vm *vm); | ||
605 | int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size, | ||
606 | struct amdgpu_job **job); | ||
607 | |||
608 | void amdgpu_job_free_resources(struct amdgpu_job *job); | ||
609 | void amdgpu_job_free(struct amdgpu_job *job); | ||
610 | int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, | ||
611 | struct drm_sched_entity *entity, void *owner, | ||
612 | struct dma_fence **f); | ||
613 | |||
614 | /* | 604 | /* |
615 | * Queue manager | 605 | * Queue manager |
616 | */ | 606 | */ |
@@ -1058,40 +1048,6 @@ struct amdgpu_cs_parser { | |||
1058 | struct drm_syncobj **post_dep_syncobjs; | 1048 | struct drm_syncobj **post_dep_syncobjs; |
1059 | }; | 1049 | }; |
1060 | 1050 | ||
1061 | #define AMDGPU_PREAMBLE_IB_PRESENT (1 << 0) /* bit set means command submit involves a preamble IB */ | ||
1062 | #define AMDGPU_PREAMBLE_IB_PRESENT_FIRST (1 << 1) /* bit set means preamble IB is first presented in belonging context */ | ||
1063 | #define AMDGPU_HAVE_CTX_SWITCH (1 << 2) /* bit set means context switch occured */ | ||
1064 | |||
1065 | struct amdgpu_job { | ||
1066 | struct drm_sched_job base; | ||
1067 | struct amdgpu_device *adev; | ||
1068 | struct amdgpu_vm *vm; | ||
1069 | struct amdgpu_ring *ring; | ||
1070 | struct amdgpu_sync sync; | ||
1071 | struct amdgpu_sync sched_sync; | ||
1072 | struct amdgpu_ib *ibs; | ||
1073 | struct dma_fence *fence; /* the hw fence */ | ||
1074 | uint32_t preamble_status; | ||
1075 | uint32_t num_ibs; | ||
1076 | void *owner; | ||
1077 | uint64_t fence_ctx; /* the fence_context this job uses */ | ||
1078 | bool vm_needs_flush; | ||
1079 | uint64_t vm_pd_addr; | ||
1080 | unsigned vmid; | ||
1081 | unsigned pasid; | ||
1082 | uint32_t gds_base, gds_size; | ||
1083 | uint32_t gws_base, gws_size; | ||
1084 | uint32_t oa_base, oa_size; | ||
1085 | uint32_t vram_lost_counter; | ||
1086 | |||
1087 | /* user fence handling */ | ||
1088 | uint64_t uf_addr; | ||
1089 | uint64_t uf_sequence; | ||
1090 | |||
1091 | }; | ||
1092 | #define to_amdgpu_job(sched_job) \ | ||
1093 | container_of((sched_job), struct amdgpu_job, base) | ||
1094 | |||
1095 | static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p, | 1051 | static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p, |
1096 | uint32_t ib_idx, int idx) | 1052 | uint32_t ib_idx, int idx) |
1097 | { | 1053 | { |