summaryrefslogtreecommitdiff
path: root/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2019-01-07 13:28:12 -0500
committerMarek Olšák <marek.olsak@amd.com>2019-01-16 16:39:25 -0500
commitf19afaa519c2aa51d8449168fa83a98f2f04e0e5 (patch)
tree25c5c9355b36d87aba170caf4a1356b3bd42deac /amdgpu/amdgpu_cs.c
parent98cff551b0d5e54f564e99207e9c1e8d110f0914 (diff)
amdgpu: add a faster BO list API
Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_cs.c')
-rw-r--r--amdgpu/amdgpu_cs.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 3b8231aa..5bedf748 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -731,6 +731,31 @@ drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
return 0;
}
+drm_public int amdgpu_cs_submit_raw2(amdgpu_device_handle dev,
+ amdgpu_context_handle context,
+ uint32_t bo_list_handle,
+ int num_chunks,
+ struct drm_amdgpu_cs_chunk *chunks,
+ uint64_t *seq_no)
+{
+ union drm_amdgpu_cs cs = {0};
+ uint64_t *chunk_array;
+ int i, r;
+
+ chunk_array = alloca(sizeof(uint64_t) * num_chunks);
+ for (i = 0; i < num_chunks; i++)
+ chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i];
+ cs.in.chunks = (uint64_t)(uintptr_t)chunk_array;
+ cs.in.ctx_id = context->id;
+ cs.in.bo_list_handle = bo_list_handle;
+ cs.in.num_chunks = num_chunks;
+ r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_CS,
+ &cs, sizeof(cs));
+ if (!r && seq_no)
+ *seq_no = cs.out.handle;
+ return r;
+}
+
drm_public void amdgpu_cs_chunk_fence_info_to_data(struct amdgpu_cs_fence_info *fence_info,
struct drm_amdgpu_cs_chunk_data *data)
{