Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drmP.h removed in linux 5.5 #185

Closed
4 tasks done
sjau opened this issue Feb 1, 2020 · 36 comments
Closed
4 tasks done

drmP.h removed in linux 5.5 #185

sjau opened this issue Feb 1, 2020 · 36 comments

Comments

@sjau
Copy link

sjau commented Feb 1, 2020

Initially please make sure the problem hasn't been already addressed:

In Linux 5.5 the drmP.h was removed which causes breakage as

module/evdi_drv.c
module/evdi_drv.h

want to include that. Simply commenting out the drmP.h file in aforementions files breaks the compilation.

  AR      /build/source/module/built-in.a
   35 | struct drm_ioctl_desc evdi_painter_ioctls[] = {
   36 |  DRM_IOCTL_DEF_DRV(EVDI_CONNECT, evdi_painter_connect_ioctl,
      |                    ^~~~~~~~~~~~~~~~~~~
/build/source/module/evdi_drv.c:54:10: error: 'drm_poll' undeclared here (not in a function)
/build/source/module/evdi_drv.c:88:39: error: 'DRIVER_GEM' undeclared here (not in a function); did you mean 'DRIVER_DESC'?
      |   ^~~~~~
/build/source/module/evdi_drv.c:102:3: error: 'struct drm_driver' has no member named 'dumb_create'
      |                 ^~~~~~~~~~~~~~~~
  104 |  .dumb_destroy = drm_gem_dumb_destroy,
  106 |  .ioctls = evdi_painter_ioctls,
  111 |  .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
/build/source/module/evdi_drv.c:124:3: error: 'struct drm_driver' has no member named 'name'
  126 |  .date = DRIVER_DATE,
/build/source/module/evdi_drv.h:32:23: note: (near initialization for 'driver')
   32 | #define DRIVER_DATE   "20191204"
      |          ^~~~~~~~~~~
In file included from /build/source/module/evdi_drv.c:16:
/build/source/module/evdi_drv.h:34:27: note: (near initialization for 'driver')
   34 | #define DRIVER_MAJOR      1
  127 |  .major = DRIVER_MAJOR,
      |           ^~~~~~~~~~~~
In file included from /build/source/module/evdi_drv.c:16:
   35 | #define DRIVER_MINOR      6
  128 |  .minor = DRIVER_MINOR,
      |           ^~~~~~~~~~~~
   35 | #define DRIVER_MINOR      6
      |                           ^
  129 |  .patchlevel = DRIVER_PATCHLEVEL,
/build/source/module/evdi_drv.h:36:27: error: excess elements in struct initializer [-Werror]
   36 | #define DRIVER_PATCHLEVEL 4
      |                ^~~~~~~~~~~~~~~~~
/build/source/module/evdi_drv.h:36:27: note: (near initialization for 'driver')
   36 | #define DRIVER_PATCHLEVEL 4
      |                           ^
  129 |  .patchlevel = DRIVER_PATCHLEVEL,
      |                ^~~~~~~~~~~~~~~~~
/build/source/module/evdi_drv.c: In function 'evdi_add_device':
/build/source/module/evdi_drv.c:142:15: error: implicit declaration of function 'DMA_BIT_MASK'; did you mean 'MMF_INIT_MASK'? [-Werror=implicit-function-declaration]
  142 |   .dma_mask = DMA_BIT_MASK(32),
      |               MMF_INIT_MASK
/build/source/module/evdi_drv.c:147:6: error: implicit declaration of function 'dma_set_mask'; did you mean 'xa_set_mark'? [-Werror=implicit-function-declaration]
  147 |  if (dma_set_mask(&evdi_context.devices[evdi_context.dev_count]->dev,
      |      ^~~~~~~~~~~~

      |      xa_set_mark

/build/source/module/evdi_drv.c: In function 'evdi_platform_probe':
/build/source/module/evdi_drv.c:187:8: error: implicit declaration of function 'drm_dev_alloc'; did you mean 'pmd_alloc'? [-Werror=implicit-function-declaration]
  187 |  dev = drm_dev_alloc(&driver, &pdev->dev);
      |        ^~~~~~~~~~~~~
      |        pmd_alloc
/build/source/module/evdi_drv.c:187:6: error: assignment to 'struct drm_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  187 |  dev = drm_dev_alloc(&driver, &pdev->dev);
      |      ^
/build/source/module/evdi_drv.c:195:8: error: implicit declaration of function 'drm_dev_register'; did you mean 'driver_register'? [-Werror=implicit-function-declaration]
  195 |  ret = drm_dev_register(dev, 0);
      |        ^~~~~~~~~~~~~~~~
      |        driver_register
/build/source/module/evdi_drv.c:203:2: error: implicit declaration of function 'drm_dev_put'; did you mean 'drm_dev_dbg'? [-Werror=implicit-function-declaration]
  203 |  drm_dev_put(dev);
      |  ^~~~~~~~~~~
      |  drm_dev_dbg
/build/source/module/evdi_drv.c: In function 'evdi_platform_remove':
/build/source/module/evdi_drv.c:226:2: error: implicit declaration of function 'drm_dev_unplug'; did you mean 'drm_dev_dbg'? [-Werror=implicit-function-declaration]
  226 |  drm_dev_unplug(drm_dev);
      |  ^~~~~~~~~~~~~~
      |  drm_dev_dbg
In file included from /build/source/module/evdi_drv.h:28,
                 from /build/source/module/evdi_drv.c:16:
/build/source/module/evdi_drv.c: In function 'evdi_init':
/build/source/module/evdi_drv.c:343:10: error: invalid use of undefined type 'struct drm_driver'
  343 |   (driver.driver_features & DRIVER_ATOMIC) ? "yes" : "no");
      |          ^
/build/source/module/evdi_debug.h:24:44: note: in definition of macro 'EVDI_PRINTK'
   24 |   printk(KERN_LEVEL "evdi: " FORMAT_STR, ##__VA_ARGS__); \
      |                                            ^~~~~~~~~~~
/build/source/module/evdi_drv.c:342:2: note: in expansion of macro 'EVDI_INFO'
  342 |  EVDI_INFO("Atomic driver:%s",
      |  ^~~~~~~~~
/build/source/module/evdi_drv.c: At top level:
/build/source/module/evdi_drv.c:83:26: error: storage size of 'driver' isn't known
   83 | static struct drm_driver driver = {
      |                          ^~~~~~
/build/source/module/evdi_drv.c:83:26: error: storage size of 'driver' isn't known
cc1: all warnings being treated as errors

The nVidia drivers have the same issue, see discussion:

https://devtalk.nvidia.com/default/topic/1068332/linux/nvidia-driver-does-not-build-on-linux-v5-5-release-candidate-kernel/

@sjau sjau changed the title drmP.h remove in linux 5.5 drmP.h removed in linux 5.5 Feb 1, 2020
@zacharyburkett
Copy link

I just updated to 5.5.1 and am also experiencing this issue. I've tried to patch with by replacing headers.

First, I replaced <drm/drmP.h> with the following:
#include <drm/drm_file.h>
#include <drm/drm_drv.h>
#include <drm/drm_device.h>

However, it seems like <linux/reservation.h> is missing too.

I'm going to continue trying to patch this, as I need DisplayLink for work. However, I'd really appreciate some help.

@zacharyburkett
Copy link

The amount of changes necessary is making my head spin.

Maintainers, any assistance?

@zacharyburkett
Copy link

Seems there is a PR #182

@displaylink-dkurek
Copy link
Contributor

displaylink-dkurek commented Feb 4, 2020

Sorry guys, we are falling a bit behind the kernel releases.
I guess the best approach would be to make it 'kernel-by-kernel'
(recently there were quite a few changes in DRM subsystem).
#172 already has patches for 5.4, hopefully we will integrate them
shortly.

EDIT: accidentally wrote 4.4 instead of 5.4.

@sjau
Copy link
Author

sjau commented Feb 4, 2020

I assume you meant to write 5.4.

@displaylink-dkurek
Copy link
Contributor

Yes, 5.4. Edited :). Thanks.

@abucodonosor
Copy link
Contributor

Sorry guys, we are falling a bit behind the kernel releases.
I guess the best approach would be to make it 'kernel-by-kernel'
(recently there were quite a few changes in DRM subsystem).
#172 already has patches for 5.4, hopefully we will integrate them
shortly.

EDIT: accidentally wrote 4.4 instead of 5.4.

I've made a test patch for 5.5, is not correct because I think each file should have correct includes also a lot #ifdef's needed but that is something you guys need to decide.
Also, the code fix needs #ifdef's. It works on top of the other patch for 5.4.

https://gitweb.frugalware.org/frugalware-current/raw/master/source/lib-extra/evdi/kernel-5.5-test.patch

Feel free to take this one too or use parts as you wish.

@Zetabite
Copy link

Zetabite commented Feb 7, 2020

having similar issues on arch on kernel 5.5.2, using the patch got me rid of the error drmP not existing, but now i have run into another and with that idk what i should do about it.

@abucodonosor
Copy link
Contributor

@Zetabite

what issue do you have now?

@kvaps
Copy link

kvaps commented Feb 7, 2020

@abucodonosor thanks, but patch isn't working for me too:

DKMS make.log for evdi-1.6.4 for kernel 5.5.2-arch1-1 (x86_64)
Fri Feb  7 13:02:52 CET 2020
make KBUILD_VERBOSE=1 SUBDIRS=/var/lib/dkms/evdi/1.6.4/build SRCROOT=/var/lib/dkms/evdi/1.6.4/build CONFIG_MODULE_SIG= -C /lib/modules/5.5.2-arch1-1/build modules
make[1]: Entering directory '/usr/lib/modules/5.5.2-arch1-1/build'
make -f ./scripts/Makefile.build obj=arch/x86/entry/syscalls all
make -f ./scripts/Makefile.build obj=scripts/basic
set -e; mkdir -p include/config/; { echo "5.5.2-arch1$(sh ./scripts/setlocalversion .)"; } > include/config/kernel.release.tmp; if [ -r include/config/kernel.release ] && cmp -s include/config/kernel.release include/config/kernel.release.tmp; then rm -f include/config/kernel.release.tmp; else : '  UPD     include/config/kernel.release'; mv -f include/config/kernel.release.tmp include/config/kernel.release; fi
make -f ./scripts/Makefile.asm-generic obj=arch/x86/include/generated/uapi/asm \
generic=include/uapi/asm-generic
set -e; mkdir -p include/generated/uapi/linux/; {       echo \#define LINUX_VERSION_CODE 328962; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; } > include/generated/uapi/linux/version.h.tmp; if [ -r include/generated/uapi/linux/version.h ] && cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/version.h.tmp; then rm -f include/generated/uapi/linux/version.h.tmp; else : '  UPD     include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/version.h.tmp include/generated/uapi/linux/version.h; fi
mkdir -p ./tools
make -f ./scripts/Makefile.modbuiltin obj=init
make LDFLAGS= MAKEFLAGS=" --jobserver-auth=3,4" O=/usr/lib/modules/5.5.2-arch1-1/build subdir=tools -C ./tools/ objtool
make -f ./scripts/Makefile.modbuiltin obj=usr
make -f ./scripts/Makefile.modbuiltin obj=arch/x86
rm -f include/linux/version.h
make[2]: Nothing to be done for 'objtool'.
make -f ./scripts/Makefile.modbuiltin obj=kernel
scripts/Makefile.build:42: arch/x86/entry/syscalls/Makefile: No such file or directory
make[2]: *** No rule to make target 'arch/x86/entry/syscalls/Makefile'.  Stop.
make[1]: *** [arch/x86/Makefile:238: archheaders] Error 2
make[1]: *** Waiting for unfinished jobs....
rm -f .tmp_quiet_recordmcount
scripts/Makefile.modbuiltin:26: init/Makefile: No such file or directory
make[2]: *** No rule to make target 'init/Makefile'.  Stop.
make[1]: *** [Makefile:1297: _modbuiltin_init] Error 2
scripts/Makefile.modbuiltin:26: usr/Makefile: No such file or directory
make[2]: *** No rule to make target 'usr/Makefile'.  Stop.
make[1]: *** [Makefile:1297: _modbuiltin_usr] Error 2
make -f ./scripts/Makefile.modbuiltin obj=kernel/bpf
make -f ./scripts/Makefile.modbuiltin obj=kernel/cgroup
make -f ./scripts/Makefile.modbuiltin obj=kernel/dma
make -f ./scripts/Makefile.modbuiltin obj=kernel/events
make -f ./scripts/Makefile.modbuiltin obj=kernel/irq
make -f ./scripts/Makefile.modbuiltin obj=kernel/livepatch
scripts/Makefile.modbuiltin:26: kernel/bpf/Makefile: No such file or directory
make[3]: *** No rule to make target 'kernel/bpf/Makefile'.  Stop.
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/bpf] Error 2
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.modbuiltin:26: kernel/cgroup/Makefile: No such file or directory
make[3]: *** No rule to make target 'kernel/cgroup/Makefile'.  Stop.
scripts/Makefile.modbuiltin:26: kernel/dma/Makefile: No such file or directory
make[3]: *** No rule to make target 'kernel/dma/Makefile'.  Stop.
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/cgroup] Error 2
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/dma] Error 2
scripts/Makefile.modbuiltin:26: kernel/irq/Makefile: No such file or directory
make[3]: *** No rule to make target 'kernel/irq/Makefile'.  Stop.
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/irq] Error 2
scripts/Makefile.modbuiltin:26: kernel/livepatch/Makefile: No such file or directory
scripts/Makefile.modbuiltin:26: kernel/events/Makefile: No such file or directory
make[3]: *** No rule to make target 'kernel/livepatch/Makefile'.  Stop.
make[3]: *** No rule to make target 'kernel/events/Makefile'.  Stop.
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/events] Error 2
make[2]: *** [scripts/Makefile.modbuiltin:55: kernel/livepatch] Error 2
make[1]: *** [Makefile:1297: _modbuiltin_kernel] Error 2
scripts/Kbuild.include:120: *** Recursive variable 'CC_OPTION_CFLAGS' references itself (eventually).  Stop.
make[1]: *** [Makefile:1297: _modbuiltin_arch/x86] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.5.2-arch1-1/build'
make: *** [Makefile:22: all] Error 2

@Zetabite
Copy link

Zetabite commented Feb 7, 2020

same as @kvaps

@abucodonosor
Copy link
Contributor

@kvaps @Zetabite

looks like you are using DKMS?, If so you are missing one fix I think.

  1. Apply patch from Fails to build on kernel 5.4 #172 (comment)
  2. Use DKMS fix from Fails to build on kernel 5.4 #172 (comment)
  3. Apply patch from drmP.h removed in linux 5.5 #185 (comment)

@abucodonosor
Copy link
Contributor

@Zetabite

Uh yeah, you can ignore that one. But let me do a quick all in one re-diff for you guys

@Zetabite
Copy link

Zetabite commented Feb 7, 2020

@abucodonosor that made it work, thank you very much

@abucodonosor
Copy link
Contributor

There a re-diff with all 3 fixes against current git code, should work on released code too.

https://crazy.dev.frugalware.org/all-in-one-kernel-5.4-and-5.5-test.patch

@Zetabite
Copy link

Zetabite commented Feb 7, 2020

ill test this one

@kvaps
Copy link

kvaps commented Feb 7, 2020

failed
make.log

@kvaps
Copy link

kvaps commented Feb 7, 2020

https://crazy.dev.frugalware.org/all-in-one-kernel-5.4-and-5.5-test.patch

this patch built succesful

@Zetabite
Copy link

Zetabite commented Feb 7, 2020

patch results in a successful build

@sjau
Copy link
Author

sjau commented Feb 7, 2020

Awesome. I'll test it tonight as well.

@abucodonosor
Copy link
Contributor

@kvaps @Zetabite

Ok. Happy testing then :-).

@kvaps
Copy link

kvaps commented Feb 7, 2020

With patch from #185 (comment) evdi is working fine for me

# uname -r
5.5.2-arch1-1

@abucodonosor thanks a lot!

@resingm
Copy link

resingm commented Feb 8, 2020

Do you mind pushing it? Would be great to see it on AUR soon.

@sjau
Copy link
Author

sjau commented Feb 9, 2020

I tried the all-in-one patch but wasn't successful:

/build/source/module/evdi_connector.c: In function 'evdi_best_encoder':
/build/source/module/evdi_connector.c:113:60: error: macro "drm_connector_for_each_possible_encoder" requires 3 arguments, but only 2 given
  113 |  drm_connector_for_each_possible_encoder(connector, encoder)
      |                                                            ^
In file included from /build/source/module/evdi_connector.c:14:
/nix/store/l4ffh6hzgd156qmp1b93a3kfw1k48w82-linux-5.4.14-dev/lib/modules/5.4.14/source/include/drm/drm_connector.h:1613: note: macro "drm_connector_for_each_possible_encoder" defined here
 1613 | #define drm_connector_for_each_possible_encoder(connector, encoder, __i) \
      |
'/nix/store/bmwcf9dlnzzjbma5ckb7p581lny1h3kb-busybox-1.31.1/bin/route' -> '/nix/store/zzcvb50qh1fw807ls282yh958q9ar5hx-extra-utils/bin/route'
/build/source/module/evdi_connector.c:113:2: error: 'drm_connector_for_each_possible_encoder' undeclared (first use in this function); did you mean 'drm_connector_has_possible_encoder'?
  113 |  drm_connector_for_each_possible_encoder(connector, encoder)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |  drm_connector_has_possible_encoder
/build/source/module/evdi_connector.c:113:2: note: each undeclared identifier is reported only once for each function it appears in
/build/source/module/evdi_connector.c:113:41: error: expected ';' before 'return'
  113 |  drm_connector_for_each_possible_encoder(connector, encoder)
      |                                         ^
      |                                         ;
  114 |                return encoder;
      |                ~~~~~~
/build/source/module/evdi_connector.c:111:22: error: unused variable 'encoder' [-Werror=unused-variable]
  111 |  struct drm_encoder *encoder;
      |                      ^~~~~~~
/build/source/module/evdi_connector.c:108:68: error: unused parameter 'connector' [-Werror=unused-parameter]
  108 | static struct drm_encoder *evdi_best_encoder(struct drm_connector *connector)
      |                                              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
'/nix/store/bmwcf9dlnzzjbma5ckb7p581lny1h3kb-busybox-1.31.1/bin/rpm' -> '/nix/store/zzcvb50qh1fw807ls282yh958q9ar5hx-extra-utils/bin/rpm'
cc1: all warnings being treated as errors
make[4]: *** [/nix/store/l4ffh6hzgd156qmp1b93a3kfw1k48w82-linux-5.4.14-dev/lib/modules/5.4.14/source/scripts/Makefile.build:266: /build/source/module/evdi_connector.o] Error 1
make[3]: *** [/nix/store/l4ffh6hzgd156qmp1b93a3kfw1k48w82-linux-5.4.14-dev/lib/modules/5.4.14/source/Makefile:1652: /build/source/module] Error 2
make[2]: *** [/nix/store/l4ffh6hzgd156qmp1b93a3kfw1k48w82-linux-5.4.14-dev/lib/modules/5.4.14/source/Makefile:179: sub-make] Error 2
make[2]: Leaving directory '/nix/store/l4ffh6hzgd156qmp1b93a3kfw1k48w82-linux-5.4.14-dev/lib/modules/5.4.14/build'
make[1]: *** [Makefile:67: module] Error 2
make[1]: Leaving directory '/build/source/module'
make: *** [Makefile:8: all] Error 2

@abucodonosor
Copy link
Contributor

@sjau

Actually, the patch is missing #ifdef's for kernel 5.4 so it only compiles with a kernel 5.5.x.

@selvagg
Copy link

selvagg commented Feb 9, 2020

Can we please have this fix pushed to AUR?

@sjau
Copy link
Author

sjau commented Feb 11, 2020

@sjau
Actually, the patch is missing #ifdef's for kernel 5.4 so it only compiles with a kernel 5.5.x.

well, it was indicated as:

5.4 and 5.5 "all-in-one-kernel-5.4-and-5.5-test.patch"

@displaylink-dkurek
Copy link
Contributor

OK, so update for kernel 5.4, 5.5 and changes for DKMS build landed on devel. Hopefully I haven't missed anything :)

@ViggoGaming
Copy link

When is this in the aur?

@abucodonosor
Copy link
Contributor

@ViggoGaming

Why do you think it is appropriate to ask here about Distribution specific packaging things in here?

Please use the appropriate Distribution mechanisms for that, in this case,
https://aur.archlinux.org/packages/evdi/

Thx

@devnix
Copy link

devnix commented Feb 24, 2020

Neither the patch on latest tag or the branch devel will work for me, getting the same drmP.h errors when running sudo dkms install evdi/5.2.14

@sjau
Copy link
Author

sjau commented Feb 24, 2020

Works for me with latest devel and kernel 5.5

@devnix
Copy link

devnix commented Feb 24, 2020

@sjau Which patch of 5.5? I'm trying to compile it on 5.5.5

@sjau
Copy link
Author

sjau commented Feb 24, 2020

Linux subi 5.5.5 #1-NixOS SMP Wed Feb 19 18:54:14 UTC 2020 x86_64 GNU/Linux

@devnix
Copy link

devnix commented Feb 24, 2020

Wow, it's very odd. If it helps, I'm using Ubuntu. I guess I'll try later with a VM

@a-anjos
Copy link

a-anjos commented Apr 27, 2020

What I did on Debian Bullseye Kernel 5.5, X1C6, docking Thinkpad 40AF:

1 - Download https://www.displaylink.com/downloads/file?id=1369, and:

./displaylink-driver-5.2.14.run --keep --noexec
cd displaylink-driver-5.2.14/

2 - Download https://github.com/DisplayLink/evdi/archive/devel.zip and extract the content.
3 - Replace the contents of displaylink-driver-5.2.14/evdi-5.2.14-src.tar.gz with the contents of evdi-devel/module (don't change the file name).
4 - Created soft link (modify according to your kernel version):

cd /lib/modules/5.5.0-2-amd64/ 
sudo ln -s Makefile Kconfig

5 - Execute: sudo ./displaylink-installer.sh install
6 - Reboot the system

I was using Ubuntu before and had a very large lag in the video (it looked like the keyboard was too slow, but it was just the video not being updated). On Debian, it's perfect.
The PROBLEM is that I need to have the laptop's lid open (i.e. must have both screens on), and sleep doesn't work. Therefore, for this to be usable, I always need to fully shutdown the laptop and, when I turn it on, I need to leave the lid open.
I hope this helps until we have a proper DisplayLink driver for Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests