0

I'm trying to port https://github.com/kenballus/fl2000_drm_519, designed for linux 5.19, to linux 6.2.11, but after applying the patches attached below, I'm getting this error and I don't know how to fix it:

$ make
make CHECK="/usr/bin/sparse" -C /lib/modules/6.2.11-300.fc38.x86_64/build M=/home/guillem/Downloads/fl2000_drm_519 modules
make[1]: Entering directory '/usr/src/kernels/6.2.11-300.fc38.x86_64'
  MODPOST /home/guillem/Downloads/fl2000_drm_519/Module.symvers
ERROR: modpost: module fl2000 uses symbol dma_buf_end_cpu_access from namespace DMA_BUF, but does not import it.
ERROR: modpost: module fl2000 uses symbol dma_buf_begin_cpu_access from namespace DMA_BUF, but does not import it.
make[2]: *** [scripts/Makefile.modpost:138: /home/guillem/Downloads/fl2000_drm_519/Module.symvers] Error 1
make[1]: *** [Makefile:1977: modpost] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.2.11-300.fc38.x86_64'
make: *** [Makefile:21: modules] Error 2

I've patched fl2000.h this way for solving other import errors:

diff --git a/fl2000.h b/fl2000.h
index 718e247..c4a6910 100644
--- a/fl2000.h
+++ b/fl2000.h
@@ -23,6 +23,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/time.h>
 #include <linux/device.h>
+#include <linux/dma-buf.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_prime.h>
 #include <drm/drm_vblank.h>
@@ -37,6 +38,8 @@
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_framebuffer.h>
+#include <drm/drm_fbdev_generic.h>

#include "fl2000_registers.h"
1
  • Welcome here! It's great that you found a solution. I believe that other people will stumble upon the same problem as you, but when working wiith other modules. Hence, I focused the title of your question on the universal aspect :) May 14, 2023 at 19:26

1 Answer 1

3

As the error suggest, you need to import that namespace.

The appropriate patch being just:

diff --git a/fl2000_drv.c b/fl2000_drv.c
index 31b7ef4..218b87a 100644
--- a/fl2000_drv.c
+++ b/fl2000_drv.c
@@ -195,3 +195,4 @@ module_usb_driver(fl2000_driver);
 MODULE_AUTHOR("Artem Mygaiev");
 MODULE_DESCRIPTION("FL2000 USB display driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(DMA_BUF);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .