Debian Stretch - xf86 ABI and armsoc

Moderators: odroid, mdrjr

Debian Stretch - xf86 ABI and armsoc

Unread postby mickywicky » Sat Feb 11, 2017 8:02 am

So I did the upgrade to Stretch... aside from X, everything is fine.
X has the expected ABI compatibility break.
It seems to be on ABI version 23 now.
I'm trying to follow these instructions to rebuild the driver: https://docs.google.com/document/d/1FaCRUXw8_BJ9e7F5zV_1koTczJXvyurSUu2ntiVjw-c

But I assume they must be out of date vs Stretch as I get a lot of compile errors when trying make

Code: Select all
odroid:/home/michael/src/xf86-video-armsoc$ make
make  all-recursive
make[1]: Entering directory '/home/michael/src/xf86-video-armsoc'
Making all in src
make[2]: Entering directory '/home/michael/src/xf86-video-armsoc/src'
  CC       drmmode_display.lo
drmmode_display.c: In function 'drmmode_set_mode_major':
drmmode_display.c:411:3: error: 'xf86_reload_cursors' is deprecated [-Werror=deprecated-declarations]
   xf86_reload_cursors(pScrn->pScreen);
   ^~~~~~~~~~~~~~~~~~~
In file included from drmmode_driver.h:31:0,
                 from drmmode_display.c:52:
/usr/include/xorg/xf86Crtc.h:991:37: note: declared here
 static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {}
                                     ^~~~~~~~~~~~~~~~~~~
drmmode_display.c: In function 'drmmode_handle_uevents':
drmmode_display.c:1803:14: error: storage size of 's' isn't known
  struct stat s;
              ^
drmmode_display.c:1816:6: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
  if (fstat(pARMSOC->drmFD, &s)) {
      ^~~~~
drmmode_display.c:1816:2: error: nested extern declaration of 'fstat' [-Werror=nested-externs]
  if (fstat(pARMSOC->drmFD, &s)) {
  ^~
drmmode_display.c:1803:14: error: unused variable 's' [-Werror=unused-variable]
  struct stat s;
              ^
drmmode_display.c: In function 'drmmode_init_wakeup_handler':
drmmode_display.c:1904:2: error: implicit declaration of function 'AddGeneralSocket' [-Werror=implicit-function-declaration]
  AddGeneralSocket(pARMSOC->drmFD);
  ^~~~~~~~~~~~~~~~
drmmode_display.c:1904:2: error: nested extern declaration of 'AddGeneralSocket' [-Werror=nested-externs]
drmmode_display.c:1905:33: error: passing argument 1 of 'RegisterBlockAndWakeupHandlers' from incompatible pointer type [-Werror=incompatible-pointer-types]
  RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
                                 ^
In file included from /usr/include/xorg/privates.h:151:0,
                 from /usr/include/xorg/cursor.h:53,
                 from /usr/include/xorg/scrnintstr.h:53,
                 from /usr/include/xorg/xf86str.h:39,
                 from /usr/include/xorg/xf86.h:44,
                 from /usr/include/xorg/xf86i2c.h:9,
                 from /usr/include/xorg/xf86DDC.h:16,
                 from drmmode_display.c:35:
/usr/include/xorg/dix.h:233:23: note: expected 'ServerBlockHandlerProcPtr {aka void (*)(void *, void *)}' but argument is of type 'void (*)(void *, struct timeval **, void *)'
 extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drmmode_display.c:1906:4: error: passing argument 2 of 'RegisterBlockAndWakeupHandlers' from incompatible pointer type [-Werror=incompatible-pointer-types]
    drmmode_wakeup_handler, pARMSOC);
    ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/xorg/privates.h:151:0,
                 from /usr/include/xorg/cursor.h:53,
                 from /usr/include/xorg/scrnintstr.h:53,
                 from /usr/include/xorg/xf86str.h:39,
                 from /usr/include/xorg/xf86.h:44,
                 from /usr/include/xorg/xf86i2c.h:9,
                 from /usr/include/xorg/xf86DDC.h:16,
                 from drmmode_display.c:35:
/usr/include/xorg/dix.h:233:23: note: expected 'ServerWakeupHandlerProcPtr {aka void (*)(void *, int)}' but argument is of type 'void (*)(void *, int,  void *)'
 extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drmmode_display.c: In function 'drmmode_fini_wakeup_handler':
drmmode_display.c:1911:31: error: passing argument 1 of 'RemoveBlockAndWakeupHandlers' from incompatible pointer type [-Werror=incompatible-pointer-types]
  RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
                               ^
In file included from /usr/include/xorg/privates.h:151:0,
                 from /usr/include/xorg/cursor.h:53,
                 from /usr/include/xorg/scrnintstr.h:53,
                 from /usr/include/xorg/xf86str.h:39,
                 from /usr/include/xorg/xf86.h:44,
                 from /usr/include/xorg/xf86i2c.h:9,
                 from /usr/include/xorg/xf86DDC.h:16,
                 from drmmode_display.c:35:
/usr/include/xorg/dix.h:237:23: note: expected 'ServerBlockHandlerProcPtr {aka void (*)(void *, void *)}' but argument is of type 'void (*)(void *, struct timeval **, void *)'
 extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drmmode_display.c:1912:4: error: passing argument 2 of 'RemoveBlockAndWakeupHandlers' from incompatible pointer type [-Werror=incompatible-pointer-types]
    drmmode_wakeup_handler, pARMSOC);
    ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/xorg/privates.h:151:0,
                 from /usr/include/xorg/cursor.h:53,
                 from /usr/include/xorg/scrnintstr.h:53,
                 from /usr/include/xorg/xf86str.h:39,
                 from /usr/include/xorg/xf86.h:44,
                 from /usr/include/xorg/xf86i2c.h:9,
                 from /usr/include/xorg/xf86DDC.h:16,
                 from drmmode_display.c:35:
/usr/include/xorg/dix.h:237:23: note: expected 'ServerWakeupHandlerProcPtr {aka void (*)(void *, int)}' but argument is of type 'void (*)(void *, int,  void *)'
 extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drmmode_display.c:1913:2: error: implicit declaration of function 'RemoveGeneralSocket' [-Werror=implicit-function-declaration]
  RemoveGeneralSocket(pARMSOC->drmFD);
  ^~~~~~~~~~~~~~~~~~~
drmmode_display.c:1913:2: error: nested extern declaration of 'RemoveGeneralSocket' [-Werror=nested-externs]
cc1: all warnings being treated as errors
Makefile:503: recipe for target 'drmmode_display.lo' failed
make[2]: *** [drmmode_display.lo] Error 1
make[2]: Leaving directory '/home/michael/src/xf86-video-armsoc/src'
Makefile:441: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/michael/src/xf86-video-armsoc'
Makefile:373: recipe for target 'all' failed
make: *** [all] Error 2
odroid:/home/michael/src/xf86-video-armsoc$


I don't think Ubuntu has precompiled Exynos drivers for ABI > 20 at the moment, so can't try those.
Any pointers?
mickywicky
 
Posts: 17
Joined: Sat Nov 16, 2013 9:15 am
languages_spoken: English, German, French
ODROIDs: U2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby meveric » Sat Feb 11, 2017 8:14 pm

I've tried compiling this myself, and while I get past the above error by adding CLFAGS=-w there are some other issues I try to figure out at the moment. I'll report back when I know more.

Edit:
Ok, additionally the following patch is needed as well:
Code: Select all
diff --git a/src/compat-api.h b/src/compat-api.h
index fefbc59..a7eae97 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -77,9 +77,14 @@
 
 #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
 
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
+#define BLOCKHANDLER_ARGS arg, pTimeout
+#else
 #define BLOCKHANDLER_ARGS_DECL \
    ScreenPtr arg, pointer pTimeout, pointer pReadmask
 #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
+#endif
 
 #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
 #define CLOSE_SCREEN_ARGS pScreen


Edit 2:
I've added it to my repository. You can download it manually from: http://oph.mdrjr.net/meveric/pool/main/ ... _armhf.deb
or by adding my repository list file to your image: http://oph.mdrjr.net/meveric/sources.li ... -main.list
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7062
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby mickywicky » Sat Feb 11, 2017 9:35 pm

I've applied the patch but where did you add CFLAGS=-w ?
mickywicky
 
Posts: 17
Joined: Sat Nov 16, 2013 9:15 am
languages_spoken: English, German, French
ODROIDs: U2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby mickywicky » Sat Feb 11, 2017 11:39 pm

Nice work.
So I've added the repo and installed it.
It yields a strange behaviour when launching X: the screen refreshes/flickers but remains blank.
looking at the lightdm log, the startx output is identical:

Code: Select all
X.Org X Server 1.19.1
Release Date: 2017-01-11
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.16.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux odroid 3.8.13.30 #1 SMP PREEMPT Fri Sep 4 23:45:57 BRT 2015 armv7l
Kernel command line: console=tty1 console=ttySAC1,115200 mem=2047M console=tty1 console=ttySAC1,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro  mem=2047M
Build Date: 20 January 2017  03:47:48AM
xorg-server 2:1.19.1-4 (https://www.debian.org/support)
Current version of pixman: 0.34.0
   Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Sat Feb 11 14:33:15 2017
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
/usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/drivers/armsoc_drv.so: undefined symbol: AddGeneralSocket
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
mickywicky
 
Posts: 17
Joined: Sat Nov 16, 2013 9:15 am
languages_spoken: English, German, French
ODROIDs: U2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby LiquidAcid » Sat Feb 11, 2017 11:54 pm

This isn't surprising. The warnings about implicit function declarations are there for a reason. You guys just pushed compile errors to the dynamic loader stage.
LiquidAcid
 
Posts: 1056
Joined: Fri Oct 11, 2013 11:07 pm
languages_spoken: english
ODROIDs: X2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby meveric » Sun Feb 12, 2017 2:09 am

LiquidAcid wrote:This isn't surprising. The warnings about implicit function declarations are there for a reason. You guys just pushed compile errors to the dynamic loader stage.

You're right, I've totally missed that :(
But luckily the driver was updated and I was able to build a more current version.
I'm already uploading it, but will do some testing myself also want to check on some changes that were done in the past to see if they are still needed or not.

Edit:
Generally the new package is working, window movement is somewhat slow and I'm trying to test OpenGL ES to see if it's working.

Edit 2:
I added glmark2-es2 to the repository and did some test.
It's not bad fullscreen tries to hold 60 FPS which means vsync support. Window Mode is quite good I even saw 100 FPS in window mode.
In the past we could see that window mode was rather slow while fullscreen was a lot faster.

I'm not sure though, I think GLESv2 under Debian Jessie with the older armsoc driver was somewhat faster, but this one currently has no optimization and I haven't tried if it armsoc runs without the changes we made for the older systems.

Generally all seems to work fine up to now, even if it might not be as fast as under Debian Jessie.

Edit 3:
I did some testing with some different options. Removed some of the old code changed some things, the result is interesting.
First change I noticed was that full screen was no longer 60 FPS but rather about 90 FPS in 1080p comparing with different resolutions and results from earlier tests, I can say it tries to hold 2x Refresh rate, so if you have 60 Hz it tries to hold 120 FPS, if you have 50 Hz it tries to hold 100 FPS.
But also on the first change I noticed a huge drop on FPS in desktop mode. 35 FPS in avg.
Now I found a setting where it get's over 100 FPS in window mode and around 90 FPS in FullScreen (trying to hold 2x refresh rate).
Since this version is faster than the previous one I will upload it. Still gonna try to investigate if there's an option that allows for 60 FPS rather than 120 FPS.

Still moving windows on the desktop is extremely slow :(

Edit 4:
I was playing around with more exynos_drm flags and had some interesting results. Using a different memory handling.
Although I had some artifacts I could drastically speed up the desktop performance while accepting some artifacts while moving windows, but also keeping the same speed on fullscreen.
In fact, desktop performance was so good, I got a score of 254 FPS on the U3 in one of the tests (with the asteroids).

Sadly you have stronger artifacts with windows that do not update often, like the terminal if you type something :(
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7062
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby mickywicky » Mon Feb 13, 2017 4:57 am

I see what you mean... one other thing that's changed is video playback with ffplay - it now pegs the CPU at 100% and isn't fluid. HD videos are playing at low FPS, maybe 5 FPS.
I noticed this message when launching ffplay:
Code: Select all
MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: exynos_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: exynos
shared memfd open() failed: Function not implemented


The last line is definitely new to me. The first line probably as well.

Edit: Fullscreen seems to work now. But at very low FPS

Edit 2:
so I launched Kodi... fullscreen playback works perfectly fine. Windowed mode playback has the same issues as ffplay (windows for fullscreen).
the Kodi UI elements are displayed with a jitter, the whole UI seems to constantly move back and forth by a few pixels horizontally, and the rightmost pixels are actually displayed on the left.
mickywicky
 
Posts: 17
Joined: Sat Nov 16, 2013 9:15 am
languages_spoken: English, German, French
ODROIDs: U2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby LiquidAcid » Mon Feb 13, 2017 5:57 am

meveric wrote:I was playing around with more exynos_drm flags and had some interesting results. Using a different memory handling.
Although I had some artifacts I could drastically speed up the desktop performance while accepting some artifacts while moving windows, but also keeping the same speed on fullscreen.
In fact, desktop performance was so good, I got a score of 254 FPS on the U3 in one of the tests (with the asteroids).

Sadly you have stronger artifacts with windows that do not update often, like the terminal if you type something :(

Neither interesting, nor unexpected. You probably added the flag to always request write-cached buffer objects. But the GPU is not cache coherent, so you now see cache lines that weren't flushed to system memory yet. Add implicit flushing to the driver, and you're back to previous levels of performance.
LiquidAcid
 
Posts: 1056
Joined: Fri Oct 11, 2013 11:07 pm
languages_spoken: english
ODROIDs: X2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby meveric » Mon Feb 13, 2017 8:45 am

mickywicky wrote:I see what you mean... one other thing that's changed is video playback with ffplay - it now pegs the CPU at 100% and isn't fluid. HD videos are playing at low FPS, maybe 5 FPS.
I noticed this message when launching ffplay:
Code: Select all
MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: exynos_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: exynos
shared memfd open() failed: Function not implemented


The last line is definitely new to me. The first line probably as well.

Edit: Fullscreen seems to work now. But at very low FPS

Edit 2:
so I launched Kodi... fullscreen playback works perfectly fine. Windowed mode playback has the same issues as ffplay (windows for fullscreen).
the Kodi UI elements are displayed with a jitter, the whole UI seems to constantly move back and forth by a few pixels horizontally, and the rightmost pixels are actually displayed on the left.

The libGL error indicates that it tries to run in OpenGL which is not supported by ODROIDs so there's no surprise that it's slow.
I tried using gl4es (GLshim) and got fullspeed HD video using ffplay, although the picture was slightly jumping.
I'm currently trying to rebuild SDL2 for GLES only cause I think that's part of the issue.

LiquidAcid wrote:Neither interesting, nor unexpected. You probably added the flag to always request write-cached buffer objects. But the GPU is not cache coherent, so you now see cache lines that weren't flushed to system memory yet. Add implicit flushing to the driver, and you're back to previous levels of performance.

Maybe for you that isn't surprising, for me it was, especially since the 3D content although 250 FPS did not have any artifacts, only the 2D part and the desktop seem to be affected by it. For me yes that was interesting, but I'm not so far into these kind of topics as you or other users are.
I'm just trying to get the desktop performance back to what it was on Jessie, and tried with the few option I have and could figure out.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7062
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby LiquidAcid » Mon Feb 13, 2017 9:23 am

Also the mixer isn't cache coherent. The performance increase you see is merely a side-effect of not synchronizing what the different blocks (CPU, GPU, mixer, etc.) see. As soon as you fix that, either by disabling caching for the BO or by implicitly flushing the cache before handing the buffer to another device/block, your performance increase disappears again. There is nothing like a free lunch ;)
LiquidAcid
 
Posts: 1056
Joined: Fri Oct 11, 2013 11:07 pm
languages_spoken: english
ODROIDs: X2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby meveric » Mon Feb 13, 2017 4:24 pm

LiquidAcid wrote:Also the mixer isn't cache coherent. The performance increase you see is merely a side-effect of not synchronizing what the different blocks (CPU, GPU, mixer, etc.) see. As soon as you fix that, either by disabling caching for the BO or by implicitly flushing the cache before handing the buffer to another device/block, your performance increase disappears again. There is nothing like a free lunch ;)

Too bad I'd say, especially since it's known that the GPU is not running as fast as it could be.
Some Mali developer already confirmed, that the MaliT628 on the XU3/XU4 should also run at about 1000 FPS rather than about 120 or whatever it's able to output similar numbers should apply to the Mali 400.
Well, let's see if we at least can go back to the performance of Debian Jessie, that would be a nice start ;)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7062
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby mickywicky » Tue Mar 28, 2017 6:49 pm

Have you had any luck with this so far? I've noticed that video playback is fine in Chromium and Kodi (fullscreen), but ffplay still acting up. Performance is otherwise acceptable, but definitely not on par with Jessie.
mickywicky
 
Posts: 17
Joined: Sat Nov 16, 2013 9:15 am
languages_spoken: English, German, French
ODROIDs: U2

Re: Debian Stretch - xf86 ABI and armsoc

Unread postby meveric » Tue Mar 28, 2017 9:04 pm

I haven't put much more time into it. If you compile gl4es (OpenGL -> OpenGL ES wrapper) and run ffplay with that then ffplay is full speed as well.
Aside from that I couldn't do much since I was busy with other things.
Normally you should be able to recompile ffmpeg to use OpenGL ES instead of OpenGL but my first tries did not work.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7062
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2


Return to Other OS

Who is online

Users browsing this forum: No registered users and 2 guests