summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-07-17 04:30:12 +0100
committerDave Airlie <airlied@redhat.com>2017-07-17 04:30:12 +0100
commita38e263571bde9e04e981341b6e93f629c4f6cf7 (patch)
tree9b3caa84a63df43999a992a82f5c6e28a2ede6f3
parente7f85d0ca617fa41e72624780c9035df132e23c4 (diff)
[rfc] amdgpu_drm, export context id and use in raw cs interfacedrm-amdgpu-cs-submit-raw
Expose the context id and use it in the raw CS interface? good/bad/indifferent?
-rw-r--r--amdgpu/amdgpu.h3
-rw-r--r--amdgpu/amdgpu_cs.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index f57a782e..e73d874c 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -840,6 +840,7 @@ int amdgpu_cs_ctx_free(amdgpu_context_handle context);
int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
uint32_t *state, uint32_t *hangs);
+uint32_t amdgpu_cs_get_ctx_id(amdgpu_context_handle context);
/*
* Command Buffers Management
*
@@ -1342,7 +1343,7 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev,
struct drm_amdgpu_cs_chunk;
int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
- amdgpu_context_handle *context,
+ uint32_t ctx_id,
uint32_t bo_list_handle,
int num_chunks,
struct drm_amdgpu_cs_chunk *chunks,
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index f71f1337..76602a67 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -136,6 +136,11 @@ int amdgpu_cs_ctx_free(amdgpu_context_handle context)
return r;
}
+uint32_t amdgpu_cs_get_ctx_id(amdgpu_context_handle context)
+{
+ return context->id;
+}
+
int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
uint32_t *state, uint32_t *hangs)
{
@@ -661,7 +666,7 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev,
}
int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
- amdgpu_context_handle *context,
+ uint32_t ctx_id,
uint32_t bo_list_handle,
int num_chunks,
struct drm_amdgpu_cs_chunk *chunks,
@@ -677,7 +682,7 @@ int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
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->ctx_id;
+ cs.in.ctx_id = ctx_id;
cs.in.bo_list_handle = bo_list_handle;
cs.in.num_chunks = num_chunks;
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_CS,