summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-05-05 21:09:13 -0500
committerNicolai Hähnle <[email protected]>2016-06-01 22:52:18 +0200
commit8396ab42411ac231df5608f1bc93c9010e120c55 (patch)
treebc01c4daaacbb4496b5d6022f59506c3b9c6dce4 /src/gallium
parent25e1b8d366a6131bc9d46fe27f6bc476f05a7a58 (diff)
winsys/amdgpu: add amdgpu_cs_has_user_fence
v2: style change Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index e949874e28d..59b723d2eb8 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -220,6 +220,12 @@ amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx)
/* COMMAND SUBMISSION */
+static bool amdgpu_cs_has_user_fence(struct amdgpu_cs_context *cs)
+{
+ return cs->request.ip_type != AMDGPU_HW_IP_UVD &&
+ cs->request.ip_type != AMDGPU_HW_IP_VCE;
+}
+
static bool amdgpu_get_new_ib(struct radeon_winsys *ws, struct amdgpu_ib *ib,
struct amdgpu_cs_ib_info *info, unsigned ib_type)
{
@@ -690,8 +696,7 @@ void amdgpu_cs_submit_ib(struct amdgpu_cs *acs)
int i, r;
cs->request.fence_info.handle = NULL;
- if (cs->request.ip_type != AMDGPU_HW_IP_UVD &&
- cs->request.ip_type != AMDGPU_HW_IP_VCE) {
+ if (amdgpu_cs_has_user_fence(cs)) {
cs->request.fence_info.handle = acs->ctx->user_fence_bo;
cs->request.fence_info.offset = acs->ring_type;
}
@@ -748,8 +753,7 @@ void amdgpu_cs_submit_ib(struct amdgpu_cs *acs)
} else {
/* Success. */
uint64_t *user_fence = NULL;
- if (cs->request.ip_type != AMDGPU_HW_IP_UVD &&
- cs->request.ip_type != AMDGPU_HW_IP_VCE)
+ if (amdgpu_cs_has_user_fence(cs))
user_fence = acs->ctx->user_fence_cpu_address_base +
cs->request.fence_info.offset;
amdgpu_fence_submitted(cs->fence, &cs->request, user_fence);