i.MX6s/dl Etnaviv/Vivante drivers on Debian 9 Stretch

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6s/dl Etnaviv/Vivante drivers on Debian 9 Stretch

10,934 Views
steffendoster
Contributor IV

Hi everyone,

it's the same old problem on and on and perhaps someone can finally point me the way to get graphics acceleration to work.

I have a custom i.MX6s/dl Board with a little display and want to use the graphics acceleration. I built a Linux-Kernel with the Mainline Sources of Version 4.9.98.

I don't use yocto or another build-tool! I'm fine with my self-made compile-script for the Kernel.

The Graphic-Devicetree-Part is attached.

In Kernel-Config / Drivers / Graphics support the following is selected:

- IPUv3 core support

- Direct Rendering Manager

- DRM Support for Freescale i.MX

- Support for parallel displays
- Support for TV and VGA displays
- Support for LVDS displays
- Freescale i.MX DRM HDMI

- ETNAVIV

(- Backlight support and Bootup logo)

The Etnaviv Module seems to be working correctly, <dmesg|grep viv> gives:

[ 1.482134] etnaviv gpu-subsystem: bound 134000.gpu (ops gpu_ops)
[ 1.488314] etnaviv gpu-subsystem: bound 130000.gpu (ops gpu_ops)
[ 1.494468] etnaviv-gpu 134000.gpu: model: GC320, revision: 5007
[ 1.546746] etnaviv-gpu 130000.gpu: model: GC880, revision: 5106
[ 8.556667] etnaviv: module is already loaded

The Root-Filesystem (Debian 9) is built with the receipe here:

Debian on the i.MX6 sabre sd platform in a few commands

except I replaced
# debootstrap --foreign --arch=armhf testing /mnt

with

# debootstrap --foreign --arch=armhf stable /mnt

After the basic Installation I added lightdm and xfce4. This works fine for me except the missing graphics acceleration.

And I added some mesa packages (Version 13 in Debian 9):

libegl1-mesa, libegl1-mesa-drivers, libgl1-mesa-dri, libgl1-mesa-glx, libglapi-mesa, libglu1-mesa, mesa-common-dev, mesa-va-drivers, mesa-utils, mesa-utils-extra

With the mesa-utils I testet graphics with glxgears and got a fps of about 36 :smileycry:

I already tried countless ways to get the graphics acceleration to work but with no success. I don't want to list them here but here are some examples: (which are mostly very old)

- install armada (libdrm-armada) (not shipped with Debian)

- compile xorg-drv-vivante

- compile and install xf86-video-imx-vivante-rel_imx_4.9.x_1.0.0_ga (Compile Errors with incorrect defines and structures. Did not compile!) also added imx-gpu-viv-5.0.11.p8.4-hfp for headers and libs

Many (all) of them ended with compile errors which I can't solve.

i.MX6 is now a rather mature Device and I can't believe I'm the first to try this. Isn't there a working way to get Graphics-Acceleration to work?

Do you need any further Information?

PLEEEEAAAAAAAAAASE! HEEEEEEEELP! PLEEEEEEEAAAAAASE! (Multipass!)

Labels (5)
22 Replies

5,691 Views
kruglikov_dmt
Contributor III

Hi. I didn't find way to configure DRM-device correctly but I did enable GPU acceleration with OpenGL ES support through  FB for my Ubuntu system. Maybe it can be useful for you: LIMaker/11-install_gpu_vivante.sh at imx6-KTN4-Qt5.9 · r3d9u11/LIMaker · GitHub 

0 Kudos

5,691 Views
marcosal
Contributor II

Hi kruglikov.dmt@gmail.com‌, currently I am trying to enable open gl for FB, I really don't need X11. I saw you shared a link but is broken. Do you know what options in the Kernel (4.9.88) should I activate in order to be able to use etnaviv and OpenGL? If you have an small user space application example would be great! I just want an starting point.

Regards.

0 Kudos

5,665 Views
kruglikov_dmt
Contributor III

I used binaries from yocto-project (that solution I watched in other topics with same theme)

0 Kudos

5,671 Views
marcosal
Contributor II

I forgot to mention I'm using an imx6 solo =)

0 Kudos

5,665 Views
kruglikov_dmt
Contributor III

Sorry, repository is in progress, yet.

here is valid link  LIMaker/11-install_gpu_vivante.sh at master · r3d9u11/LIMaker · GitHub 

0 Kudos

5,691 Views
gary_bisson
Senior Contributor III

Hi,

First, if you want to use Etnaviv I suggest you use the latest mainline kernel (4.18) instead of 4.9, countless improvements have been integrated since then.

Then, the whole goal of Etnaviv is to get rid of the Vivante binary blobs, so installing xorg-drv-vivante/xf86-video-imx-vivante/imx-gpu-viv is definitely not the way to go.

If you plan on using X11 windowing system, you need xf86-video-armada:

xf86-video-armada.git - Xorg video driver for Marvell Armada DRM and Freescale i.MX 

Regards,

Gary

5,691 Views
steffendoster
Contributor IV

Well, first thank you for this very quick answer.

What I have done:

In the provided README the package "libdrm-armada" is listed as required. So I checked out

git://ftp.arm.linux.org.uk/~rmk/libdrm-armada.git/

I'm new to automake, but I think I have compiled libdrm-armada:

I installed libtool and then ran:

libtoolize

aclocal

automake --add-missing

I managed to execute this without any warning, error, even without ANY output on console. So I think this was a success. I have a lot of new files YAY!

autoconf                                    //generates the configure-program

./configure

Sadly configure threw two errors:

./configure: line 12152: syntax error near unexpected token `LIBDRM,'
./configure: line 12152: `PKG_CHECK_MODULES(LIBDRM, libdrm >= 2.4.38)'

I have libdrm2  2.4.74 installed

0 Kudos

5,691 Views
gary_bisson
Senior Contributor III

Hi,

The README should give you all the instructions to build and install.

For further information, I suggest you join the IRC Freenode #etnaviv channel where Etnaviv experts are hanging out.

Regards,

Gary

0 Kudos

5,690 Views
steffendoster
Contributor IV

Update:

I read the README!

I tried the commands in the end of the Readme and it compiled everyting fine. So far so good. The etnaviv is now in my system.

I suppose the ETNAVIV-Kernel-Config must be turned off to prevent the Kernel using this module.

But after Bootup I got the following in dmesg:

etnaviv: disagrees about version of symbol module_layout

Ok, so I'm now trying to use a newer Kernel-Version. But I need a LTS-Version with realtime-support. So I'm switching to 4.14.63.

Will keep you informed

0 Kudos

5,689 Views
steffendoster
Contributor IV

I now have a 4.14.39-rt29 Kernel.

I tried to instll xf86-video-armada like I did before. At first without ETNAVIV-Option in Kernel config.

I think it installed correctly, no errors were thrown through the process.

Without ETNAVIV enabled in Kernel, dmesg gave nothing about "viv".

With ETNAVIV enabled, dmesg at gpu initialization:

[ 1.304271] etnaviv gpu-subsystem: bound 134000.gpu (ops gpu_ops)
[ 1.310748] etnaviv gpu-subsystem: bound 130000.gpu (ops gpu_ops)
[ 1.316871] etnaviv-gpu 134000.gpu: model: GC320, revision: 5007
[ 1.367417] etnaviv-gpu 130000.gpu: model: GC880, revision: 5106
[ 1.420136] [drm] Initialized etnaviv 1.1.0 20151214 for gpu-subsystem on minor 0
[ 1.429675] imx-ipuv3 2400000.ipu: no port@0 node in /soc/ipu@02400000, not using CSI0
[ 1.437634] imx-ipuv3 2400000.ipu: no port@1 node in /soc/ipu@02400000, not using CSI1
[ 1.446596] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.453346] [drm] No driver support for vblank timestamp query.
[ 1.460146] imx-drm display-subsystem: bound imx-ipuv3-crtc.0 (ops ipu_crtc_ops)
[ 1.467826] imx-drm display-subsystem: bound display@di0 (ops imx_pd_ops)
[ 1.567424] imx-drm display-subsystem: fb0: frame buffer device
[ 1.575618] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1
[ 1.583663] imx-ipuv3 2400000.ipu: no port@3 node in /soc/ipu@02400000, not using DI1
[ 1.591566] imx-ipuv3 2400000.ipu: IPUv3H probed

Is this correct?

glxgears says:

MESA-LOADER: failed to retieve device information

libGL error: unable to load driver: etnaviv_dri.so

libGL error: driver pionter missing

libGL error: failed to load driver: etnaviv

Maximum fps:38    :smileycry:

The i.MX6 Solo doesn't have 3D Acceleration so I think this must be OK.

How can I test if the 2D acceleration is working?

Should the ETNAVIV-Driver in Kernel be activated or deactivated?

0 Kudos

5,689 Views
vanek
Contributor I

Hi,

i.MX6 Solo have 3D acceleration (GC880). Etnaviv stuff was backported to Debian Strech so you need to add stretch-backports to your sources list (etnaviv_dri.so in libgl1-mesa-dri, libdrm-etnaviv1).

What about Xorg? Try to use Glamor in cooperation with modesetting driver [1]:

 

Section "Device"
   Identifier "etnaviv"
   Driver "modesetting"
   Option "kmsdev" "/dev/dri/card1"
   Option "AccelMethod" "glamor"
EndSection

Section "ServerFlags"
   Option "AutoAddGPU" "false"
EndSection

 

[1] Using Xorg's modesetting driver with etnaviv — MNT Notes 

0 Kudos

5,689 Views
steffendoster
Contributor IV

Nope, still doesn't work for me.

What I did:

- made a new RootFS as mentioned here:

Debian on the i.MX6 sabre sd platform in a few commands 

   I tried with "testing" and "stable". "testing" seems to be very buggy at the moment because it doesn't display ANYTHING except a command-line.

- Installed xorg, mesa-utils, libdrm-etnaviv1

- There is no xorg.conf in this debian. I tried to generate one with Xorg -configure, but it keeps saying there is no device to configure.

- So I just wrote a xorg.conf which has only your entries.

- /dev/dri/card0  ;  /dev/dri/card1  ;  renderD128  ; are available

- tried to start <xinit -geometry =+400+1 glxgears>: Success with "stable" and about 43 fps. Black-Screen with "testing".

- My Kernel: Mainline linux-kernel 4.14.85. Driver etnaviv enabled.

What else do I have to do?

By the way: is glxgears a suitable little test for just checking if GPU-Acceleration is on?

What further Information do you need? Devicetree entries? Kernelconfig?

Why does it seem that everyone manages to get a working GPU nearly out-of-the-box while I suffer one dead-end after another???

0 Kudos

5,689 Views
vanek
Contributor I

Ok "stable" is Debian Stretch right now. You wrote that it doesn't work for you and several lines below about "success" with "stable". So what is your goal??

You can try:

LIBGL_DEBUG=verbose glxgears -info

You find out whether etnaviv_dri.so is used for rendering or not.

Also:

LIBGL_DEBUG=verbose glxinfo

give you useful information.

Regarding xorg - So is it functional or not? What is your /var/log/Xorg.0.log?

0 Kudos

5,689 Views
steffendoster
Contributor IV

Well, sorry for the wrong message <success>. I was young and dumb, now I'm only "and".

I think 43fps with glxgears is an index that there is no hardware acceleration. My fault.

Tried your commands and it seems that imx-drm is still used as driver.

Found out, that <etnaviv_dri.so> isn't installed. This is not part of stretch, but is part of stretch backports. So I did:
apt -t stretch-backports install libgl1-mesa-dri

and got the driver. But after that, it still isn't used.

Xorg.0.log attached

0 Kudos

5,689 Views
vanek
Contributor I

I guess you also need libegl1-mesa and libgles2-mesa. You should also check size of CMA in kernel configuration (CONFIG_CMA_SIZE_MBYTES). You can also add kernel command line parameter (e.g. cma=256M).

0 Kudos

5,689 Views
steffendoster
Contributor IV

Checked libegl1-mesa and libgles2-mesa -> Installed

Tried Command-Line-Parameter cma=256M and set CMA_SIZE_MBYTES=256

No change to fps of glxgears. Still about 43 fps.

Xorg still says "failed to bind extensions", "failed to load driver: imx-drm", "EGL_MESA_drm_image required."

Attached latest Xorg.o.log and Devicetree-File with graphic-parts.

I think this is interesting: (Xorg.0.log)
[ 43.842] (II) AIGLX: Screen 0 is not DRI2 capable
[ 43.842] (EE) AIGLX: reverting to software rendering

Have a nice weekend!

0 Kudos

5,689 Views
vanek
Contributor I

imx-drm is display driver. Obviously, option "kmsdev" "/dev/dri/cardX" should correspond to etnaviv DRI node. So I suppose you should use Option "kmsdev" "/dev/dri/card0" instead. Try this:

Section "Device"
   Identifier "etnaviv"
   Driver "modesetting"
   Option "kmsdev" "/dev/dri/card0"
   Option "AccelMethod" "glamor"
EndSection

Section "ServerFlags"
   Option "AutoAddGPU" "false"
EndSection

Section "Screen"
   Identifier "Screen0"
   Device "etnaviv"
EndSection

0 Kudos

5,690 Views
steffendoster
Contributor IV

Well, as long noone seems to be able to help me, I tried some things by myself:

I built a completely new Device-Tree based on the newest Devicetree of NXP's imx6dlsabresd. There are some changes made since I portet from Kernel 4.5.

The effects:

It seems that I managed to get some further in X-Initialization without errors. The glamor module now loads without adding the Debian package libegl-mesa0.

See attached Xorg.0.log for complete log on starting glxgears with xinit.

Sadly AIGLX still doesn't work

[ 102.346] (EE) AIGLX error: imx-drm does not export required DRI extension
[ 102.346] (EE) AIGLX: reverting to software rendering

And also the screen goes blank when starting X. I think this happens when glamor loads.

But I think it is working somehow. Since today I got a CPU-Usage of 70-80% with glxgears. With the new Devicetree it seems that it is reduced to about 30%. (15% Xorg; 15% glxgears)

More Questions:

Why doesn't it use the Display-Timings for my Display (1024x600) anymore although I added it in Device-Tree?

Why does it still report AIGLX crashes because of imx-drm? Shouldn't it use etnaviv-drm?

But for now:

Marry Christmas and a Happy New Year to you all.

Hopefully I get further help in 2019

0 Kudos

5,690 Views
gianlucarenzi71
Contributor II

Hello Steffen!

I was wondering if you were able to enable Xorg Vivante (GPU) accelerated video for your iMX6 board with Debian Stretch. I have a custom kernel based on 4.12.0 and the device tree is a modified one from sabresd board to be adapted for our boards. The IPUv3 has the display ldb (LVDS) and the framebuffer seems to be ok. Even the ETNAVIV drivers are compiled statically in the kernel and they are activated, so the drm drivers.

I have all libraries installed, and I compiled the ARMADA driver as in the following link: BeagleBoard-x15: Vivante GC320 GPU revision 5301 (etnaviv) 2d PE2.0 · GitHub 

Now I am trying to have on a empty desktop Xorg a Qt application running using the best platform backend for this hardware. I think it is EGLFS. Or the driver provided by Armada/Xorg?

I hope you help me out...

0 Kudos

5,690 Views
steffendoster
Contributor IV

Here's what I tried today:

- Changed xorg.conf to card0. Without any change of result on my system. So I changed it back to card1. But will observe for further tests if it is card0 or card1

- Investigated the failed glamor start and found out, that the package "libegl-mesa0" from stretch-backports seems to be missing. So I installed it and the module glamor started. But sadly since then there is no more glxgears on my screen anymore. It just goes black.

Also there is still this Error:y

[ 385.668] (EE) AIGLX error: imx-drm does not export required DRI extension
[ 385.668] (EE) AIGLX: reverting to software rendering

- I made the xorg.conf more precise by adding a Monitor-Section (see Attachments)

0 Kudos