summary refs log tree commit diff
path: root/pkgs/os-specific/linux/amdgpu-pro/patches/0005-Fix-vblank-calls.patch
blob: 99b54aca2ab001ec4cd560a3de46b0f6803d1b56 (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
136
From 1884ef3a813f3dac0029c7539654ba978635d5d3 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 05/11] Fix vblank calls

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

diff --git a/amd/amdgpu/amdgpu_display.c b/amd/amdgpu/amdgpu_display.c
index 8425b1d..d6cd383 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_abo, false) != 0)) {
diff --git a/amd/amdgpu/dce_v10_0.c b/amd/amdgpu/dce_v10_0.c
index 650d193..b1880ac 100644
--- a/amd/amdgpu/dce_v10_0.c
+++ b/amd/amdgpu/dce_v10_0.c
@@ -3342,7 +3342,11 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev,
 
 	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 ca03d8e..b654b64 100644
--- a/amd/amdgpu/dce_v11_0.c
+++ b/amd/amdgpu/dce_v11_0.c
@@ -3391,7 +3391,11 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev,
 
 	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 8e4dff7..b598caa 100644
--- a/amd/amdgpu/dce_v8_0.c
+++ b/amd/amdgpu/dce_v8_0.c
@@ -3252,7 +3252,11 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev,
 
 	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_virtual.c b/amd/amdgpu/dce_virtual.c
index 0c6e873..36e2094 100644
--- a/amd/amdgpu/dce_virtual.c
+++ b/amd/amdgpu/dce_virtual.c
@@ -746,11 +746,19 @@ static int dce_virtual_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 c5fcf5a..e9892d8 100644
--- a/amd/dal/amdgpu_dm/amdgpu_dm.c
+++ b/amd/dal/amdgpu_dm/amdgpu_dm.c
@@ -213,10 +213,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.11.0