summaryrefslogtreecommitdiff
path: root/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAndres Rodriguez <andresx7@gmail.com>2017-10-20 10:57:59 -0400
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2017-10-20 21:51:02 +0200
commit35bc82cee9aab62d556e2ea6dfe29f71ce13dcb3 (patch)
tree7f35ba43a4ab4878e222fa2e811031c04a4e1629 /amdgpu/amdgpu.h
parentbcae7226a1c36bee22ad747dc12960e52a706cfa (diff)
downloadlibdrm-35bc82cee9aab62d556e2ea6dfe29f71ce13dcb3.tar.gz
libdrm-35bc82cee9aab62d556e2ea6dfe29f71ce13dcb3.tar.bz2
libdrm-35bc82cee9aab62d556e2ea6dfe29f71ce13dcb3.zip
amdgpu: implement context priority for amdgpu_cs_ctx_create2 v3
Add a new context creation function that allows specifying the context priority. A high priority context has the potential of starving lower priority contexts. The current kernel driver implementation allows only apps that hold CAP_SYS_NICE or DRM_MASTER to acquire a priority above AMDGPU_CTX_PRIORITY_NORMAL. v2: corresponding changes for kernel patch v2 v3: Fixed 'make check' symbol error Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Diffstat (limited to 'amdgpu/amdgpu.h')
-rw-r--r--amdgpu/amdgpu.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 23cde108..ecc975f1 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -798,8 +798,9 @@ int amdgpu_bo_list_update(amdgpu_bo_list_handle handle,
* context will always be executed in order (first come, first serve).
*
*
- * \param dev - \c [in] Device handle. See #amdgpu_device_initialize()
- * \param context - \c [out] GPU Context handle
+ * \param dev - \c [in] Device handle. See #amdgpu_device_initialize()
+ * \param priority - \c [in] Context creation flags. See AMDGPU_CTX_PRIORITY_*
+ * \param context - \c [out] GPU Context handle
*
* \return 0 on success\n
* <0 - Negative POSIX Error code
@@ -807,6 +808,18 @@ int amdgpu_bo_list_update(amdgpu_bo_list_handle handle,
* \sa amdgpu_cs_ctx_free()
*
*/
+int amdgpu_cs_ctx_create2(amdgpu_device_handle dev,
+ uint32_t priority,
+ amdgpu_context_handle *context);
+/**
+ * Create GPU execution Context
+ *
+ * Refer to amdgpu_cs_ctx_create2 for full documentation. This call
+ * is missing the priority parameter.
+ *
+ * \sa amdgpu_cs_ctx_create2()
+ *
+*/
int amdgpu_cs_ctx_create(amdgpu_device_handle dev,
amdgpu_context_handle *context);