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

Add hwcomposer xorg drivers #30

Open
wants to merge 8 commits into
base: master
from

Conversation

@adisbladis
Copy link

commented Oct 4, 2019

The Xorg driver builds fine but is not yet tested.
qt5-qpa-hwcomposer-plugin doesn't build because of some GL things, not sure how to approach this one.

Based on #29 because of the changes in android-headers.

adisbladis added 2 commits Oct 4, 2019
Also switch to ubports upstream since it's maintained
overlay/overlay.nix Outdated Show resolved Hide resolved
@samueldr

This comment has been minimized.

Copy link
Owner

commented Oct 5, 2019

I'm still looking at it, actually trying it so see if I can use it; google-taimen has an issue causing it to be basically impossible to use fbdev.

@samueldr

This comment has been minimized.

Copy link
Owner

commented Oct 6, 2019

Using the previous comment's fixup to the overlay, tried it on hardware. Got:

display-manager journal
Dec 31 19:16:59 nixos systemd[1]: Starting X11 Server...
Dec 31 19:16:59 nixos systemd[1]: Started X11 Server.
Dec 31 19:16:59 nixos display-manager[1643]: /nix/store/p8iwgmixf38qhr2sgml907mxh6wr8ynh-xsession "xfce" - xfce
Dec 31 19:16:59 nixos display-manager[1643]: /nix/store/p8iwgmixf38qhr2sgml907mxh6wr8ynh-xsession "xfce" - xfce
Dec 31 19:16:59 nixos display-manager[1643]: slim: Stale lockfile found, removing it
Dec 31 19:16:59 nixos display-manager[1643]: /nix/store/b5l2hxinc1lv72khc4qlvqd460lkbpk8-xauth-1.1/bin/xauth:  file /var/run/slim.auth does not exist
Dec 31 19:16:59 nixos display-manager[1643]: slim: waiting for X server to begin accepting connections
Dec 31 19:16:59 nixos display-manager[1643]: X.Org X Server 1.20.5
Dec 31 19:16:59 nixos display-manager[1643]: X Protocol Version 11, Revision 0
Dec 31 19:16:59 nixos display-manager[1643]: Build Operating System: Linux 4.14.87 aarch64
Dec 31 19:16:59 nixos display-manager[1643]: Current Operating System: Linux nixos 4.4.195 #2 SMP PREEMPT Sat Oct 5 21:06:27 UTC 2019 aarch64
Dec 31 19:16:59 nixos display-manager[1643]: Kernel command line: rcupdate.rcu_expedited=1 androidboot.hardware=taimen user_debug=31 msm_rtb.filter=0 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 service_locator.enable=1 swiotlb=1 firmware_class.path=/vendor/firmware loop.max_part=7 raid=noautodetect androidboot.selinux=permissive buildvariant=userdebug androidboot.revision=rev_10 androidboot.bootreason=reboot androidboot.hardwar>
Dec 31 19:16:59 nixos display-manager[1643]: Build Date: 30 May 2019  06:28:09PM
Dec 31 19:16:59 nixos display-manager[1643]:
Dec 31 19:16:59 nixos display-manager[1643]: Current version of pixman: 0.38.4
Dec 31 19:16:59 nixos display-manager[1643]:         Before reporting problems, check http://wiki.x.org
Dec 31 19:16:59 nixos display-manager[1643]:         to make sure that you have the latest version.
Dec 31 19:16:59 nixos display-manager[1643]: Markers: (--) probed, (**) from config file, (==) default setting,
Dec 31 19:16:59 nixos display-manager[1643]:         (++) from command line, (!!) notice, (II) informational,
Dec 31 19:16:59 nixos display-manager[1643]:         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
Dec 31 19:16:59 nixos display-manager[1643]: (++) Log file: "/dev/null", Time: Thu Jan  1 00:16:59 1970
Dec 31 19:16:59 nixos display-manager[1643]: (++) Using config file: "/nix/store/n953pzsh5ln392wnmwp8q2lqvb44wq2l-xserver.conf"
Dec 31 19:16:59 nixos display-manager[1643]: (==) Using config directory: "/etc/X11/xorg.conf.d"
Dec 31 19:16:59 nixos display-manager[1643]: (==) Using system config directory "/nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/share/X11/xorg.conf.d"
Dec 31 19:16:59 nixos display-manager[1643]: (==) ServerLayout "Layout[all]"
Dec 31 19:16:59 nixos display-manager[1643]: (**) |-->Screen "Screen-hwcomposer[0]" (0)
Dec 31 19:16:59 nixos display-manager[1643]: (**) |   |-->Monitor "<default monitor>"
Dec 31 19:16:59 nixos display-manager[1643]: (**) |   |-->Device "Device-hwcomposer[0]"
Dec 31 19:16:59 nixos display-manager[1643]: (==) No monitor specified for screen "Screen-hwcomposer[0]".
Dec 31 19:16:59 nixos display-manager[1643]:         Using a default monitor configuration.
Dec 31 19:16:59 nixos display-manager[1643]: (**) Option "DontZap" "on"
Dec 31 19:16:59 nixos display-manager[1643]: (**) Option "AllowMouseOpenFail" "on"
Dec 31 19:16:59 nixos display-manager[1643]: (==) Automatically adding devices
Dec 31 19:16:59 nixos display-manager[1643]: (==) Automatically enabling devices
Dec 31 19:16:59 nixos display-manager[1643]: (==) Automatically adding GPU devices
Dec 31 19:16:59 nixos display-manager[1643]: (==) Max clients allowed: 256, resource mask: 0x1fffff
Dec 31 19:16:59 nixos display-manager[1643]: (**) FontPath set to:
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/xmwbsgnxmxi33a1ypl06npfhwbmq7y42-font-bh-lucidatypewriter-100dpi-1.0.3/lib/X11/fonts/100dpi,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/az78dxkmq6cfkykdiyyi4c36gk9r14fn-font-bh-lucidatypewriter-75dpi-1.0.3/lib/X11/fonts/75dpi,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/m7idjqh6n076rdf599lk9xbsvdpdjfxz-font-bh-100dpi-1.0.3/lib/X11/fonts/100dpi,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/4gkz75xpvvy15jcpbqcg3cm445yskvk2-font-misc-misc-1.1.2/lib/X11/fonts/misc,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/hiijir2jpmafq0zsbfbqw1vba4310bsw-font-cursor-misc-1.0.3/lib/X11/fonts/misc,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/nyx1r5a0vnw0s84p8nh1mqcln89rm3rl-unifont-12.1.03/share/fonts,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/j6f8a0nphihaz0xqhnr17d8sfjy66nsx-font-adobe-100dpi-1.0.3/lib/X11/fonts/100dpi,
Dec 31 19:16:59 nixos display-manager[1643]:         /nix/store/62h9dwfg78fy8wasr6x6frsj9w6q1n2s-font-adobe-75dpi-1.0.3/lib/X11/fonts/75dpi
Dec 31 19:16:59 nixos display-manager[1643]: (**) ModulePath set to "/nix/store/88ngdqjkwfzjks85bya3ral59vziq0k2-xf86-video-hwcomposer-unstable-2019-02-07/lib/xorg/modules/drivers,/nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules,/nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/drivers,/nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/extensions,/nix/store/1zlf02af6q33wr8f74c5w132911>
Dec 31 19:16:59 nixos display-manager[1643]: (II) The server relies on udev to provide the list of input devices.
Dec 31 19:16:59 nixos display-manager[1643]:         If no devices become available, reconfigure udev or disable AutoAddDevices.
Dec 31 19:16:59 nixos display-manager[1643]: (II) Loader magic: 0x631d10
Dec 31 19:16:59 nixos display-manager[1643]: (II) Module ABI versions:
Dec 31 19:16:59 nixos display-manager[1643]:         X.Org ANSI C Emulation: 0.4
Dec 31 19:16:59 nixos display-manager[1643]:         X.Org Video Driver: 24.0
Dec 31 19:16:59 nixos display-manager[1643]:         X.Org XInput driver : 24.1
Dec 31 19:16:59 nixos display-manager[1643]:         X.Org Server Extension : 10.0
Dec 31 19:16:59 nixos display-manager[1643]: (++) using VT number 7
Dec 31 19:16:59 nixos display-manager[1643]: (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
Dec 31 19:16:59 nixos display-manager[1643]: (II) no primary bus or device found
Dec 31 19:16:59 nixos display-manager[1643]: (II) "glx" will be loaded by default.
Dec 31 19:16:59 nixos display-manager[1643]: (II) LoadModule: "glx"
Dec 31 19:16:59 nixos display-manager[1643]: (II) Loading /nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/extensions/libglx.so
Dec 31 19:16:59 nixos display-manager[1643]: (II) Module glx: vendor="X.Org Foundation"
Dec 31 19:16:59 nixos display-manager[1643]:         compiled for 1.20.5, module version = 1.0.0
Dec 31 19:16:59 nixos display-manager[1643]:         ABI class: X.Org Server Extension, version 10.0
Dec 31 19:16:59 nixos display-manager[1643]: (II) LoadModule: "hwcomposer"
Dec 31 19:16:59 nixos display-manager[1643]: (II) Loading /nix/store/88ngdqjkwfzjks85bya3ral59vziq0k2-xf86-video-hwcomposer-unstable-2019-02-07/lib/xorg/modules/drivers/hwcomposer_drv.so
Dec 31 19:16:59 nixos display-manager[1643]: (EE) Failed to load /nix/store/88ngdqjkwfzjks85bya3ral59vziq0k2-xf86-video-hwcomposer-unstable-2019-02-07/lib/xorg/modules/drivers/hwcomposer_drv.so: /nix/store/88ngdqjkwfzjks85bya3ral59vziq0k2-xf86-video-hwcomposer-unstable-2019-02-07/lib/xorg/modules/drivers/hwcomposer_drv.so: undefined symbol: fbScreenInit
Dec 31 19:16:59 nixos display-manager[1643]: (EE) Failed to load module "hwcomposer" (loader failed, 0)
Dec 31 19:16:59 nixos display-manager[1643]: (EE) No drivers available.
Dec 31 19:16:59 nixos display-manager[1643]: (EE)
Dec 31 19:16:59 nixos display-manager[1643]: Fatal server error:
Dec 31 19:16:59 nixos display-manager[1643]: (EE) no screens found(EE)
Dec 31 19:16:59 nixos display-manager[1643]: (EE)
Dec 31 19:16:59 nixos display-manager[1643]: Please consult the The X.Org Foundation support
Dec 31 19:16:59 nixos display-manager[1643]:          at http://wiki.x.org
Dec 31 19:16:59 nixos display-manager[1643]:  for help.
Dec 31 19:16:59 nixos display-manager[1643]: (EE) Please also check the log file at "/dev/null" for additional information.
Dec 31 19:16:59 nixos display-manager[1643]: (EE)
Dec 31 19:16:59 nixos display-manager[1643]: (EE) Server terminated with error (1). Closing log file.
Dec 31 19:17:00 nixos display-manager[1643]: Giving up.
Dec 31 19:17:00 nixos display-manager[1643]: slim: unable to connect to X server
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Failed with result 'exit-code'.
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Service RestartSec=200ms expired, scheduling restart.
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 3.
Dec 31 19:17:00 nixos systemd[1]: Stopped X11 Server.
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Start request repeated too quickly.
Dec 31 19:17:00 nixos systemd[1]: display-manager.service: Failed with result 'exit-code'.
Dec 31 19:17:00 nixos systemd[1]: Failed to start X11 Server.

I don't know exactly what's up, but it looks like fbScreenInit is a part of X11, from what I could tell...

(Writing this journal-like so anyone else trying can follow)

... then, found relevant information, tried something. The same, but for glamor_xv_init.

Here's what was needed:

   services.xserver.moduleSection = ''
     Load "libfb.so"
     Load "libglamoregl.so"
   '';

Sounds like the hwcomposer driver doesn't do everything needed for its dependencies at runtime.


Though this is not over yet! This is only the beginning!

display-manager journal
Dec 31 20:43:10 nixos display-manager[1580]: (II) Module ABI versions:
Dec 31 20:43:10 nixos display-manager[1580]:         X.Org ANSI C Emulation: 0.4
Dec 31 20:43:10 nixos display-manager[1580]:         X.Org Video Driver: 24.0
Dec 31 20:43:10 nixos display-manager[1580]:         X.Org XInput driver : 24.1
Dec 31 20:43:10 nixos display-manager[1580]:         X.Org Server Extension : 10.0
Dec 31 20:43:10 nixos display-manager[1580]: (++) using VT number 7
Dec 31 20:43:10 nixos display-manager[1580]: (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
Dec 31 20:43:10 nixos display-manager[1580]: (II) no primary bus or device found
Dec 31 20:43:10 nixos display-manager[1580]: (II) "glx" will be loaded by default.
Dec 31 20:43:10 nixos display-manager[1580]: (II) LoadModule: "libfb.so" (fb)
Dec 31 20:43:10 nixos display-manager[1580]: (WW) LoadModule: given non-canonical module name "libfb.so"
Dec 31 20:43:10 nixos display-manager[1580]: (II) Loading /nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/libfb.so
Dec 31 20:43:10 nixos display-manager[1580]: (II) Module fb: vendor="X.Org Foundation"
Dec 31 20:43:10 nixos display-manager[1580]:         compiled for 1.20.5, module version = 1.0.0
Dec 31 20:43:10 nixos display-manager[1580]:         ABI class: X.Org ANSI C Emulation, version 0.4
Dec 31 20:43:10 nixos display-manager[1580]: (II) LoadModule: "libglamoregl.so" (glamoregl)
Dec 31 20:43:10 nixos display-manager[1580]: (WW) LoadModule: given non-canonical module name "libglamoregl.so"
Dec 31 20:43:10 nixos display-manager[1580]: (II) Loading /nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/libglamoregl.so
Dec 31 20:43:10 nixos display-manager[1580]: (II) Module glamoregl: vendor="X.Org Foundation"
Dec 31 20:43:10 nixos display-manager[1580]:         compiled for 1.20.5, module version = 1.0.1
Dec 31 20:43:10 nixos display-manager[1580]:         ABI class: X.Org ANSI C Emulation, version 0.4
Dec 31 20:43:10 nixos display-manager[1580]: (II) LoadModule: "glx"
Dec 31 20:43:10 nixos display-manager[1580]: (II) Loading /nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/lib/xorg/modules/extensions/libglx.so
Dec 31 20:43:10 nixos display-manager[1580]: (II) Module glx: vendor="X.Org Foundation"
Dec 31 20:43:10 nixos display-manager[1580]:         compiled for 1.20.5, module version = 1.0.0
Dec 31 20:43:10 nixos display-manager[1580]:         ABI class: X.Org Server Extension, version 10.0
Dec 31 20:43:10 nixos display-manager[1580]: (II) LoadModule: "hwcomposer"
Dec 31 20:43:10 nixos display-manager[1580]: (II) Loading /nix/store/88ngdqjkwfzjks85bya3ral59vziq0k2-xf86-video-hwcomposer-unstable-2019-02-07/lib/xorg/modules/drivers/hwcomposer_drv.so
Dec 31 20:43:10 nixos display-manager[1580]: library "libGLESv2.so" not found
Dec 31 20:43:10 nixos display-manager[1580]: (II) Module hwcomposer: vendor="X.Org Foundation"
Dec 31 20:43:10 nixos display-manager[1580]:         compiled for 1.20.5, module version = 0.3.8
Dec 31 20:43:10 nixos display-manager[1580]:         Module class: X.Org Video Driver
Dec 31 20:43:10 nixos display-manager[1580]:         ABI class: X.Org Video Driver, version 24.0
Dec 31 20:43:10 nixos display-manager[1580]: (II) hwcomposer: Driver for Android devices with HWComposser API:
Dec 31 20:43:10 nixos display-manager[1580]:         hwcomposer
Dec 31 20:43:10 nixos display-manager[1580]: (WW) Falling back to old probe method for hwcomposer
Dec 31 20:43:10 nixos display-manager[1580]: (II) hwcomposer(0): Creating default Display subsection in Screen section
Dec 31 20:43:10 nixos display-manager[1580]:         "Screen-hwcomposer[0]" for depth/fbbpp 24/32
Dec 31 20:43:10 nixos display-manager[1580]: (==) hwcomposer(0): Depth 24, (--) framebuffer bpp 32
Dec 31 20:43:10 nixos display-manager[1580]: (==) hwcomposer(0): RGB weight 888
Dec 31 20:43:10 nixos display-manager[1580]: (==) hwcomposer(0): Default visual is TrueColor
Dec 31 20:43:10 nixos display-manager[1580]: (==) hwcomposer(0): Using gamma correction (1.0, 1.0, 1.0)
Dec 31 20:43:10 nixos display-manager[1580]: (DB) xf86MergeOutputClassOptions unsupported bus type 0
Dec 31 20:43:10 nixos display-manager[1580]: library "libhardware.so" not found
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: (EE) Backtrace:
Dec 31 20:43:10 nixos display-manager[1580]: (EE) 0: /nix/store/q4gphj2fd762ki1c0j2y0sfjazwdh09c-xorg-server-1.20.5/bin/X (OsSigHandler+0x38) [0x593700]
Dec 31 20:43:10 nixos display-manager[1580]: (EE) unw_get_proc_info failed: no unwind info found [-10]
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: (EE) Segmentation fault at address 0x0
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: Fatal server error:
Dec 31 20:43:10 nixos display-manager[1580]: (EE) Caught signal 11 (Segmentation fault). Server aborting
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: Please consult the The X.Org Foundation support
Dec 31 20:43:10 nixos display-manager[1580]:          at http://wiki.x.org
Dec 31 20:43:10 nixos display-manager[1580]:  for help.
Dec 31 20:43:10 nixos display-manager[1580]: (EE) Please also check the log file at "/dev/null" for additional information.
Dec 31 20:43:10 nixos display-manager[1580]: (EE)
Dec 31 20:43:10 nixos display-manager[1580]: (EE) Server terminated with error (1). Closing log file.

The important bits:

library "libGLESv2.so" not found
library "libhardware.so" not found

From the new, more to-the-point errors, I think I'm at the point where I need the vendor libraries in my system! It definitely is progress.


It looks like libhybris libraries.

[samueldr@aarch64:~/mobile-nixos]$ readlink -f result
/nix/store/3lw9a34j2yqmfs9m47p4m4a38fn8q6ah-libhybris

[samueldr@aarch64:~/mobile-nixos]$ find result/ -name libGLESv2.so
result/lib/libGLESv2.so

[samueldr@aarch64:~/mobile-nixos]$ find result/ -name libhardware.so
result/lib/libhardware.so
@adisbladis adisbladis force-pushed the adisbladis:hwcomposer branch from cacfb54 to 4c097f8 Oct 6, 2019
@adisbladis adisbladis changed the title Add hwcomposer xorg/wayland drivers Add hwcomposer xorg drivers Oct 6, 2019
@adisbladis adisbladis force-pushed the adisbladis:hwcomposer branch from 4c097f8 to 12b6495 Oct 6, 2019
@adisbladis

This comment has been minimized.

Copy link
Author

commented Oct 6, 2019

I've decided to drop the qt5 qpa stuff from this PR, it looks like there is still work to do to get the X11 stuff up and running, so these should be seen as completely separate things.

@samueldr samueldr self-requested a review Oct 6, 2019
adisbladis added 5 commits Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.