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

Update sources. #3

Closed
Aritty58 opened this issue Aug 22, 2023 · 22 comments
Closed

Update sources. #3

Aritty58 opened this issue Aug 22, 2023 · 22 comments

Comments

@Aritty58
Copy link

Please update the sources to compile with kernel 6+

@skylight74
Copy link

+1

1 similar comment
@YSpoof
Copy link

YSpoof commented Sep 6, 2023

+1

@nunesbns
Copy link

nunesbns commented Oct 5, 2023

https://github.com/nunesbns/ms912x

Project with kernel 6 support.

@YSpoof
Copy link

YSpoof commented Oct 5, 2023 via email

@faveoled
Copy link

faveoled commented Oct 10, 2023

@nunesbns Getting this error:

/home/user/Downloads/ms912x/ms912x_connector.c:12:30: error: ‘EDID_LENGTH’ undeclared (first use in this function)
   12 |         int offset = block * EDID_LENGTH;
      |                              ^~~~~~~~~~~

Any ideas?
Ubuntu 22.04.3, kernel 6.2.0-34-generic

@nunesbns
Copy link

nunesbns commented Oct 11, 2023

@faveoled checkout to kernel-6-support branch.

https://github.com/nunesbns/ms912x/tree/kernel-6-support

@faveoled
Copy link

faveoled commented Oct 11, 2023

@nunesbns Compiled fine but has this error on insert:

insmod: ERROR: could not insert module ms912x.ko: Unknown symbol in module

Had this warning during compilation:

Skipping BTF generation for /home/user/Downloads/ms912x-kernel-6-support/ms912x.ko due to unavailability of vmlinux

Any ideas?

@lenainjaune
Copy link

lenainjaune commented Oct 11, 2023

Hi 😄

@faveoled

From a fresh Debian 12 Bookworm system with the default kernel v6.1.0-10-amd64 (virtual environment for tests).

insmod: ERROR: could not insert module ms912x.ko: Unknown symbol in module

In my case, infos gave me :

root@vm-bookworm:/ms912x-main# /usr/sbin/modinfo ./ms912x.ko
filename:       /root/ms912x-main/./ms912x.ko
license:        GPL
alias:          usb:v534Dp0821d*dc*dsc*dp*icFFisc00ip00in*
alias:          usb:v534Dp6021d*dc*dsc*dp*icFFisc00ip00in*
depends:        drm_kms_helper,drm,usbcore,drm_shmem_helper
retpoline:      Y
name:           ms912x
vermagic:       6.1.0-10-amd64 SMP preempt mod_unload modversions

You can see there was 4 dependencies : drm_kms_helper,drm,usbcore,drm_shmem_helper

In my case drm_shmem_helper was not loaded by default, as you can see here :

root@vm-bookworm:/ms912x-main# lsmod \
| grep -Eo \
 "^(drm_kms_helper|drm|usbcore|drm_shmem_helper)" \
| sort -u
drm
drm_kms_helper
usbcore

So I tried to load it :

root@vm-bookworm:/ms912x-main# modprobe drm_shmem_helper
root@vm-bookworm:/ms912x-main# lsmod | grep -c drm_shmem_helper
2

=> The module was loaded.

I finally tried to load the custom module ms912x :

root@vm-bookworm:/ms912x-main# insmod ./ms912x.ko
# Nothing displayed
root@vm-bookworm:/ms912x-main# lsmod | grep -c ms912x
2
root@vm-bookworm:/ms912x-main# journalctl -k | grep ms912x
sept. 23 00:23:08 vm-bookworm kernel: ms912x: \\
 loading out-of-tree module taints kernel.
sept. 23 00:23:08 vm-bookworm kernel: ms912x: \\
 module verification failed: \\
 signature and/or required key missing - tainting kernel
sept. 23 00:23:08 vm-bookworm kernel: \\
 usbcore: registered new interface driver ms912x

Success :D !

Note : the tainting kernel message is not blocking, you can ignore it ; it could be resolved in signing this custom module (that is apparently the why of this message) ; I searched a way to achieve this but I did terminate as I had more urgent stuff to treat.

Skipping BTF generation for /home/user/Downloads/ms912x-kernel-6-support/ms912x.ko due to unavailability of vmlinux

As I understood you can ignore it too however you can get rid of this in compiling the module resolve_btfids (see here - sorry in french, you must search "Le problème de vmlinux manquant" which will be translated in "The problem of missing vmlinux")

As I said I do not manage this project for the moment as I have some urgent stuff to accomplish before, but you can read what I tried in this thread (in french but you can use some online translators) with the help of more expert people (this is the first time I dig as much for compiling a project 😄 ).

/home/user/Downloads/ms912x/ms912x_connector.c:12:30: error: ‘EDID_LENGTH’ undeclared (first use in this function)
12 | int offset = block * EDID_LENGTH;

Too if you follow the link you could see I modified the project's headers to fit with the kernel v6+ to correct among others the EDID's problem you notified (EDID is a screen protocol to communicate their specs).

I hope this will help you 😉
With adelphity
lnj

@skylight74
Copy link

first of all thanks for the update @nunesbns , and also thanks for @lenainjaune the detailed walkthrough. I have facing an issue on the display it self.
photo1697097767

My system details are:
Linux-kernel-6.5.6.1-cachyos-cfs (Arch linux based distro)
Intel Corporation Skylake GT2 [HD Graphics 520]
NVIDIA Corporation GM108M [GeForce 940MX]
Hyprland wm with a wayland compositor.
2 external monitors, HDMI+ USB/VGA , and one internal Monitor.

I'm relatively new to linux driver development, so debugging the issue myself proved challenging.

So far its loading properly, and even works with Plymouth loads, but that's it.

If you could assist me fix this problem, whether if it is a compositor issue (wayland/Hyprland) ,driver issue/ or GPU issue . I would be very grateful.

and again thanks for everything.

P.s if you need any logs and problem description. please let me know 😄

@faveoled
Copy link

@lenainjaune Thanks. It seems to be loading now:

user@hp-laptop:~/Downloads/ms912x-kernel-6-support$ journalctl -k | grep ms912x
Oct 12 12:59:56 hp-laptop kernel: usbcore: registered new interface driver ms912x

I had these two error lines but they seem to have vanished after I make clean'ed the driver:

Oct 12 12:32:26 hp-laptop kernel: ms912x: Unknown symbol drm_gem_shmem_dumb_create (err -2)
Oct 12 12:32:26 hp-laptop kernel: ms912x: Unknown symbol drm_gem_shmem_prime_import_sg_table (err -2)

@lenainjaune
Copy link

lenainjaune commented Oct 12, 2023

@faveoled

@lenainjaune Thanks. It seems to be loading now:

Cool 😎

And is the display detected by your system ?

In my case it is detected (even in virtual environment) only if I use Wayland with only a Desktop Environment which supports it natively (Gnome, KDE, Cinnamon but not yet for XFCE) both with a Display Manager which support it (GDM3, SDDM but not completely with LightDM).

As I use intensively XFCE4 with LighDM (my prefered DE/DM environment), I am stuck for now. But I do not despere to find a solution or a workaround ... when I will dig more deeper.

@skylight74

first of all thanks for the update @nunesbns , and also thanks for @lenainjaune the detailed walkthrough.

Research and findings are meant to be shared, it seems to me. In any case it is a value that speaks to me 😉

I have facing an issue on the display it self.

Nice 😆 are you sure you are on Arch as it feels to me distinguish a part of the Debian's logo 😆

More seriously I do not know how to resolve or debug your problem. My feeling as you suggest is to orientate your investigation's domain on the video card drivers. Do you use the nVidia nouveau driver or the proprietary one ? Could you try both and see if there are differences ?

In all case I will let people with more experience on this subject speak.

@skylight74
Copy link

@lenainjaune thank you very much, I'm using the proprietary one, and the logo is the plymouth theme. the one that i mentioned were working earlier. I don't really have a Display manager. just A window manager as I usually create my sessions from the terminal (de bloating the distro.

I will debug by offloading everything to the main GPU 🤞 it might be helpful

and thank you for your reply 😄

@rhgndf
Copy link
Owner

rhgndf commented Oct 15, 2023

The code now compiles with kernel 6.5.5.

@nunesbns Mind if you PR your changes?

@YSpoof
Copy link

YSpoof commented Oct 16, 2023

  CC [M]  /dev/shm/ms912x/ms912x_drv.o
/dev/shm/ms912x/ms912x_drv.c:13:10: fatal error: drm/drm_fbdev_generic.h: No such file or directory
   13 | #include <drm/drm_fbdev_generic.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Debian 12
Kernel: 6.1.0-13-amd64

Any tips ?

@rhgndf
Copy link
Owner

rhgndf commented Oct 16, 2023

Try removing that line.

@YSpoof
Copy link

YSpoof commented Oct 16, 2023

Try removing that line.

insmod: ERROR: could not insert module ms912x.ko: Unknown symbol in module

/dev/shm/ms912x main*
❯ file ms912x.ko 
ms912x.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=c9934fabc385055d02d6bb46330b04e075497250, with debug_info, not stripped

Btw, total noob here in terms of kernel/module stuff :(

@rhgndf
Copy link
Owner

rhgndf commented Oct 16, 2023

Try: modprobe drm_shmem_helper

@YSpoof
Copy link

YSpoof commented Oct 16, 2023

Try: modprobe drm_shmem_helper

Thanks, worked but now a few strange things happened

  1. System became very slow with the adapter plugged in
  2. I can see my desktop on the second monitor but it is flicking a lot and also shaking the image, especially when updates happens to screen ( like mouse movement )

Similar problem as @skylight74 , but as I said, I "can see" my desktop

Yes, I tried playing with the resolutions, but same deal...

Also, my bad, I should've read @lenainjaune comment

@rhgndf
Copy link
Owner

rhgndf commented Oct 17, 2023

  1. Unfortunately, I could not reproduce the issue on my side, so if you or someone who experiences this issue could debug it, that would be helpful.
  2. I have seen this happening, but not as severe as you describe it. I think for my side it could be due to the desktop environment: Gnome/KDE/etc... Not totally sure whats causing it in general though, so debugging help is welcome.

@rhgndf
Copy link
Owner

rhgndf commented Oct 20, 2023

For 2 it might be fixed with this commit: ac7e2a5

@rhgndf
Copy link
Owner

rhgndf commented Oct 23, 2023

For 1, it might be because of latency. Might be fixed with b763760

@rhgndf
Copy link
Owner

rhgndf commented Jan 11, 2024

Since the code is updated for newer kernel, closing this issue.

@rhgndf rhgndf closed this as completed Jan 11, 2024
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

7 participants