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
55
56
57
58
59
60
61
|
From 74704cfab29b0f24fa747314f6efb05078639782 Mon Sep 17 00:00:00 2001
From: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Date: Tue, 12 Dec 2017 10:55:06 +0800
Subject: [PATCH 2850/4131] drm/amdkcl: [4.8] do not pin fb for nonblocking
commits in atomic commit
Change-Id: Id2948478440dd53caead8b048057b1da2c6d8bdb
Signed-off-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 61a2067..fdcdb00 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4445,9 +4445,16 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
#else
int ret = 0;
- ret = drm_atomic_helper_prepare_planes(dev, state);
- if (ret)
- return ret;
+ /*
+ * Right now we receive async commit only from pageflip, in which case
+ * we should not pin/unpin the fb here, it should be done in
+ * amdgpu_crtc_flip and from the vblank irq handler.
+ */
+ if (!nonblock) {
+ ret = drm_atomic_helper_prepare_planes(dev, state);
+ if (ret)
+ return ret;
+ }
drm_atomic_helper_swap_state(dev, state);
@@ -4458,6 +4465,10 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
amdgpu_dm_atomic_commit_tail(state);
+ if (!nonblock) {
+ drm_atomic_helper_cleanup_planes(dev, state);
+ }
+
return ret;
#endif
}
@@ -4778,7 +4789,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
drm_atomic_helper_wait_for_flip_done(dev, state);
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || defined(OS_NAME_RHEL_7_4)
drm_atomic_helper_cleanup_planes(dev, state);
+#endif
}
--
2.7.4
|