Closed sergey-suloev closed 6 years ago
@sergey-suloev load driver in this way:
So it is more verbose. After launch malitest. Then launch:
and post it here. You're very very close to have it working.
Did you set CONFIG_DRM_FBDEV_OVERALLOC option or the drm_kms_helper.drm_fbdev_overalloc parameter to 200?
I didn't set CONFIG_DRM_FBDEV_OVERALLOC at compile time but I am using the kernel boot parameter .
[ 0.000000] Kernel command line: root=UUID=60742261-81da-41a8-bba5-5362f83e9a94 rootwait rootfstype=ext4 console= console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=b1daacee-01 ubootsource=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u drm_kms_helper.edid_firmware=HDMI-A-1:edid/720x480.bin video=HDMI-A-1:720x480-24@60 drm_kms_helper.drm_fbdev_overalloc=200 mali.mali_debug_level=5 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1
It seems everything correct! Please try set CONFIG_DRM_FBDEV_OVERALLOC=200 and recompile kernel. Because I've never tried it with drm_kms_helper.drm_fbdev_overalloc=200 as bootargs. Really you're almost there. But doesn't show up a triagle on screen?
Anyway with this dmesg you can be helped for sure!
no. it is not showing anything
ok, I'll try to recompile
After recompile http://sprunge.us/NgeA Able to see the reason of the issue from the debug log ? Me not.
Two possibility come into my mind:
Another useful thing you could do is executing malitest with strace and pastebin it. At least we can check syscalls. For the rest I don't have other ideas and I leave answer to more expert people! @mripard @net147
@giuliobenetti thanks But why do we always think the problem is in the driver itself ? We have another important component, libMali.so, which is opaque. We have no idea what's going on there - no source, no debug logs, etc. It may be even binary incompatible with my system.
@giuliobenetti thermal thermal_zone0: failed to read out thermal zone (-110): but it should be a "soft-error" It seems like a minor one, AFAIK
@giuliobenetti tried with Waveshare-compatible 3.5 inch SPI display to exclude possible HDMI issues - same error. i.e. problem either in the driver code or in libMali.so
Qt5 says:
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_mali") qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_mali", "eglfs_emu") qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_mali" qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_mali"
Unable to query physical screen size, defaulting to 100 dpi. To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGL Error : Could not create the egl surface: error = 0x3003
At this point I would dig into dts or kernel drm. At least another step Has been done
@giuliobenetti so you don't think the problem can be in the user-mode library ? As driver does not show any error the only component that may fail is libMali.so. is there source code anywhere ?
@sergey-suloev I would say almost impossible, and if it is that way, the only chance we have is to set some environment variable to make it work.
@giuliobenetti my point is that we don't know how this binary was built and for what platform and compilation flags. how can we be sure that it is going to work on any Soc?
There is a build configuration here: https://github.com/free-electrons/mali-blobs/blob/master/r6p2/fbdev/information
For the rest only testing will tell us the truth. Maybe @net147 can help with this also.
@giuliobenetti GCC 4.8. so old version.
@sergey-suloev yes I know, but I've compiled with 6.4 and works correctly.
@giuliobenetti I am pretty much unsure about following flags:
--with-fpu=vfpv3-d16 --with-mode=thumb
@sergey-suloev that's a good point, do you compiler support vfp-d16? I can tell you that if it supports neon too, it's ok, because it's not used by libMali.so But check for fpu. Even if I expect more a segmentation fault than an a "clear" error 0x3003 that means BAD_ALLOC from opengl ES
@giuliobenetti are you talking about user-mode flags or kernel ? what are your flags for kernel ?
vfp-d16 is the lowest denominator of the VFP FPUs, VFP with 3w Registers and VFP 4 will work with this setting.
Cheers, Kai
Sent from my iPad
On Dec 2, 2017, at 13:53, Giulio Benetti notifications@github.com<mailto:notifications@github.com> wrote:
@sergey-suloevhttps://github.com/sergey-suloev that's a good point, do you compiler support vfp-d16? I can tell you that if it supports neon too, it's ok, because it's not used by libMali.so But check for fpu. Even if I expect more a segmentation fault than an a "clear" error 0x3003 that means BAD_ALLOC from opengl ES
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mripard/sunxi-mali/issues/15#issuecomment-348690321, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APbi3dpD4AflHk6_-DY-vDCA7clvxNKGks5s8UhSgaJpZM4Qyodb.
@hor63 thanks what do you think about "thumb" option ?
Should not be a problem. Thumb and Arm instruction set mix , particularly between shared libraries is supported. Otherwise the user-space Blob would not work at all because you invoke from your application.
Sent from my iPad
On Dec 2, 2017, at 14:04, orpaltech notifications@github.com<mailto:notifications@github.com> wrote:
@hor63https://github.com/hor63 thanks what do you think about "thumb" option ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mripard/sunxi-mali/issues/15#issuecomment-348690898, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APbi3QN7xlKL0HVFjZvL6I3ASRIzMCCMks5s8Ur0gaJpZM4Qyodb.
Some issues I had with eglCreateWindowSurface():
@paolosabatino @sergey-suloev To rule out access issues run the test program as root, i.e. run
sudo
@sergey-suloev I lost track somehow. Did the kernel module load properly? Here's from /var/log/syslog from my Cubieboard where I named the memory region "cma": Dec 5 20:45:03 horOV kernel: [ 4.371525] mali: loading out-of-tree module taints kernel. Dec 5 20:45:03 horOV kernel: [ 4.376006] platform mali-utgard: assigned reserved memory node cma Dec 5 20:45:03 horOV kernel: [ 4.376449] Allwinner sunXi mali glue initialized Dec 5 20:45:03 horOV kernel: [ 4.387117] Mali: Dec 5 20:45:03 horOV kernel: [ 4.387131] Found Mali GPU Mali-400 MP r1p1 Dec 5 20:45:03 horOV kernel: [ 4.388471] Mali: Dec 5 20:45:03 horOV kernel: [ 4.388483] 2+0 PP cores initialized Dec 5 20:45:03 horOV kernel: [ 4.389560] Mali: Dec 5 20:45:03 horOV kernel: [ 4.389572] Mali device driver loaded
Does it look like that on your device?
@hor63 yeah, the module is loaded fine. I have all the messages in place.
Next try sudo.
@hor63 working as root on device
Yeah!!!! Now things should be easier. Do a ls /dev/fb0 /dev/mali I am asking about the access rights.
@hor63 got both
Please post the output from: ls -l /dev/fb0 /dev/mali
@sergey-suloev ?? YOU ARE SO CLOSE!!!! :)
@hor63 sry for delay, had to finish other stuff
root@aapi-ujhnevn:~# ls -la /dev/fb0 crw-rw---- 1 root video 29, 0 Dec 5 20:58 /dev/fb0
root@aapi-ujhnevn:~# ls -la /dev/mali crw------- 1 root root 10, 57 Dec 5 20:58 /dev/mali
@hor63 here is also my dmesg and system info http://sprunge.us/eZKQ
Only root has access to /dev/mali. Change the permissions so that your user can access it.
@mripard the only user on this device is root
root@aapi-ujhnevn:~/mali_test/build# ./mali_test EGL Version: "1.4 Linux-r6p2-01rel0" EGL Vendor: "ARM" EGL Extensions: "EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_KHR_partial_update EGL_KHR_create_context_no_error " Error: eglCreateWindowSurface failed: 0x00003003
source code is here https://github.com/sergey-suloev/sunxi-mali/tree/master/examples/mali_test there is no error at driver level ... I think that there is no call to driver before the error happens. I can see that there is no single message after running test app in dmesg.
@sergey-suloev But what I see from your dmesg is: [ 9.808359] Mali<2>: [ 9.808361] Driver revision: r8p0-01rel0-3f06e9c
Why r8p0-01rel0-3f06e9c??? It has to be r6p2! That's the point!
Because only r6p2 user space blobs are provided, so recompile with r6p2 kernel driver, use r6p2 user space blobs and it has to work this time!
@giuliobenetti no matter which version it is.. the error is the same I tested r6p2 long time till now. this is my own compilation, but error is the same
@sergey-suloev For sure it's not a good thing mix versions up. Please go back to r6p2 in any case. If you use r8p0 it can work or not, and if it does, it works in a unpredictable way.
@giuliobenetti i will get back to r6p2. but again it's not gonna change anything I am almost sure that my problem is in blobs, because there is no messages in dmesg during test app run.
@sergey-suloev it's incredible it doesn't work, you're 1cm from the end... @net147 I know had H3 working if I'm not wrong. @net147 can you help @sergey-suloev to solve this problem?
@giuliobenetti if problem was in kernel that would be at least 1 debug message.. but there is nothing. no actions taken on driver.. no memory allocations.. nothing same for r6p2
@sergey-suloev only "fail" I see in your dmesg is "thermal thermal_zone0: failed to read out thermal zone (-110)" Can you pastebin your dts and dtsi?
@giuliobenetti I have only used Mali on A20
@net147 ooh ok thank you. I was almost sure you've used H3 when we've spoken on IRC and you helped me to get it working on A20. Does it come into your mind something else for @sergey-suloev ? Or do you know anyone else who tested r6p2 on H3 succesfully? Thanks
@sergey-suloev do not mix the kernel driver version and the userland drivers. I understand that you may guess the newest the better, but the kernel driver interface may be different and userland drivers may not be able to communicate with the hardware correctly if you mix the versions.
This is the output of my dmesg (kernel 4.13.16, OrangePi PC running armbian):
[ 15.404732] mali-utgard: assigned reserved memory node linux,cma
[ 15.405275] Allwinner sunXi mali glue initialized
[ 15.407087] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 15.410328] Mali:
[ 15.410338] Found Mali GPU Mali-400 MP r1p1
[ 15.411478] Mali:
[ 15.411487] 2+0 PP cores initialized
[ 15.412290] Mali:
[ 15.412297] Mali device driver loaded
so yours looks fine to me.
Do you have a display connected to your HDMI connector? Also, which kernel and distro are you running?
@giuliobenetti my orangepi pc is an H3 and it is running fine
Hello guys I was able to compile mali driver with "debug" and also the test application. Below you can see the console output:
dmesg log contains only typical boot output: