Help with device tree / installing vivante GPU driver for X11 in debian 9.2 with i.MX6 SoloLite

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with device tree / installing vivante GPU driver for X11 in debian 9.2 with i.MX6 SoloLite

4,104 Views
joeyhanlon
Contributor I

Hi - I am currently running debian 9.2 / kernel 4.4.80-armv7-x14 with an i.MX6 SoloLite, and running X11 apps with fbdev. The graphics are very choppy with this setup, so I need to figure out how to get the GPU working. I've added the GPU to the device tree:

gpu@02200000 {
   compatible = "fsl,imx6sl-gpu", "fsl,imx6q-gpu";
   reg = <0x2200000 0x4000 0x2204000 0x4000 0x80000000 0x0>;
   reg-names = "iobase_2d", "iobase_vg", "phys_baseaddr";
   interrupts = <0x0 0xa 0x4 0x0 0xb 0x4>;
   interrupt-names = "irq_2d", "irq_vg";
   clocks = <0x2 0x5e 0x2 0x5e 0x2 0x69>;
   clock-names = "gpu2d_axi_clk", "openvg_axi_clk", "gpu2d_clk";
   resets = <0x27 0x3 0x27 0x3>;
   reset-names = "gpu2d", "gpuvg";
   pu-supply = <0x4>;
   linux,phandle = <0x63>;
   phandle = <0x63>;
};

... but I'm not sure I've done it correctly. Some examples I've seen have the word "vivante" in a few fields up there, but I do not. Guides I have found also reference the gpu-viv-bin-mx6q package, but I cannot figure out how to obtain this package anywhere. Any assistance in getting the GPU working and installing the required drivers would be GREATLY appreciated, I've been driving myself crazy trying to figure this out.

Labels (3)
2 Replies

1,934 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Joey,

Your board is MX6SL, you take the dtb form the bsp:

gpu: gpu@02200000 {
compatible = "fsl,imx6sl-gpu", "fsl,imx6q-gpu";
reg = <0x02200000 0x4000>, <0x02204000 0x4000>,
<0x80000000 0x0>;
reg-names = "iobase_2d", "iobase_vg",
"phys_baseaddr";
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, $
interrupt-names = "irq_2d", "irq_vg";
clocks = <&clks IMX6SL_CLK_MMDC_ROOT>,
<&clks IMX6SL_CLK_MMDC_ROOT>,
<&clks IMX6SL_CLK_GPU2D_OVG>;
clock-names = "gpu2d_axi_clk", "openvg_axi_clk",     
"gpu2d_clk";
resets = <&src 3>, <&src 3>;
reset-names = "gpu2d", "gpuvg";
power-domains = <&gpc 1>;
};

The package 

https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-gpu-viv-5.0.11.p8.3

1,934 Views
joeyhanlon
Contributor I

Thank you for the reply! I couldn't compile my device tree due to it not recognizing certain entries like '&clks IMX6SL_CLK_MMDC_ROOT' , so I kept it as it is in my original question (still not 100% positive if it's correct though).

So the link to that package lead to a "Not Found" page, but I did find a bin file for 8.4 here 

https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-gpu-viv-5.0.11.p8.4-hfp.bin ... I unpacked this and installed it's files in their appropriate directories.

I then cloned this xf86-video-imx-vivante.git - Unnamed repository; edit this file 'description' to name the repository... , modified some headers and finally got it to build (almost). I copied the vivante_drv.so file to /usr/lib/xorg/modules/drivers, modified xorg.conf and got X to work with vivante (sort of, I bolded the lines of interest in Xorg.0.log below):

X.Org X Server 1.19.2
Release Date: 2017-03-02
[ 86466.865] X Protocol Version 11, Revision 0
[ 86466.865] Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
[ 86466.866] Current Operating System: Linux CLIThermostat 4.4.80-armv7-x14 #1 SMP Thu Nov 9 18:39:39 UTC 2017 armv7l
[ 86466.867] Kernel command line: console=ttymxc0,115200 mmcpart=5 root=/dev/mmcblk0p7 rootwait rw ath6kl_core.ath6kl_wifi_mac=00:e0:ee:00:05:2f bt_mac=00:e0:ee:00:05:2e sn=0001 pn=068-0457-40 mn=SAV-CRU-0600-0010 soft_sec_boot=0
[ 86466.869] Build Date: 16 October 2017 09:48:39AM
[ 86466.870] xorg-server 2:1.19.2-1+deb9u2 (https://www.debian.org/support)
[ 86466.871] Current version of pixman: 0.34.0
[ 86466.873] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 86466.873] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 86466.875] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jan 10 22:46:58 2018
[ 86466.877] (==) Using config file: "/etc/X11/xorg.conf"
[ 86466.878] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 86466.879] (==) ServerLayout "Builtin Default Layout"
[ 86466.879] (**) |-->Screen "Builtin Default fbdev Screen 0" (0)
[ 86466.879] (**) | |-->Monitor "Builtin Default Monitor"
[ 86466.880] (**) | |-->Device "Builtin Default fbdev Device 0"
[ 86466.881] (**) Option "BlankTime" "0"
[ 86466.881] (**) Option "StandbyTime" "0"
[ 86466.881] (**) Option "SuspendTime" "0"
[ 86466.881] (**) Option "OffTime" "0"
[ 86466.881] (==) Automatically adding devices
[ 86466.881] (==) Automatically enabling devices
[ 86466.881] (==) Automatically adding GPU devices
[ 86466.881] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 86466.881] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 86466.881] Entry deleted from font path.
[ 86466.882] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins
[ 86466.882] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 86466.882] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 86466.882] (II) Loader magic: 0x613f60
[ 86466.882] (II) Module ABI versions:
[ 86466.882] X.Org ANSI C Emulation: 0.4
[ 86466.882] X.Org Video Driver: 23.0
[ 86466.882] X.Org XInput driver : 24.1
[ 86466.882] X.Org Server Extension : 10.0
[ 86466.886] (--) using VT number 2

[ 86466.886] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 86466.887] (II) no primary bus or device found
[ 86466.888] (II) LoadModule: "glx"
[ 86466.888] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 86466.918] (II) Module glx: vendor="X.Org Foundation"
[ 86466.918] compiled for 1.19.2, module version = 1.0.0
[ 86466.918] ABI class: X.Org Server Extension, version 10.0
[ 86466.918] (II) LoadModule: "vivante"
[ 86466.919] (II) Loading /usr/lib/xorg/modules/drivers/vivante_drv.so
[ 86466.922] (II) Module vivante: vendor="X.Org Foundation"
[ 86466.922] compiled for 1.19.2, module version = 1.0.0
[ 86466.922] ABI class: X.Org Video Driver, version 23.0
[ 86466.922] (II) VIVANTE: fb driver for vivante: VivanteGC500, VivanteGC2100,
VivanteGCCORE
[ 86466.928] (WW) Falling back to old probe method for vivante
[ 86466.928] (II) Loading sub module "fbdevhw"
[ 86466.928] (II) LoadModule: "fbdevhw"
[ 86466.929] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[ 86466.929] (II) Module fbdevhw: vendor="X.Org Foundation"
[ 86466.930] compiled for 1.19.2, module version = 0.0.2
[ 86466.930] ABI class: X.Org Video Driver, version 23.0
[ 86466.930] (II) VIVANTE(0): using default device
[ 86466.930] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[ 86466.932] (II) VIVANTE(0): Device preferred mode 'fb0':U:640x480p-24
[ 86466.933] (II) VIVANTE(0): Creating default Display subsection in Screen section
"Builtin Default fbdev Screen 0" for depth/fbbpp 24/32
[ 86466.933] (==) VIVANTE(0): Depth 24, (==) framebuffer bpp 32
[ 86466.933] (==) VIVANTE(0): RGB weight 888
[ 86466.933] (==) VIVANTE(0): Default visual is TrueColor
[ 86466.933] (==) VIVANTE(0): Using gamma correction (1.0, 1.0, 1.0)
[ 86466.933] (**) VIVANTE(0): mExaHwType:1
[ 86466.933] (II) VIVANTE(0): checking modes against framebuffer device...
[ 86466.933] (II) VIVANTE(0): checking modes against monitor...
[ 86466.933] (--) VIVANTE(0): Virtual size is 0x0 (pitch 0)
[ 86466.933] (==) VIVANTE(0): DPI set to (96, 96)
[ 86466.933] (II) Loading sub module "fb"
[ 86466.933] (II) LoadModule: "fb"
[ 86466.934] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 86466.935] (II) Module fb: vendor="X.Org Foundation"
[ 86466.935] compiled for 1.19.2, module version = 1.0.0
[ 86466.935] ABI class: X.Org ANSI C Emulation, version 0.4
[ 86466.935] (II) Loading sub module "exa"
[ 86466.935] (II) LoadModule: "exa"
[ 86466.935] (II) Loading /usr/lib/xorg/modules/libexa.so
[ 86466.936] (II) Module exa: vendor="X.Org Foundation"
[ 86466.936] compiled for 1.19.2, module version = 2.6.0
[ 86466.936] ABI class: X.Org Video Driver, version 23.0
[ 86466.937] (II) VIVANTE(0): printing discovered frame buffer 'fb0' supported modes:
[ 86466.938] (II) VIVANTE(0): Modeline "U:640x480p-24"x0.0 11.00 640 780 783 861 480 505 506 526 -hsync -vsync -csync (12.8 kHz eP)
[ 86466.939] (II) VIVANTE(0): Output mxs using monitor section Builtin Default Monitor
[ 86466.940] (II) VIVANTE(0): Printing probed modes for output mxs
[ 86466.940] (II) VIVANTE(0): Modeline "U:640x480p-24"x24.3 11.00 640 780 783 861 480 505 506 526 -hsync -vsync -csync (12.8 kHz eP)
[ 86466.940] (II) VIVANTE(0): Output mxs connected
[ 86466.940] (II) VIVANTE(0): Using exact sizes for initial modes
[ 86466.940] (II) VIVANTE(0): Output mxs using initial mode U:640x480p-24 +0+0
[ 86466.940] (II) VIVANTE(0): imxDisplayPreInit: virtual set 640 x 480, display width 0
[ 86466.940] (II) VIVANTE(0): VivPreInit: adjust display width 640
[ 86466.940] (--) Depth 24 pixmap format is 32 bpp
[ 86466.940] (II) VIVANTE(0): reserve 8355840 bytes for on screen frame buffer; total fb memory size 2097152 bytes; offset of shadow buffer 8355840
[ 86466.941] (EE) VIVANTE(0): fb memory is not big enough to hold shadow buffer!
[ 86466.943] (II) VIVANTE(0): hardware: mxs (video memory: 2048kB)
[ 86466.943] (II) VIVANTE(0): FB Start = 0xb6277000 FB Base = 0xb6277000 FB Offset = (nil)
[ 86466.943] (II) VIVANTE(0): test Initializing EXA
[ 86466.944] (EE) VIVANTE(0): internal error: GPU Ctx Init Failed
[ 86466.944] (EE) VIVANTE(0): internal error: initExaLayer failed in VivScreenInit()
[ 86466.944] (==) VIVANTE(0): Backing store enabled
[ 86466.945] (==) VIVANTE(0): DPMS enabled
[ 86466.945] (II) VIVANTE(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[ 86467.132] (EE) VIVANTE(0): [dri] VivDRIScreenInit failed because Drm can't be opened.
[ 86467.132] (--) RandR disabled
[ 86467.163] (II) SELinux: Disabled on system
[ 86467.167] (II) AIGLX: Screen 0 is not DRI2 capable
[ 86467.167] (EE) AIGLX: reverting to software rendering
[ 86467.374] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[ 86467.377] (II) IGLX: Loaded and initialized swrast
[ 86467.377] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[ 86467.379] (II) VIVANTE(0): Setting screen physical size to 169 x 127
...

Hardware acceleration is unfortunately still not working though. At the end of fastbuild.sh in xf86-video-imx-vivante i get this "make: *** DRI_1.10.4/src/: No such file or directory.  Stop.". I found this folder online and copied it over, but there are a LOT of errors when I tried to build. The log also says fb driver for vivante: VivanteGC500, VivanteGC2100 , but the imx6 SoloLite has GC320 and GC355, leading me to believe something is wrong with the driver. It also tries to reserve more bytes than there are available for use in the shadow buffer... any idea what could be wrong?