amdgpu: list each entry safely for sw semaphore when submit ib

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: David Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
main
Junwei Zhang 2015-12-08 08:34:55 +08:00 committed by Marek Olšák
parent d4d4184363
commit 6b79c66b84
1 changed files with 2 additions and 2 deletions

View File

@ -179,7 +179,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
struct drm_amdgpu_cs_chunk_dep *dependencies = NULL; struct drm_amdgpu_cs_chunk_dep *dependencies = NULL;
struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL; struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL;
struct list_head *sem_list; struct list_head *sem_list;
amdgpu_semaphore_handle sem; amdgpu_semaphore_handle sem, tmp;
uint32_t i, size, sem_count = 0; uint32_t i, size, sem_count = 0;
bool user_fence; bool user_fence;
int r = 0; int r = 0;
@ -282,7 +282,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
goto error_unlock; goto error_unlock;
} }
sem_count = 0; sem_count = 0;
LIST_FOR_EACH_ENTRY(sem, sem_list, list) { LIST_FOR_EACH_ENTRY_SAFE(sem, tmp, sem_list, list) {
struct amdgpu_cs_fence *info = &sem->signal_fence; struct amdgpu_cs_fence *info = &sem->signal_fence;
struct drm_amdgpu_cs_chunk_dep *dep = &sem_dependencies[sem_count++]; struct drm_amdgpu_cs_chunk_dep *dep = &sem_dependencies[sem_count++];
dep->ip_type = info->ip_type; dep->ip_type = info->ip_type;