summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-07-09 11:48:32 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-05 13:47:52 -0400
commit5463d2e83a450a0428f6c46561c5e2a54a229589 (patch)
tree91cb136737a4611ca7307e8cde499a6c40021c6b /amdgpu
parentf91b56dc8c604ec1c6f092d69550266d20dc9764 (diff)
downloadlibdrm-5463d2e83a450a0428f6c46561c5e2a54a229589.tar.gz
libdrm-5463d2e83a450a0428f6c46561c5e2a54a229589.tar.bz2
libdrm-5463d2e83a450a0428f6c46561c5e2a54a229589.zip
amdgpu: use common fence structure for dependencies as well.
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu.h39
-rw-r--r--amdgpu/amdgpu_cs.c4
2 files changed, 10 insertions, 33 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 027b549b..76319687 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -57,7 +57,7 @@ struct drm_amdgpu_info_hw_ip;
#define AMDGPU_TIMEOUT_INFINITE 0xffffffffffffffffull
/**
- * Used in amdgpu_cs_query_fence::flags, meaning that the given timeout
+ * Used in amdgpu_cs_query_fence_status(), meaning that the given timeout
* is absolute.
*/
#define AMDGPU_QUERY_FENCE_TIMEOUT_IS_ABSOLUTE (1 << 0)
@@ -266,13 +266,14 @@ struct amdgpu_gds_resource_info {
};
/**
- * Structure describing CS dependency
+ * Structure describing CS fence
*
- * \sa amdgpu_cs_request, amdgpu_cs_submit()
+ * \sa amdgpu_cs_query_fence_status(), amdgpu_cs_request, amdgpu_cs_submit()
*
*/
-struct amdgpu_cs_dep_info {
- /** Context to which the fence belongs */
+struct amdgpu_cs_fence {
+
+ /** In which context IB was sent to execution */
amdgpu_context_handle context;
/** To which HW IP type the fence belongs */
@@ -347,7 +348,7 @@ struct amdgpu_cs_request {
* Array of dependencies which need to be met before
* execution can start.
*/
- struct amdgpu_cs_dep_info *dependencies;
+ struct amdgpu_cs_fence *dependencies;
/** Number of IBs to submit in the field ibs. */
uint32_t number_of_ibs;
@@ -359,30 +360,6 @@ struct amdgpu_cs_request {
};
/**
- * Structure describing request to check submission state using fence
- *
- * \sa amdgpu_cs_query_fence_status()
- *
-*/
-struct amdgpu_cs_query_fence {
-
- /** In which context IB was sent to execution */
- amdgpu_context_handle context;
-
- /** To which HW IP type the fence belongs */
- unsigned ip_type;
-
- /** IP instance index if there are several IPs of the same type. */
- unsigned ip_instance;
-
- /** Ring index of the HW IP */
- uint32_t ring;
-
- /** Specify fence for which we need to check submission status.*/
- uint64_t fence;
-};
-
-/**
* Structure which provide information about GPU VM MC Address space
* alignments requirements
*
@@ -919,7 +896,7 @@ int amdgpu_cs_submit(amdgpu_context_handle context,
*
* \sa amdgpu_cs_submit()
*/
-int amdgpu_cs_query_fence_status(struct amdgpu_cs_query_fence *fence,
+int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
uint64_t timeout_ns,
uint64_t flags,
uint32_t *expired);
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 03b17819..91a7b059 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -259,7 +259,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
}
for (i = 0; i < ibs_request->number_of_dependencies; ++i) {
- struct amdgpu_cs_dep_info *info = &ibs_request->dependencies[i];
+ struct amdgpu_cs_fence *info = &ibs_request->dependencies[i];
struct drm_amdgpu_cs_chunk_dep *dep = &dependencies[i];
dep->ip_type = info->ip_type;
dep->ip_instance = info->ip_instance;
@@ -379,7 +379,7 @@ static int amdgpu_ioctl_wait_cs(amdgpu_context_handle context,
return 0;
}
-int amdgpu_cs_query_fence_status(struct amdgpu_cs_query_fence *fence,
+int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
uint64_t timeout_ns,
uint64_t flags,
uint32_t *expired)