aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-graphics/drm/files/0046-amdgpu-fix-for-submition-with-no-ibs.patch
blob: 0af5f5093b99f0cb98e95804e0be414b8c96b4b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 8494f5ecd3dae4266805c809f894495a29e73b38 Mon Sep 17 00:00:00 2001
From: Ken Wang <Qingqing.Wang@amd.com>
Date: Thu, 4 Feb 2016 13:52:22 +0800
Subject: [PATCH 046/117] amdgpu: fix for submition with no ibs

Change-Id: I0b582ff0021c02fad9d77d51971a48d9ee5d1146
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Acked-by: Alex Deucher <Alexander.Deucher@amd.com>
---
 amdgpu/amdgpu_cs.c       | 8 ++++++++
 amdgpu/amdgpu_internal.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 896352b..0c9bcc4 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -190,6 +190,10 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
 		return -EINVAL;
 	if (ibs_request->number_of_ibs > AMDGPU_CS_MAX_IBS_PER_SUBMIT)
 		return -EINVAL;
+	if (ibs_request->number_of_ibs == 0) {
+		ibs_request->seq_no = AMDGPU_NULL_SUBMIT_SEQ;
+		return 0;
+	}
 	user_fence = (ibs_request->fence_info.handle != NULL);
 
 	size = ibs_request->number_of_ibs + (user_fence ? 2 : 1) + 1;
@@ -422,6 +426,10 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
 		return -EINVAL;
 	if (fence->ring >= AMDGPU_CS_MAX_RINGS)
 		return -EINVAL;
+	if (fence->fence == AMDGPU_NULL_SUBMIT_SEQ) {
+		*expired = true;
+		return 0;
+	}
 
 	*expired = false;
 
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 3760f94..1160a12 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -44,6 +44,7 @@
 #define ROUND_DOWN(x, y) ((x) & ~__round_mask(x, y))
 
 #define AMDGPU_INVALID_VA_ADDRESS	0xffffffffffffffff
+#define AMDGPU_NULL_SUBMIT_SEQ		0
 
 struct amdgpu_bo_va_hole {
 	struct list_head list;
-- 
2.7.4