diff options
author | Marek Olšák <[email protected]> | 2019-02-04 17:31:11 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-04-23 11:28:56 -0400 |
commit | b99bed624662549684fc5c9e32bc892740438a89 (patch) | |
tree | 504e6917a8d696f65d30682b6ac1866ffae3c38c | |
parent | 437d032b7d4f2439f251f93ec03462034ee2219b (diff) |
winsys/amdgpu: reorder chunks, make BO_HANDLES first, IB and FENCE last
Tested-by: Dieter Nützel <[email protected]>
Acked-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 7260ea7d807..b147c6b679a 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -1366,20 +1366,11 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) struct drm_amdgpu_cs_chunk chunks[6]; unsigned num_chunks = 0; - /* Convert from dwords to bytes. */ - cs->ib[IB_MAIN].ib_bytes *= 4; - - /* IB */ - chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_IB; - chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_cs_chunk_ib) / 4; - chunks[num_chunks].chunk_data = (uintptr_t)&cs->ib[IB_MAIN]; - num_chunks++; - - /* Fence */ - if (has_user_fence) { - chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_FENCE; - chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_cs_chunk_fence) / 4; - chunks[num_chunks].chunk_data = (uintptr_t)&acs->fence_chunk; + /* BO list */ + if (!use_bo_list_create) { + chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_BO_HANDLES; + chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_bo_list_in) / 4; + chunks[num_chunks].chunk_data = (uintptr_t)&bo_list_in; num_chunks++; } @@ -1447,14 +1438,21 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) num_chunks++; } - /* BO list */ - if (!use_bo_list_create) { - chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_BO_HANDLES; - chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_bo_list_in) / 4; - chunks[num_chunks].chunk_data = (uintptr_t)&bo_list_in; + /* Fence */ + if (has_user_fence) { + chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_FENCE; + chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_cs_chunk_fence) / 4; + chunks[num_chunks].chunk_data = (uintptr_t)&acs->fence_chunk; num_chunks++; } + /* IB */ + cs->ib[IB_MAIN].ib_bytes *= 4; /* Convert from dwords to bytes. */ + chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_IB; + chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_cs_chunk_ib) / 4; + chunks[num_chunks].chunk_data = (uintptr_t)&cs->ib[IB_MAIN]; + num_chunks++; + assert(num_chunks <= ARRAY_SIZE(chunks)); r = amdgpu_cs_submit_raw2(ws->dev, acs->ctx->ctx, bo_list, |