From 5463d2e83a450a0428f6c46561c5e2a54a229589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 9 Jul 2015 11:48:32 +0200 Subject: amdgpu: use common fence structure for dependencies as well. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König Reviewed-by: Marek Olšák Reviewed-by: Jammy Zhou --- amdgpu/amdgpu.h | 39 ++++++++------------------------------- amdgpu/amdgpu_cs.c | 4 ++-- 2 files changed, 10 insertions(+), 33 deletions(-) (limited to 'amdgpu') 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; @@ -358,30 +359,6 @@ struct amdgpu_cs_request { struct amdgpu_cs_ib_info *ibs; }; -/** - * 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) -- cgit v1.2.3