summary refs log tree commit diff
path: root/pkgs/os-specific/linux/amdgpu-pro/patches/0009-Fix-vblank-calls.patch
blob: 82db5905a459a8eace60037f6afe5a2a8021a7da (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
From 9da98ec93816277a2d4e93d3205da044bace08bc Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" <laguest@archeia.com>
Date: Sun, 25 Sep 2016 16:49:09 +0100
Subject: [PATCH 09/14] Fix vblank calls

---
 amd/amdgpu/amdgpu_display.c   | 8 ++++++++
 amd/amdgpu/dce_v10_0.c        | 8 ++++++++
 amd/amdgpu/dce_v11_0.c        | 8 ++++++++
 amd/amdgpu/dce_v8_0.c         | 8 ++++++++
 amd/dal/amdgpu_dm/amdgpu_dm.c | 4 ++++
 5 files changed, 36 insertions(+)

diff --git a/amd/amdgpu/amdgpu_display.c b/amd/amdgpu/amdgpu_display.c
index 862611c..267c65f 100644
--- a/amd/amdgpu/amdgpu_display.c
+++ b/amd/amdgpu/amdgpu_display.c
@@ -268,7 +268,11 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
 
 	work->base = base;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+	r = drm_crtc_vblank_get(crtc);
+#else
 	r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_id);
+#endif
 	if (r) {
 		DRM_ERROR("failed to get vblank before flip\n");
 		goto pflip_cleanup;
@@ -296,7 +300,11 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
 	return 0;
 
 vblank_cleanup:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
+#else
 	drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id);
+#endif
 
 pflip_cleanup:
 	if (unlikely(amdgpu_bo_reserve(new_rbo, false) != 0)) {
diff --git a/amd/amdgpu/dce_v10_0.c b/amd/amdgpu/dce_v10_0.c
index 0fd1e4f..5f0044c 100644
--- a/amd/amdgpu/dce_v10_0.c
+++ b/amd/amdgpu/dce_v10_0.c
@@ -3372,11 +3372,19 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev,
 
 	/* wakeup usersapce */
 	if (works->event)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
+#else
 		drm_send_vblank_event(adev->ddev, crtc_id, works->event);
+#endif
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
+#else
 	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+#endif
 	schedule_work(&works->unpin_work);
 
 	return 0;
diff --git a/amd/amdgpu/dce_v11_0.c b/amd/amdgpu/dce_v11_0.c
index a85eb5f..8edc670 100644
--- a/amd/amdgpu/dce_v11_0.c
+++ b/amd/amdgpu/dce_v11_0.c
@@ -3432,11 +3432,19 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev,
 
 	/* wakeup usersapce */
 	if(works->event)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
+#else
 		drm_send_vblank_event(adev->ddev, crtc_id, works->event);
+#endif
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
+#else
 	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+#endif
 	schedule_work(&works->unpin_work);
 
 	return 0;
diff --git a/amd/amdgpu/dce_v8_0.c b/amd/amdgpu/dce_v8_0.c
index 308f5e4..57e8014 100644
--- a/amd/amdgpu/dce_v8_0.c
+++ b/amd/amdgpu/dce_v8_0.c
@@ -3323,11 +3323,19 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev,
 
 	/* wakeup usersapce */
 	if (works->event)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
+#else
 		drm_send_vblank_event(adev->ddev, crtc_id, works->event);
+#endif
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
+#else
 	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+#endif
 	schedule_work(&works->unpin_work);
 
 	return 0;
diff --git a/amd/dal/amdgpu_dm/amdgpu_dm.c b/amd/dal/amdgpu_dm/amdgpu_dm.c
index 30865ec..f49999b 100644
--- a/amd/dal/amdgpu_dm/amdgpu_dm.c
+++ b/amd/dal/amdgpu_dm/amdgpu_dm.c
@@ -196,10 +196,14 @@ static void dm_pflip_high_irq(void *interrupt_params)
 
 	/* wakeup usersapce */
 	if(works->event)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
+#else
 		drm_send_vblank_event(
 			adev->ddev,
 			amdgpu_crtc->crtc_id,
 			works->event);
+#endif
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
-- 
2.10.1