Etnaviv+Mesa 13 on IMX6Q with Linux 4.8.10

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

Etnaviv+Mesa 13 on IMX6Q with Linux 4.8.10

16,174 Views
marokkoav
Contributor II

I removed gpu_vg from DTS(kernel 4.8.10) and i have this messages in "dmesg" on my IMX6Q after command "modprobe etnaviv":
-bash-4.2# dmesg|grep etnaviv
[ 79.128569] etnaviv gpu-subsystem: bound 134000.gpu (ops gpu_ops [etnaviv])
[ 79.160763] etnaviv gpu-subsystem: bound 130000.gpu (ops gpu_ops [etnaviv])
[ 79.167775] etnaviv-gpu 134000.gpu: model: GC320, revision: 5007
[ 79.224841] etnaviv-gpu 130000.gpu: model: GC2000, revision: 5108

-bash-4.2# lsmod
Module Size Used by
etnaviv 59270 0

-bash-4.2# ls /dev/dri/
card0 card1 controlD64 renderD128

-bash-4.2# udevadm info -a -p /sys/class/drm/card1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/soc0/gpu-subsystem/drm/card1':
KERNEL=="card1"
SUBSYSTEM=="drm"
DRIVER==""
looking at parent device '/devices/soc0/gpu-subsystem':
KERNELS=="gpu-subsystem"
SUBSYSTEMS=="platform"
DRIVERS=="etnaviv"
ATTRS{driver_override}=="(null)"
looking at parent device '/devices/soc0':
KERNELS=="soc0"
SUBSYSTEMS=="soc"
DRIVERS==""
ATTRS{soc_id}=="i.MX6Q"
ATTRS{family}=="Freescale i.MX"
ATTRS{machine}=="Freescale i.MX6 Quad SABRE Smart Device Board"
ATTRS{revision}=="1.5"

-bash-4.2# ls /opt/lib/dri | grep etnaviv
etnaviv_dri.so

-bash-4.2# ls /opt/lib/ | grep etnaviv
libdrm_etnaviv.la
libdrm_etnaviv.so
libdrm_etnaviv.so.1
libdrm_etnaviv.so.1.0.0

-bash-4.2# ls /opt/lib/X11/modules/drivers | grep fbdev
fbdev_drv.so


xorg.conf:
Section "Device"
Identifier "card1"
Driver "fbdev"
EndSection

-bash-4.2# DISPLAY=:0 /opt/bin/glxinfo
name of display:
display: screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_MESA_copy_sub_buffer
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent,
GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method,
GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control,
GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event, GLX_EXT_buffer_age
GLX version: 1.4
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_EXT_texture_from_pixmap
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on softpipe
OpenGL version string: 3.0 Mesa 13.0.0

-bash-4.2# cat /var/log/Xorg.0.log
X.Org X Server 1.17.2
Release Date: 2015-06-16
[ 50.021] X Protocol Version 11, Revision 0
[ 50.021] Build Operating System: Linux 3.14.52+g5f6f0a5 armv7l
[ 50.021] Current Operating System: Linux (none) 4.8.10 #5 SMP Mon Jan 23 11:05:39 MSK 2017 armv7l
[ 50.021] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666
[ 50.021] Build Date: 12 August 2016 08:01:52AM

...
[ 50.034] (**) | |-->Device "card1"

...

[ 50.159] (II) FBDEV(0): Creating default Display subsection in Screen section

"Default Screen Section" for depth/fbbpp 16/16
[ 50.162] (==) FBDEV(0): Depth 16, (==) framebuffer bpp 16
[ 50.162] (==) FBDEV(0): RGB weight 565
[ 50.162] (==) FBDEV(0): Default visual is TrueColor
[ 50.162] (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0)
[ 50.162] (II) FBDEV(0): hardware: (video memory: 1536kB)
[ 50.162] (II) FBDEV(0): checking modes against framebuffer device...
[ 50.162] (II) FBDEV(0): checking modes against monitor...
[ 50.162] (--) FBDEV(0): Virtual size is 1024x768 (pitch 1024)
[ 50.163] (**) FBDEV(0): Built-in mode "current"
[ 50.163] (==) FBDEV(0): DPI set to (96, 96)
[ 50.163] (II) Loading sub module "fb"
[ 50.163] (II) LoadModule: "fb"
[ 50.164] (II) Loading /opt/lib/X11/modules/libfb.so
[ 50.173] (II) Module fb: vendor="X.Org Foundation"
[ 50.173] compiled for 1.17.2, module version = 1.0.0
[ 50.173] ABI class: X.Org ANSI C Emulation, version 0.4
[ 50.173] (**) FBDEV(0): using shadow framebuffer
[ 50.173] (II) Loading sub module "shadow"
[ 50.173] (II) LoadModule: "shadow"
[ 50.174] (II) Loading /opt/lib/X11/modules/libshadow.so
[ 50.177] (II) Module shadow: vendor="X.Org Foundation"
[ 50.178] compiled for 1.17.2, module version = 1.1.0
[ 50.178] ABI class: X.Org ANSI C Emulation, version 0.4
[ 50.205] (==) FBDEV(0): Backing store enabled
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.209] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.210] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.210] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.210] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[ 50.215] (==) FBDEV(0): DPMS enabled
[ 50.215] (==) RandR enabled
[ 50.221] (II) AIGLX: Screen 0 is not DRI2 capable
[ 50.221] (EE) AIGLX: reverting to software rendering
[ 50.376] (II) AIGLX: Loaded and initialized swrast
[ 50.376] (II) GLX: Initialized DRISWRAST GL provider for screen 0

...

-bash-4.2# DISPLAY=:0 /opt/bin/xrandr
/opt/bin/xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1024 x 768, current 1024 x 768, maximum 1024 x 768
default connected 1024x768+0+0 0mm x 0mm
1024x768 0.0*

And i have low FPS in "glxgears" test:
-bash-4.2# DISPLAY=:0 /opt/bin/glxgears
40 frames in 5.0 seconds = 7.954 FPS

Why it does not use "etnaviv" driver?

Labels (3)
23 Replies

5,811 Views
alexeylugovskoy
Contributor II
Does anyone know if there are any available gstreamer plugins for etnaviv driver? 
We run gstreamer 1.11  on IMX6 solo with linux kernel 4.10, gpu drm driver is etnaviv, 
vpu driver is coda with the proper firmware version: 2.1.5 revision: 32515, xorg driver 
is xf86-video-armada driver)

We found that only xvimagesink works, but its FPS is low, about 12 (running gst-launch-1.0 
playbin uri=file:///big_buck_bunny_720p_h264.mov), mouse cursor is not transparent and 
doesn't dissapear, so it looks like square when movie plays behind it.  

Also we tried glimagesink (configured with --enable-gles2, and then with --enable-egl), but it 
has problems with current mesa. When we try to run gst-launch-1.0 videotestsrc
! glimagesink 
Mesa: User error: GL_OUT_OF_MEMORY in glBeginQuery 
Mesa: User error: GL_INVALID_OPERATION in glEndQuery{Indexed}(no matching glBeginQuery{Indexed})

We also tried ximagesink. This plugin seems to provide transparent cursor, but it plays very slowly, 
the following warnings are appeared:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/Gst
XImageSink:ximagesink0: A lot of buffers are being dropped.


Are there any specific etnaviv gstreamer plugins available?
Does anyone have positive experience using gstreamer with etnaviv?
0 Kudos

5,811 Views
lmendes
Contributor III

From my experience etnaviv/armada DRM are still in development, specially armada. They are promising, but right now is still too early for replacement of Vivante official drivers.

If you run glmark2 you will see that there are some tests where etnaviv/armada fails to render properly...

There is this distribution that has etnaviv integrated, including a pre-compiled armada Debian package:

Home - Linux on ARM - eewiki 

0 Kudos

5,810 Views
cphealy1
Senior Contributor I

As of Mesa 17.2, glmark2 should successfully run all tests.  The only caveat to that is the terrain test.  The terrain test fails on the i.MX6 with the GC2000 as the shader instruction count limit is too small (512 instructions) to support the shader requirements of the terrain test.  

If on the other hand, the i.MX6 with the GC3000 is used (i.MX6dp or i.MX6qp for example), the terrain test will succeed as the newer GPU supports >512 shader instructions.  Support for this went into Mesa with the following patch:

mesa/mesa - The Mesa 3D Graphics Library 

Additionally, with regard to the general stability of etnaviv, if running recent versions of Qt without Wayland or X, it should be pretty solid.  There's sufficient kernel support for decoding video using the HW decoder and making it available to Qt as a video texture using dma_buf.

5,813 Views
marokkoav
Contributor II

glmark2 result on IMX6 with etnaviv GPU driver:

glmark2 2014.03

=======================================================

OpenGL Information

GL_VENDOR: etnaviv

GL_RENDERER: Gallium 0.4 on Vivante GC2000 rev 5108

GL_VERSION: 2.1 Mesa 13.0.0

=======================================================

[build] use-vbo=false: FPS: 83 FrameTime: 12.048 ms

[build] use-vbo=true: FPS: 84 FrameTime: 11.905 ms

[texture] texture-filter=nearest:[ 37.619828] random: crng init done

FPS: 70 FrameTime: 14.286 ms

[texture] texture-filter=linear: FPS: 69 FrameTime: 14.493 ms

[texture] texture-filter=mipmap: FPS: 66 FrameTime: 15.152 ms

[shading] shading=gouraud: FPS: 79 FrameTime: 12.658 ms

[shading] shading=blinn-phong-inf: FPS: 79 FrameTime: 12.658 ms

[shading] shading=phong: FPS: 73 FrameTime: 13.699 ms

[shading] shading=cel: FPS: 69 FrameTime: 14.493 ms

[bump] bump-render=high-poly: FPS: 75 FrameTime: 13.333 ms

[bump] bump-render=normals: FPS: 84 FrameTime: 11.905 ms

[bump] bump-render=height: FPS: 81 FrameTime: 12.346 ms

[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 61 FrameTime: 16.393 ms

[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 40 FrameTime: 25.000 ms

[pulsar] light=false:quads=5:texture=false: FPS: 67 FrameTime: 14.925 ms

[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 28 FrameTime: 35.714 ms

[desktop] effect=shadow:windows=4: FPS: 54 FrameTime: 18.519 ms

[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 47 FrameTime: 21.277 ms

[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 46 FrameTime: 21.739 ms

[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 62 FrameTime: 16.129 ms

[ideas] speed=duration:[ 232.719049] etnaviv-gpu 130000.gpu: hangcheck detected gpu lockup!

[ 232.725295] etnaviv-gpu 130000.gpu: completed fence: 13322

[ 232.731258] etnaviv-gpu 130000.gpu: active fence: 13323

[ 232.737595] etnaviv-gpu 130000.gpu: hangcheck recover!

[ 243.461234] etnaviv-gpu 130000.gpu: hangcheck detected gpu lockup!

[ 243.467480] etnaviv-gpu 130000.gpu: completed fence: 13323

[ 243.473447] etnaviv-gpu 130000.gpu: active fence: 13324

[ 243.479301] etnaviv-gpu 130000.gpu: hangcheck recover!

FPS: 0 FrameTime: inf ms

[jellyfish] <default>: FPS: 54 FrameTime: 18.519 ms

[terrain] <default>: FPS: 4 FrameTime: 250.000 ms

[shadow] <default>: FPS: 39 FrameTime: 25.641 ms

[refract] <default>: FPS: 14 FrameTime: 71.429 ms

[conditionals] fragment-steps=0:vertex-steps=0: FPS: 78 FrameTime: 12.821 ms

[conditionals] fragment-steps=5:vertex-steps=0: FPS: 62 FrameTime: 16.129 ms

[conditionals] fragment-steps=0:vertex-steps=5: FPS: 79 FrameTime: 12.658 ms

[function] fragment-complexity=low:fragment-steps=5: FPS: 74 FrameTime: 13.514 ms

[function] fragment-complexity=medium:fragment-steps=5: FPS: 62 FrameTime: 16.129 ms

[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 74 FrameTime: 13.514 ms

[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 74 FrameTime: 13.514 ms

[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 62 FrameTime: 16.129 ms

=======================================================

glmark2 Score: 60

=======================================================

0 Kudos

5,828 Views
alexeylugovskoy
Contributor II

Hello,

has anyone tried to bring up weston with mesa etnaviv driver for getting 3D acceleration? Currently i.mx graphics is governed by 2 drm drivers in linux-4.10 kernel. The first kernel driver is imx (reported as "display susbsystem" in dts file and respresented as /dev/dri/card1). The second kernel driver is etnaviv (reported as "gpu subsystem" in dts and represented as /dev/dri/card0). Mesa has corresponded drivers called imx-drm and etnaviv. For some reason weston uses only /dev/dri/card1 and mesa imx-drm driver. It works well, but does not support 3D acceleration, so running glxgears with proper performance or weston-simple-egl demo is not possible. Even if mesa etnaviv driver is configured and built for weston, weston drm-compositor still uses one drm device /dev/dri/card1, attaches corresponded mesa imx-drm driver, but does not use etnaviv. Will appriciate comments and ideas on how to resolve this.

0 Kudos

5,828 Views
mtx512
Contributor V

I did have etnaviv working with weston but it over a year ago since I last looked into it, so it should be possible (see video)

0 Kudos

5,828 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Alexey,

I am getting a similar problem with kmscube and QT5.

When I use the kmscube package from:
https://cgit.freedesktop.org/mesa/kmscube/log/

# kmscube
drmModeGetResources failed: Invalid argument
failed to initialize legacy DRM

It works if I explicitly pass the /dev/dri device:

kmscube -D /dev/dri/card1

When I try to run the Qt5_CinematicExperience demo:

#  /usr/share/Qt5/CinematicExperience/Qt5_CinematicExperience
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
drmModeGetResources failed
Segmentation fault
#

I think QT5 is trying to access /dev/dri/card0, but it should be using
/dev/dri/card1 instead.

Seems like the same issue you are seeing. I would suggest you to report this issue at etnaviv@lists.freedesktop.org

Thanks 

0 Kudos

5,828 Views
mathias_faro
Contributor II

Hi,

Sorry for responding in this "kind of" old thread, but I have exactly the same problem than you FabioEstevam‌ ( I need to specify the card1 to kmscube, and if I test glmark2 or es2gears for example, it also fails) and I wonder if you found any work-around to have everything working with the correct /dev/dri/card ?

Thanks

Mathias

0 Kudos

5,828 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Mathias,

With recent kernels I got it to work with dri0, so no need to pass the card explicitely to kmscube.

5,828 Views
vishwanchandapu
Contributor III

Hi Fabio,

Could you please let me know kernel version .

With Regards

Vishwa

0 Kudos

5,828 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Vishwa,

Please try the latest mainline kernel 4.17.

Also, as this thread is rather old, please start a new one to discuss it further or post to etnaviv@lists.freedesktop.org 

Thanks

0 Kudos

5,828 Views
mathias_faro
Contributor II

Thank you Fabio,

I'll try to update my kernel to the next LTS version (4.14) and see if the problem is solved.

Have a good day,

Mathias

0 Kudos

5,828 Views
fabio_estevam
NXP Employee
NXP Employee

I suggest you to use kernel 4.9.5 and mesa 17.0.0-rc1, which contains Etnaviv support.

For Etnaviv issues, I suggest you to post them to etnaviv@lists.freedesktop.org.

5,828 Views
fabio_estevam
NXP Employee
NXP Employee

Glad to see that you managed to get it running at:

Etnaviv+Mesa 13 on IMX6Q with Linux 4.8.10 

If you have a chance, it would be nice to write a mini HOWTO with the steps so that someone else trying to do the same can run smoothly.

Thanks

0 Kudos

5,827 Views
alexeylugovskoy
Contributor II

Hello Alexandr,

could you please advise how to build etnadrm-gpu accelerating module using Russel King's xf86-video-armada tree?

For example etnadrm.c from there has:

#include <etnaviv/viv.h>
#include <etnaviv/etna.h>
#include <etnaviv/etna_bo.h>


Found these headers only in very old libetnaviv git https://github.com/etnaviv/libetnaviv and it says:

"Fully OSS userspace interface to the galcore kernel graphics driver - Legacy, use upstream libdrm instead: https://cgit.freedesktop.org/mesa/drm/ "

But libdrm with etnaviv support doesn't have these headers (viv.h and others)...

Note that we use etnaviv_drm from 4.10.0 kernel.

Thanks in advance!

Alexey

5,827 Views
marokkoav
Contributor II

I built it with libetnaviv and Armada DRM (from http://git.arm.linux.org.uk/cgit/libdrm-armada.git/), but then it does not use libetnaviv.so and libdrm_etnaviv.so:

-bash-4.2# ldd /opt/lib/X11/modules/drivers/etnadrm_gpu.so
linux-vdso.so.1 (0xbec36000)
libdrm_armada.so.0 => /opt/lib/libdrm_armada.so.0 (0xb6edb000)
libdrm.so.2 => /opt/lib/libdrm.so.2 (0xb6eca000)
librt.so.1 => /lib/librt.so.1 (0xb6ebc000)
libm.so.6 => /lib/libm.so.6 (0xb6e51000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6e2f000)
libc.so.6 => /lib/libc.so.6 (0xb6d4d000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb6d32000)
//lib/ld-linux.so.3 (0x7f645000)

"Device" section from xorg.conf:
Identifier "card1"
Driver "armada"
Option "Screen" "0"
Option "UseGPU" "TRUE"
Option "XvAccel" "TRUE"
Option "DRI" "TRUE"
Option "XvPreferOverlay" "FALSE"
Option "AccelModule" "etnadrm_gpu"

"glxgears -info" after export MESA_GL_VERSION_OVERRIDE="2.0":

GL_RENDERER = Gallium 0.4 on Vivante GC2000 rev 5108
GL_VERSION = 2.0 Mesa 17.0.0-rc1
GL_VENDOR = etnaviv

5,827 Views
chrisscholtes
Contributor I

Hi,

I am having the same problem as Alexey and can't get the xf86-video-armada to build with etnaviv support.

I cannot build libetnaviv as it has dependencies to the old galcore drivers, which seems outdated.

My understanding is that the new libdrm and mesa are supposed to replace these.

Update:

So i managed to build libetnaviv by pointing it to the galcore headers (GitHub - etnaviv/galcore_headers: Collection of various headers for different versions of the galcor... ) using the --with-galcore-include option.

Then i managed to build armada with etnaviv support and it seems to run with GPU support.

However, i think libdrm_etnaviv is not used this way

5,827 Views
alexeylugovskoy
Contributor II

Chris,

thanks for additional details!

We were able to build xf86-video-armada with etnadrm_gpu. In order to do that we used additonal packets: libdrm-armada(mentioned in the build instructions) and libetnaviv (not mentioned, but headers are required to build etnadrm_gpu). We have not analized yet, but from the first glance structures from libetnaviv headers are used for driver's internal needs only and are not used outside the driver. Theoretically it's possible just directly add those headers to xf86-video-armada and get rid from libetnaviv. We also used the latest libdrm and mesa (with latest etnaviv changes from upstream) that are needed for xorg extension libglx. After all these steps we were able to run accelerated glxgears.

5,827 Views
marokkoav
Contributor II

But with "armada" driver I have glxgears -info:

GL_RENDERER = Gallium 0.4 on Vivante GC2000 rev 5108
GL_VERSION = 1.4 Mesa 17.0.0-rc1
GL_VENDOR = etnaviv

How can I get GL 2.0 or 3.0 instead of 1.4?

0 Kudos

5,827 Views
fabio_estevam
NXP Employee
NXP Employee

I suggest you to post to etnaviv or mesa mailing lists.