}
+static void radv_amdgpu_request_to_fence(struct radv_amdgpu_ctx *ctx,
+ struct amdgpu_cs_fence *fence,
+ struct amdgpu_cs_request *req)
+{
+ fence->context = ctx->ctx;
+ fence->ip_type = req->ip_type;
+ fence->ip_instance = req->ip_instance;
+ fence->ring = req->ring;
+ fence->fence = req->seq_no;
+}
+
static struct radeon_winsys_fence *radv_amdgpu_create_fence()
{
struct radv_amdgpu_cs_fence *fence = calloc(1, sizeof(struct amdgpu_cs_fence));
amdgpu_bo_list_destroy(bo_list);
- if (fence) {
- fence->context = ctx->ctx;
- fence->ip_type = request.ip_type;
- fence->ip_instance = request.ip_instance;
- fence->ring = request.ring;
- fence->fence = request.seq_no;
- }
+ if (fence)
+ radv_amdgpu_request_to_fence(ctx, fence, &request);
+
ctx->last_seq_no = request.seq_no;
return r;
i += cnt;
}
- if (fence) {
- fence->context = ctx->ctx;
- fence->ip_type = request.ip_type;
- fence->ip_instance = request.ip_instance;
- fence->ring = request.ring;
- fence->fence = request.seq_no;
- }
+ if (fence)
+ radv_amdgpu_request_to_fence(ctx, fence, &request);
+
ctx->last_seq_no = request.seq_no;
return 0;
i += cnt;
}
- if (fence) {
- fence->context = ctx->ctx;
- fence->ip_type = request.ip_type;
- fence->ip_instance = request.ip_instance;
- fence->ring = request.ring;
- fence->fence = request.seq_no;
- }
+ if (fence)
+ radv_amdgpu_request_to_fence(ctx, fence, &request);
ctx->last_seq_no = request.seq_no;
-
return 0;
}