aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/evdi-fix-build-with-linux-6.2.patch
blob: 0c53cd2ef7b1273297879b7e7de37bd2e63d6b56 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Fix the build with Linux 6.2:

https://github.com/DisplayLink/evdi/issues/402

Patch copied from upstream pull request:

https://github.com/DisplayLink/evdi/pull/401

From a90ecd5f0f09e976e4b8784fa16b92804138b1bd Mon Sep 17 00:00:00 2001
From: listout <listout@protonmail.com>
Date: Wed, 22 Feb 2023 13:09:40 +0530
Subject: [PATCH] Original patch was suggested by Crashdummyy.

Since commit 9877d8f6bc374912b08dfe862cddbb78b395a5ef
feild fbdev has been renamed to info in struct drm_fb_helper.

Fixes: https://github.com/DisplayLink/evdi/issues/402
Fixes: https://github.com/DisplayLink/evdi/issues/394
Fixes: https://github.com/DisplayLink/evdi/issues/384
Signed-off-by: listout <listout@protonmail.com>
---
 module/evdi_fb.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/module/evdi_fb.c b/module/evdi_fb.c
index 6b367fe8..f5de81f1 100644
--- a/module/evdi_fb.c
+++ b/module/evdi_fb.c
@@ -405,7 +405,11 @@ static int evdifb_create(struct drm_fb_helper *helper,
 	fb = &efbdev->efb.base;
 
 	efbdev->helper.fb = fb;
+#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE
+	efbdev->helper.info = info;
+#else
 	efbdev->helper.fbdev = info;
+#endif
 
 	strcpy(info->fix.id, "evdidrmfb");
 
@@ -459,8 +463,13 @@ static void evdi_fbdev_destroy(__always_unused struct drm_device *dev,
 {
 	struct fb_info *info;
 
+#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE
+	if (efbdev->helper.info) {
+		info = efbdev->helper.info;
+#else
 	if (efbdev->helper.fbdev) {
 		info = efbdev->helper.fbdev;
+#endif
 		unregister_framebuffer(info);
 		if (info->cmap.len)
 			fb_dealloc_cmap(&info->cmap);
@@ -537,10 +546,17 @@ void evdi_fbdev_unplug(struct drm_device *dev)
 		return;
 
 	efbdev = evdi->fbdev;
+#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE
+	if (efbdev->helper.info) {
+		struct fb_info *info;
+
+		info = efbdev->helper.info;
+#else
 	if (efbdev->helper.fbdev) {
 		struct fb_info *info;
 
 		info = efbdev->helper.fbdev;
+#endif
 #if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || defined(EL8)
 		unregister_framebuffer(info);
 #else