1
0
flewkey-overlay/x11-drivers/evdi/files/evdi-9999-linux-6.0.2-fix.patch
listout 836a646d88
x11-drivers/evdi: Fix building for linux kernel 6.2 and up
There are some changes in linux kernel 6.2 that prevent building of
evdi. This patch fixes it for live ebuild (not sure if it can be
backported).

I'm also trying to get it merged upstream.

Reffer: https://github.com/DisplayLink/evdi/pull/401
Signed-off-by: listout <listout@protonmail.com>
2023-02-20 23:42:53 -08:00

54 lines
1.4 KiB
Diff

# Original patch was suggested by Crashdummyy.
#
# Since commit 9877d8f6bc374912b08dfe862cddbb78b395a5ef in the linux kernel feild
# fbdev has been renamed to info in struct drm_fb_helper.
#
# Reffer: DisplayLink#394
# Reffer: DisplayLink#384
--- a/evdi_fb.c
+++ b/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, 1, 12) >= LINUX_VERSION_CODE
efbdev->helper.fbdev = info;
+#else
+ efbdev->helper.info = 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, 1, 12) >= LINUX_VERSION_CODE
if (efbdev->helper.fbdev) {
info = efbdev->helper.fbdev;
+#else
+ if (efbdev->helper.info) {
+ info = efbdev->helper.info;
+#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, 1, 12) >= LINUX_VERSION_CODE
if (efbdev->helper.fbdev) {
struct fb_info *info;
info = efbdev->helper.fbdev;
+#else
+ if (efbdev->helper.info) {
+ struct fb_info *info;
+
+ info = efbdev->helper.info;
+#endif
#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || defined(EL8)
unregister_framebuffer(info);
#else