amdgpu: use amdgpu_cs_submit_raw2 in amdgpu_cs_submit
So far, amdgpu_cs_submit_raw2 is mainly used for upper layer (Mesa), however, amdgpu_cs_submit is used for current all unit tests. Our intention is that the unit tests can actually verify the API which is really used. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>main
parent
fca0849af3
commit
cf9eb78a89
|
@ -226,9 +226,11 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
|
||||||
struct drm_amdgpu_cs_chunk_data *chunk_data;
|
struct drm_amdgpu_cs_chunk_data *chunk_data;
|
||||||
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;
|
||||||
|
amdgpu_device_handle dev = context->dev;
|
||||||
struct list_head *sem_list;
|
struct list_head *sem_list;
|
||||||
amdgpu_semaphore_handle sem, tmp;
|
amdgpu_semaphore_handle sem, tmp;
|
||||||
uint32_t i, size, sem_count = 0;
|
uint32_t i, size, sem_count = 0;
|
||||||
|
uint64_t seq_no;
|
||||||
bool user_fence;
|
bool user_fence;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
|
@ -354,12 +356,12 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
|
||||||
chunks[i].chunk_data = (uint64_t)(uintptr_t)sem_dependencies;
|
chunks[i].chunk_data = (uint64_t)(uintptr_t)sem_dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CS,
|
r = amdgpu_cs_submit_raw2(dev, context, cs.in.bo_list_handle, cs.in.num_chunks,
|
||||||
&cs, sizeof(cs));
|
chunks, &seq_no);
|
||||||
if (r)
|
if (r)
|
||||||
goto error_unlock;
|
goto error_unlock;
|
||||||
|
|
||||||
ibs_request->seq_no = cs.out.handle;
|
ibs_request->seq_no = seq_no;
|
||||||
context->last_seq[ibs_request->ip_type][ibs_request->ip_instance][ibs_request->ring] = ibs_request->seq_no;
|
context->last_seq[ibs_request->ip_type][ibs_request->ip_instance][ibs_request->ring] = ibs_request->seq_no;
|
||||||
error_unlock:
|
error_unlock:
|
||||||
pthread_mutex_unlock(&context->sequence_mutex);
|
pthread_mutex_unlock(&context->sequence_mutex);
|
||||||
|
|
Loading…
Reference in New Issue