forked from displaylink-rpm/displaylink-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Fix-compiling-on-EL8-distros-due-to-backports-presen.patch
203 lines (182 loc) · 7.2 KB
/
0001-Fix-compiling-on-EL8-distros-due-to-backports-presen.patch
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
From 92b02abe0e9effbfb6fb0fb3701e5f16438b4eed Mon Sep 17 00:00:00 2001
From: "Michael L. Young" <[email protected]>
Date: Wed, 29 Dec 2021 14:32:46 -0500
Subject: [PATCH] Fix compiling on EL8 distros due to backports present in
current kernel
---
module/evdi_drm_drv.c | 14 +++++++-------
module/evdi_fb.c | 10 +++++-----
module/evdi_gem.c | 10 +++++-----
module/evdi_modeset.c | 8 ++++----
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/module/evdi_drm_drv.c b/module/evdi_drm_drv.c
index 8d2afcd..f6912f4 100644
--- a/module/evdi_drm_drv.c
+++ b/module/evdi_drm_drv.c
@@ -41,7 +41,7 @@ struct drm_ioctl_desc evdi_painter_ioctls[] = {
DRM_UNLOCKED),
};
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
static const struct vm_operations_struct evdi_gem_vm_ops = {
.fault = evdi_gem_fault,
@@ -64,7 +64,7 @@ static const struct file_operations evdi_driver_fops = {
.llseek = noop_llseek,
};
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
static int evdi_enable_vblank(__always_unused struct drm_device *dev,
__always_unused unsigned int pipe)
@@ -91,21 +91,21 @@ static struct drm_driver driver = {
.postclose = evdi_driver_postclose,
/* gem hooks */
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
-#elif KERNEL_VERSION(5, 9, 0) <= LINUX_VERSION_CODE || defined(EL8)
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
+#elif KERNEL_VERSION(5, 9, 0) <= LINUX_VERSION_CODE
.gem_free_object_unlocked = evdi_gem_free_object,
#else
.gem_free_object = evdi_gem_free_object,
#endif
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
.gem_vm_ops = &evdi_gem_vm_ops,
#endif
.dumb_create = evdi_dumb_create,
.dumb_map_offset = evdi_gem_mmap,
-#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
.dumb_destroy = drm_gem_dumb_destroy,
#endif
@@ -118,7 +118,7 @@ static struct drm_driver driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = drm_gem_prime_import,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
.preclose = evdi_driver_preclose,
.gem_prime_export = drm_gem_prime_export,
diff --git a/module/evdi_fb.c b/module/evdi_fb.c
index 2e37ca3..e610b1e 100644
--- a/module/evdi_fb.c
+++ b/module/evdi_fb.c
@@ -25,7 +25,7 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_atomic.h>
-#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8)
#include <drm/drm_damage_helper.h>
#endif
#include "evdi_drm_drv.h"
@@ -221,7 +221,7 @@ static struct fb_ops evdifb_ops = {
};
#endif /* CONFIG_FB */
-#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
/*
* Function taken from
@@ -331,7 +331,7 @@ static void evdi_user_framebuffer_destroy(struct drm_framebuffer *fb)
static const struct drm_framebuffer_funcs evdifb_funcs = {
.create_handle = evdi_user_framebuffer_create_handle,
.destroy = evdi_user_framebuffer_destroy,
-#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8)
.dirty = drm_atomic_helper_dirtyfb,
#else
.dirty = evdi_user_framebuffer_dirty,
@@ -540,8 +540,8 @@ void evdi_fbdev_unplug(struct drm_device *dev)
if (efbdev->helper.fbdev) {
struct fb_info *info;
- info = efbdev->helper.fbdev;
-#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE
+ info = efbdev->helper.fbdev;
+#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || defined(EL8)
unregister_framebuffer(info);
#else
unlink_framebuffer(info);
diff --git a/module/evdi_gem.c b/module/evdi_gem.c
index d29c677..ed2ceef 100644
--- a/module/evdi_gem.c
+++ b/module/evdi_gem.c
@@ -21,7 +21,7 @@
#include <drm/drm_cache.h>
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
static const struct vm_operations_struct evdi_gem_vm_ops = {
.fault = evdi_gem_fault,
.open = drm_gem_vm_open,
@@ -76,7 +76,7 @@ struct evdi_gem_object *evdi_gem_alloc_object(struct drm_device *dev,
#endif
obj->resv = &obj->_resv;
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
obj->base.funcs = &gem_obj_funcs;
#endif
@@ -232,7 +232,7 @@ int evdi_gem_vmap(struct evdi_gem_object *obj)
int ret;
if (obj->base.import_attach) {
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
struct dma_buf_map map;
ret = dma_buf_vmap(obj->base.import_attach->dmabuf, &map);
@@ -260,7 +260,7 @@ int evdi_gem_vmap(struct evdi_gem_object *obj)
void evdi_gem_vunmap(struct evdi_gem_object *obj)
{
if (obj->base.import_attach) {
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(obj->vmapping);
dma_buf_vunmap(obj->base.import_attach->dmabuf, &map);
@@ -370,7 +370,7 @@ evdi_prime_import_sg_table(struct drm_device *dev,
return ERR_PTR(-ENOMEM);
}
-#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE || defined(EL8)
drm_prime_sg_to_page_array(sg, obj->pages, npages);
#else
drm_prime_sg_to_page_addr_arrays(sg, obj->pages, NULL, npages);
diff --git a/module/evdi_modeset.c b/module/evdi_modeset.c
index 8b91ccf..37b1857 100644
--- a/module/evdi_modeset.c
+++ b/module/evdi_modeset.c
@@ -62,14 +62,14 @@ static void evdi_crtc_set_nofb(__always_unused struct drm_crtc *crtc)
static void evdi_crtc_atomic_flush(
struct drm_crtc *crtc
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
, struct drm_atomic_state *state
#else
, __always_unused struct drm_crtc_state *old_state
#endif
)
{
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
#else
struct drm_crtc_state *crtc_state = crtc->state;
@@ -181,7 +181,7 @@ static struct drm_crtc_helper_funcs evdi_helper_funcs = {
.disable = evdi_crtc_disable
};
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
static int evdi_enable_vblank(__always_unused struct drm_crtc *crtc)
{
return 1;
@@ -202,7 +202,7 @@ static const struct drm_crtc_funcs evdi_crtc_funcs = {
.cursor_set2 = evdi_crtc_cursor_set,
.cursor_move = evdi_crtc_cursor_move,
-#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
.enable_vblank = evdi_enable_vblank,
.disable_vblank = evdi_disable_vblank,
#endif
--
2.27.0