diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2018-06-28 22:51:32 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-10 15:17:29 -0400 |
commit | 2aa37bf58838fd0251e0e6819767ffc8a83eac38 (patch) | |
tree | a8bac37a94651f3e331b7bcb555a80fd8613f329 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | |
parent | bd4e725084189a198ca47d369d85100216d29b7e (diff) |
drm/amdgpu: Add support for logging process info in amdgpu_vm.
Add process and thread names and pids and a function to extract
this info from relevant amdgpu_vm.
v2: Add documentation and fix identation.
v3: Add getter and setter functions for amdgpu_task_info.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Jim Qu <Jim.Qu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 061b99a18cb8..d416f895233d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | |||
@@ -164,6 +164,14 @@ struct amdgpu_vm_pt { | |||
164 | #define AMDGPU_VM_FAULT_PASID(fault) ((u64)(fault) >> 48) | 164 | #define AMDGPU_VM_FAULT_PASID(fault) ((u64)(fault) >> 48) |
165 | #define AMDGPU_VM_FAULT_ADDR(fault) ((u64)(fault) & 0xfffffffff000ULL) | 165 | #define AMDGPU_VM_FAULT_ADDR(fault) ((u64)(fault) & 0xfffffffff000ULL) |
166 | 166 | ||
167 | |||
168 | struct amdgpu_task_info { | ||
169 | char process_name[TASK_COMM_LEN]; | ||
170 | char task_name[TASK_COMM_LEN]; | ||
171 | pid_t pid; | ||
172 | pid_t tgid; | ||
173 | }; | ||
174 | |||
167 | struct amdgpu_vm { | 175 | struct amdgpu_vm { |
168 | /* tree of virtual addresses mapped */ | 176 | /* tree of virtual addresses mapped */ |
169 | struct rb_root_cached va; | 177 | struct rb_root_cached va; |
@@ -215,6 +223,9 @@ struct amdgpu_vm { | |||
215 | 223 | ||
216 | /* Valid while the PD is reserved or fenced */ | 224 | /* Valid while the PD is reserved or fenced */ |
217 | uint64_t pd_phys_addr; | 225 | uint64_t pd_phys_addr; |
226 | |||
227 | /* Some basic info about the task */ | ||
228 | struct amdgpu_task_info task_info; | ||
218 | }; | 229 | }; |
219 | 230 | ||
220 | struct amdgpu_vm_manager { | 231 | struct amdgpu_vm_manager { |
@@ -317,4 +328,9 @@ bool amdgpu_vm_need_pipeline_sync(struct amdgpu_ring *ring, | |||
317 | struct amdgpu_job *job); | 328 | struct amdgpu_job *job); |
318 | void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev); | 329 | void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev); |
319 | 330 | ||
331 | void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid, | ||
332 | struct amdgpu_task_info *task_info); | ||
333 | |||
334 | void amdgpu_vm_set_task_info(struct amdgpu_vm *vm); | ||
335 | |||
320 | #endif | 336 | #endif |